close_apply.js 4.7 KB
// pages/close_apply/close_apply.js
const app = getApp();
Page({

 /**
  * 页面的初始数据
  */
 data: {
  //
  showapply: false,
  provincearr: [],
  cityarr: [],
  countryarr: [],
  confirmvalarr: [0, 0, 0],
  valarr: [0, 0, 0],
  photo: '',
  name: '',
  enddata: '',
  arraysex: ['男', '女'],
  sex: '',
  birthday: '', //生日
  nation: '', //民族
  nationarr: ["汉族", "蒙古族", "回族", "藏族", "维吾尔族", "苗族", "彝族", "壮族", "布依族", "朝鲜族", "满族", "侗族", "瑶族", "白族", "土家族",
   "哈尼族", "哈萨克族", "傣族", "黎族", "傈僳族", "佤族", "畲族", "高山族", "拉祜族", "水族", "东乡族", "纳西族", "景颇族", "柯尔克孜族",
   "土族", "达斡尔族", "仫佬族", "羌族", "布朗族", "撒拉族", "毛南族", "仡佬族", "锡伯族", "阿昌族", "普米族", "塔吉克族", "怒族", "乌孜别克族",
   "俄罗斯族", "鄂温克族", "德昂族", "保安族", "裕固族", "京族", "塔塔尔族", "独龙族", "鄂伦春族", "赫哲族", "门巴族", "珞巴族", "基诺族"
  ],

  politics: '', //政治面貌
  politicsarr: ['共青团员', '中共预备党员', '中共党员', '群众', '无党派人士', '其他'], //
  education: '', //学历
  educationarr: ['小学', '中学', '专科', '本科', '硕士研究生', '博士研究生', '其他'], //
  unit: '', //工作单位
  duty: '', //职务
  addr: '', //通讯地址,
  postcode: '', //邮编
  school: '', //
  card_number: '', //身份证号码
  fixed_phone: '', //固定电话
  move_phone: '', //
  email: '', //
  urgency_phone: '', //
  qq: '',
  province: '',
  city: '',
  county: '',
  address: '', //详细地址,
  type: '', //1医院志愿者,2社会志愿者,3办事处志愿者
  typearr: ['医院志愿者', '社会志愿者', '办事处志愿者'],
  apply_nav: 0, //0为履历1,1为履历2,2为履历3,
  record: [{
   record_start_time: '',
   record_end_time: '',
   record_unit: '',
   record_duty: '',
   record_name: '',
   record_phone: ''
  },
  {
   record_start_time: '',
   record_end_time: '',
   record_unit: '',
   record_duty: '',
   record_name: '',
   record_phone: ''
  },
  {
   record_start_time: '',
   record_end_time: '',
   record_unit: '',
   record_duty: '',
   record_name: '',
   record_phone: ''
  }
  ],
  front_card: '', //身份证正面照
  reverse_card: '', //身份证反面照
  id: '',//用户id,

 },
 
 getdatalist() {
  let that = this;
  let url = '/index/member_center/edit';
  let params = {
   'id': that.data.id
  };
  let head = {
   'XX-Token': wx.getStorageSync('token')
  }
  app.post(url, params, head).then((res) => {
   let provincearr = that.data.provincearr;
   let cityarr = that.data.cityarr;
   let countryarr = that.data.countryarr;
   let val = [0, 0, 0];
   for (let i = 0; i < provincearr.length; i++) {
    if (provincearr[i].province_name == res.province) {
     val[0] = i;
    }
   }
   for (let i = 0; i < cityarr.length; i++) {
    if (cityarr[i].city_name == res.city) {
     val[1] = i;
    }
   }
   for (let i = 0; i < countryarr.length; i++) {
    if (countryarr[i].country_name == res.county) {
     val[2] = i;
    }
   }
   that.setData({
    valarr: val,
    confirmvalarr: val,
    addr: res.addr,
    address: res.address,
    birthday: res.birthday,
    card_number: res.card_number,
    city: res.city,
    county: res.county,
    duty: res.duty,
    education: res.education,
    email: res.email,
    fixed_phone: res.fixed_phone,
    front_card: res.front_card,
    move_phone: res.move_phone,
    name: res.name,
    nation: res.nation,
    photo: res.photo,
    politics: res.politics,
    postcode: res.postcode,
    province: res.province,
    qq: res.qq,
    record: res.record,
    reverse_card: res.reverse_card,
    school: res.school,
    sex: res.sex,
    unit: res.unit,
    urgency_phone: res.urgency_phone,
    type: res.type
   })
  }).catch((err) => {

  })
 },
 /**
  * 生命周期函数--监听页面加载
  */
 onLoad: function (options) {
  let that = this;
  that.setData({
   id: options.id
  })
  that.getdatalist();
 
 
 },

 /**
  * 生命周期函数--监听页面初次渲染完成
  */
 onReady: function () {

 },

 /**
  * 生命周期函数--监听页面显示
  */
 onShow: function () {

 },

 /**
  * 生命周期函数--监听页面隐藏
  */
 onHide: function () {

 },

 /**
  * 生命周期函数--监听页面卸载
  */
 onUnload: function () {

 },

 /**
  * 页面相关事件处理函数--监听用户下拉动作
  */
 onPullDownRefresh: function () {

 },

 /**
  * 页面上拉触底事件的处理函数
  */
 onReachBottom: function () {

 },

 /**
  * 用户点击右上角分享
  */
 onShareAppMessage: function () {

 }
})