...
|
...
|
@@ -75,67 +75,141 @@ Page({ |
|
|
front_card: '', //身份证正面照
|
|
|
reverse_card: '', //身份证反面照
|
|
|
id: '', //用户id,
|
|
|
status:''//状态
|
|
|
},
|
|
|
|
|
|
onShow: function () {
|
|
|
|
|
|
var that = this;
|
|
|
// 登记表缓存
|
|
|
that.setData({
|
|
|
name: wx.getStorageSync('name'),
|
|
|
sex: wx.getStorageSync('sex'),
|
|
|
photo: wx.getStorageSync('photo'),
|
|
|
front_card: wx.getStorageSync('front_card'),
|
|
|
reverse_card: wx.getStorageSync('reverse_card'),
|
|
|
birthday: wx.getStorageSync('birthday'),
|
|
|
nation: wx.getStorageSync('nation'),
|
|
|
education: wx.getStorageSync('education'),
|
|
|
politics: wx.getStorageSync('politics'),
|
|
|
unit: wx.getStorageSync('unit'),
|
|
|
duty: wx.getStorageSync('duty'),
|
|
|
addr: wx.getStorageSync('addr'),
|
|
|
postcode: wx.getStorageSync('postcode'),
|
|
|
school: wx.getStorageSync('school'),
|
|
|
card_number: wx.getStorageSync('card_number'),
|
|
|
fixed_phone: wx.getStorageSync('fixed_phone'),
|
|
|
move_phone: wx.getStorageSync('move_phone'),
|
|
|
email: wx.getStorageSync('email'),
|
|
|
urgency_phone: wx.getStorageSync('urgency_phone'),
|
|
|
qq: wx.getStorageSync('qq'),
|
|
|
address: wx.getStorageSync('address'),
|
|
|
|
|
|
})
|
|
|
},
|
|
|
|
|
|
// 姓名
|
|
|
setname(e) {
|
|
|
this.setData({
|
|
|
name: e.detail.value
|
|
|
})
|
|
|
wx.setStorageSync('name', e.detail.value)
|
|
|
},
|
|
|
setunit(e) {
|
|
|
// 性别
|
|
|
bindsex(e) {
|
|
|
this.setData({
|
|
|
unit: e.detail.value
|
|
|
sex: parseInt(e.detail.value) + 1
|
|
|
})
|
|
|
wx.setStorageSync('sex', parseInt(e.detail.value) + 1)
|
|
|
},
|
|
|
setduty(e) {
|
|
|
// 出生日期
|
|
|
bindbirthdayChange(e) {
|
|
|
this.setData({
|
|
|
duty: e.detail.value
|
|
|
birthday: e.detail.value
|
|
|
})
|
|
|
wx.setStorageSync('birthday', e.detail.value)
|
|
|
},
|
|
|
setaddr(e) {
|
|
|
// 民族
|
|
|
bindnationChange(e) {
|
|
|
let nationarr = this.data.nationarr;
|
|
|
this.setData({
|
|
|
addr: e.detail.value
|
|
|
nation: nationarr[e.detail.value]
|
|
|
})
|
|
|
|
|
|
wx.setStorageSync('nation', nationarr[e.detail.value])
|
|
|
|
|
|
},
|
|
|
setpostcode(e) {
|
|
|
// 学历
|
|
|
bindeducationChange(e) {
|
|
|
let educationarr = this.data.educationarr;
|
|
|
this.setData({
|
|
|
postcode: e.detail.value
|
|
|
education: educationarr[e.detail.value]
|
|
|
})
|
|
|
wx.setStorageSync('education', educationarr[e.detail.value])
|
|
|
},
|
|
|
setschool(e) {
|
|
|
// 政治面貌
|
|
|
|
|
|
bindpoliticsChange(e) {
|
|
|
let politicsarr = this.data.politicsarr;
|
|
|
this.setData({
|
|
|
school: e.detail.value
|
|
|
politics: politicsarr[e.detail.value]
|
|
|
})
|
|
|
|
|
|
wx.setStorageSync('politics', politicsarr[e.detail.value])
|
|
|
|
|
|
},
|
|
|
setcard_number(e) {
|
|
|
// 工作单位
|
|
|
setunit(e) {
|
|
|
this.setData({
|
|
|
card_number: e.detail.value
|
|
|
unit: e.detail.value
|
|
|
})
|
|
|
wx.setStorageSync('unit', e.detail.value)
|
|
|
},
|
|
|
setemail(e) {
|
|
|
// 职务
|
|
|
setduty(e) {
|
|
|
this.setData({
|
|
|
email: e.detail.value
|
|
|
duty: e.detail.value
|
|
|
})
|
|
|
wx.setStorageSync('duty', e.detail.value)
|
|
|
|
|
|
|
|
|
},
|
|
|
seturgency_phone(e) {
|
|
|
// 通讯地址
|
|
|
setaddr(e) {
|
|
|
this.setData({
|
|
|
urgency_phone: e.detail.value
|
|
|
addr: e.detail.value
|
|
|
})
|
|
|
wx.setStorageSync('addr', e.detail.value)
|
|
|
},
|
|
|
setqq(e) {
|
|
|
//邮编
|
|
|
setpostcode(e) {
|
|
|
this.setData({
|
|
|
qq: e.detail.value
|
|
|
postcode: e.detail.value
|
|
|
})
|
|
|
wx.setStorageSync('postcode', e.detail.value)
|
|
|
},
|
|
|
bindsex(e) {
|
|
|
// 就读学校
|
|
|
setschool(e) {
|
|
|
this.setData({
|
|
|
sex: parseInt(e.detail.value) + 1
|
|
|
school: e.detail.value
|
|
|
})
|
|
|
wx.setStorageSync('school', e.detail.value)
|
|
|
|
|
|
},
|
|
|
// 身份证号
|
|
|
setcard_number(e) {
|
|
|
this.setData({
|
|
|
card_number: e.detail.value
|
|
|
})
|
|
|
wx.setStorageSync('card_number', e.detail.value)
|
|
|
|
|
|
},
|
|
|
//固定电话
|
|
|
setfixed_phone(e) {
|
|
|
this.setData({
|
|
|
fixed_phone: e.detail.value
|
|
|
})
|
|
|
wx.setStorageSync('fixed_phone', e.detail.value)
|
|
|
},
|
|
|
|
|
|
//移动电话
|
...
|
...
|
@@ -143,34 +217,32 @@ Page({ |
|
|
this.setData({
|
|
|
move_phone: e.detail.value
|
|
|
})
|
|
|
wx.setStorageSync('move_phone', e.detail.value)
|
|
|
},
|
|
|
|
|
|
bindbirthdayChange(e) {
|
|
|
this.setData({
|
|
|
birthday: e.detail.value
|
|
|
})
|
|
|
},
|
|
|
bindnationChange(e) {
|
|
|
let nationarr = this.data.nationarr;
|
|
|
// 电子邮箱
|
|
|
setemail(e) {
|
|
|
this.setData({
|
|
|
nation: nationarr[e.detail.value]
|
|
|
email: e.detail.value
|
|
|
})
|
|
|
wx.setStorageSync('email', e.detail.value)
|
|
|
|
|
|
},
|
|
|
bindeducationChange(e) {
|
|
|
let educationarr = this.data.educationarr;
|
|
|
// 紧急联系人
|
|
|
seturgency_phone(e) {
|
|
|
this.setData({
|
|
|
education: educationarr[e.detail.value]
|
|
|
urgency_phone: e.detail.value
|
|
|
})
|
|
|
},
|
|
|
wx.setStorageSync('urgency_phone', e.detail.value)
|
|
|
|
|
|
bindpoliticsChange(e) {
|
|
|
let politicsarr = this.data.politicsarr;
|
|
|
},
|
|
|
// QQ号码
|
|
|
setqq(e) {
|
|
|
this.setData({
|
|
|
politics: politicsarr[e.detail.value]
|
|
|
qq: e.detail.value
|
|
|
})
|
|
|
wx.setStorageSync('qq', e.detail.value)
|
|
|
},
|
|
|
|
|
|
|
|
|
//选择省市区
|
|
|
getarea() {
|
|
|
let that = this;
|
...
|
...
|
@@ -256,7 +328,7 @@ Page({ |
|
|
|
|
|
})
|
|
|
},
|
|
|
bindChange: function(e) {
|
|
|
bindChange: function (e) {
|
|
|
let that = this;
|
|
|
let valarr = that.data.valarr;
|
|
|
let provincearr = that.data.provincearr;
|
...
|
...
|
@@ -312,6 +384,8 @@ Page({ |
|
|
address: provincearr[i].province_name + cityarr[j].city_name + countryarr[k].country_name,
|
|
|
showapply: false
|
|
|
})
|
|
|
|
|
|
wx.setStorageSync('address', this.data.address)
|
|
|
},
|
|
|
|
|
|
setshowapply() {
|
...
|
...
|
@@ -396,6 +470,8 @@ Page({ |
|
|
let tem = e.currentTarget.dataset.tem;
|
|
|
that.uploadImage(tem);
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
//上传头像1为头像,2为省份证正面,3为省份证反面
|
|
|
uploadImage(tem) {
|
...
|
...
|
@@ -403,42 +479,47 @@ Page({ |
|
|
wx.chooseImage({
|
|
|
count: 1,
|
|
|
sizeType: ['original', 'compressed'],
|
|
|
success: function(res) {
|
|
|
success: function (res) {
|
|
|
let tempFilePaths = res.tempFilePaths //总文件
|
|
|
let head = {
|
|
|
'XX-Token': wx.getStorageSync('token'),
|
|
|
'XX-Device-Type': ''
|
|
|
}
|
|
|
let url = 'https://volunteer.cnpu.org/api/user/upload/one';
|
|
|
// let url = 'https://volunteer.cnpu.org/api/user/upload/one';
|
|
|
let url = 'http://volunteer.w.bronet.cn/api/user/upload/one';
|
|
|
|
|
|
wx.uploadFile({
|
|
|
url: url, //仅为示例,非真实的接口地址
|
|
|
filePath: tempFilePaths[0],
|
|
|
name: 'file',
|
|
|
header: head,
|
|
|
formData: {},
|
|
|
success: function(res) {
|
|
|
success: function (res) {
|
|
|
let temdata = JSON.parse(res.data);
|
|
|
if (temdata.code == 20000) {
|
|
|
if (tem == '1') {
|
|
|
that.setData({
|
|
|
photo: temdata.data.url
|
|
|
})
|
|
|
wx.setStorageSync('photo', temdata.data.url)
|
|
|
} else if (tem == '2') {
|
|
|
that.setData({
|
|
|
front_card: temdata.data.url
|
|
|
})
|
|
|
wx.setStorageSync('front_card', temdata.data.url)
|
|
|
} else if (tem == '3') {
|
|
|
that.setData({
|
|
|
reverse_card: temdata.data.url
|
|
|
})
|
|
|
wx.setStorageSync('reverse_card', temdata.data.url)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
fail: function(res) {},
|
|
|
fail: function (res) {},
|
|
|
complete: () => {}
|
|
|
})
|
|
|
},
|
|
|
fail: function(res) {}
|
|
|
fail: function (res) {}
|
|
|
})
|
|
|
},
|
|
|
setapply_nav(e) {
|
...
|
...
|
@@ -490,8 +571,6 @@ Page({ |
|
|
err = '请输入您的身份证号!';
|
|
|
} else if (!AuglyTest_ID.test(that.data.card_number)) {
|
|
|
err = '请输入正确的身份证号!';
|
|
|
} else if (that.data.fixed_phone == '' || !that.data.fixed_phone) {
|
|
|
err = '请输入您的固定电话!';
|
|
|
} else if (that.data.move_phone == '') {
|
|
|
err = '请输入您的移动电话!';
|
|
|
} else if (!AuglyTest_phone.test(that.data.move_phone)) {
|
...
|
...
|
@@ -514,6 +593,7 @@ Page({ |
|
|
err = '请上传身份证反面!';
|
|
|
}
|
|
|
if (err == '') {
|
|
|
|
|
|
let record = that.data.record;
|
|
|
let record_start_time = [];
|
|
|
let record_end_time = [];
|
...
|
...
|
@@ -567,18 +647,35 @@ Page({ |
|
|
photo: that.data.photo
|
|
|
}
|
|
|
app.post(url, params, head).then((res) => {
|
|
|
|
|
|
wx.showModal({
|
|
|
title: '请仔细核对信息,确认无误!',
|
|
|
content: '如需修改个人信息,请在微信公众号申请:关注微信公众号“白求恩志愿者中心”,点击菜单按钮“修改个人信息”,申请提交。',
|
|
|
confirmText:'确认提交',
|
|
|
cancelText:'我再想想',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
|
|
|
wx.showToast({
|
|
|
title: '提交成功,等待审核',
|
|
|
mask: true,
|
|
|
icon: 'none',
|
|
|
duration: 2000
|
|
|
})
|
|
|
|
|
|
setTimeout(function() {
|
|
|
setTimeout(function () {
|
|
|
wx.switchTab({
|
|
|
url: '/pages/my/my'
|
|
|
})
|
|
|
}, 1000)
|
|
|
console.log('用户点击确定')
|
|
|
} else if (res.cancel) {
|
|
|
|
|
|
console.log('用户点击取消')
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
|
|
|
}).catch((err) => {})
|
|
|
} else {
|
|
|
wx.showToast({
|
...
|
...
|
@@ -588,7 +685,10 @@ Page({ |
|
|
duration: 2000
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
getdatalist() {
|
|
|
let that = this;
|
|
|
let url = '/index/member_center/edit';
|
...
|
...
|
@@ -599,6 +699,7 @@ Page({ |
|
|
'XX-Token': wx.getStorageSync('token')
|
|
|
}
|
|
|
app.post(url, params, head).then((res) => {
|
|
|
console.log(res)
|
|
|
let provincearr = that.data.provincearr;
|
|
|
let cityarr = that.data.cityarr;
|
|
|
let countryarr = that.data.countryarr;
|
...
|
...
|
@@ -646,7 +747,8 @@ Page({ |
|
|
sex: res.sex,
|
|
|
unit: res.unit,
|
|
|
urgency_phone: res.urgency_phone,
|
|
|
type: res.type
|
|
|
type: res.type,
|
|
|
status:res.status
|
|
|
})
|
|
|
}).catch((err) => {
|
|
|
|
...
|
...
|
@@ -655,10 +757,11 @@ Page({ |
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function(options) {
|
|
|
onLoad: function (options) {
|
|
|
console.log(options)
|
|
|
let that = this;
|
|
|
that.setData({
|
|
|
is_submit: options.is_submit ? options.is_submit:null,
|
|
|
is_submit: options.is_submit ? options.is_submit : null,
|
|
|
id: options.id,
|
|
|
page_type: options.type ? options.type : null
|
|
|
})
|
...
|
...
|
@@ -673,22 +776,19 @@ Page({ |
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
|
|
onReady: function() {
|
|
|
onReady: function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function() {
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
*/
|
|
|
onHide: function() {
|
|
|
onHide: function () {
|
|
|
|
|
|
|
|
|
|
...
|
...
|
@@ -697,28 +797,28 @@ Page({ |
|
|
/**
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
*/
|
|
|
onUnload: function() {
|
|
|
onUnload: function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
*/
|
|
|
onPullDownRefresh: function() {
|
|
|
onPullDownRefresh: function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
onReachBottom: function() {
|
|
|
onReachBottom: function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 用户点击右上角分享
|
|
|
*/
|
|
|
onShareAppMessage: function() {
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
}
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|