Browse Source

1、修复注册、登陆、修改个人信息、党员注册的bug

shibei
luyan 1 year ago
parent
commit
1e0a7493f1
  1. 60
      miniprogram/pages/formid/formid.js
  2. 8
      miniprogram/subpages/checkIn/pages/checkIn/register/register.js

60
miniprogram/pages/formid/formid.js

@ -146,7 +146,6 @@ Page({
title: options.title, title: options.title,
}) })
let obj = JSON.parse(wx.getStorageSync('userInfo')) let obj = JSON.parse(wx.getStorageSync('userInfo'))
this.data.form.faceImg = obj.faceImg;
for (let key in obj) { for (let key in obj) {
if (!this.data.form.hasOwnProperty(key)) { if (!this.data.form.hasOwnProperty(key)) {
delete obj[key]; delete obj[key];
@ -282,7 +281,6 @@ Page({
}, },
//确定选择社区 //确定选择社区
bindMultiPickerChange() { bindMultiPickerChange() {
console.log(this.data.multiIds);
this.setData({ this.setData({
'form.allDeptIds': ['1175270520603930625', this.data.multiIds[0].value, this.data.multiIds[1].value, this.data.multiIds[1].children[0].value], 'form.allDeptIds': ['1175270520603930625', this.data.multiIds[0].value, this.data.multiIds[1].value, this.data.multiIds[1].children[0].value],
changeFlag: true changeFlag: true
@ -332,7 +330,6 @@ Page({
searchColumn(); searchColumn();
break; break;
} }
this.setData(data); this.setData(data);
this.setData({ this.setData({
newArr: this.data.newArr, newArr: this.data.newArr,
@ -378,13 +375,11 @@ Page({
searchColumn(); searchColumn();
break; break;
} }
this.setData(data); this.setData(data);
this.setData({ this.setData({
newArrC: this.data.newArrC, newArrC: this.data.newArrC,
changeFlagC: true changeFlagC: true
}) })
console.log(this.data.newArrC);
}, },
reverseLocation() { reverseLocation() {
const _this = this const _this = this
@ -397,7 +392,6 @@ Page({
_this.setData({ _this.setData({
addressContent: res.result.address, addressContent: res.result.address,
address: res.result.address address: res.result.address
// 'form.issueAddress': res.result.address,
}) })
}, },
fail(err) { fail(err) {
@ -410,20 +404,19 @@ Page({
this.setData({ this.setData({
'form.realName': e.detail.value 'form.realName': e.detail.value
}) })
console.log(this.data.form)
}, },
//身份证双向绑定 //身份证双向绑定
bindRealidentityNoInput(e) { bindRealidentityNoInput(e) {
this.setData({ this.setData({
'form.identityNo': e.detail.value 'form.identityNo': e.detail.value,
}) })
this.idNo = e.detail.value
}, },
//工作单位 //工作单位
bindWorkUnitInput(e) { bindWorkUnitInput(e) {
this.setData({ this.setData({
'form.workUnit': e.detail.value 'form.workUnit': e.detail.value
}) })
console.log(this.data.form)
}, },
//所属行业 //所属行业
bindWorkIndustryInput(e) { bindWorkIndustryInput(e) {
@ -459,14 +452,18 @@ Page({
this.getDeptTree() this.getDeptTree()
this.setData({ this.setData({
'form.shibei': e.detail.value, 'form.shibei': e.detail.value,
// 'form.allDeptIds': [""],
'form.couplingCommunity': [], 'form.couplingCommunity': [],
multiIndex: [0, 0], multiIndex: [0, 0],
multiIndexC: [0, 0], multiIndexC: [0, 0],
changeFlag: false, changeFlag: false,
changeFlagC: false, changeFlagC: false,
}) })
if(e.detail.value != null && e.detail.value === '0'){
this.setData({
'form.villageName': '',
'form.allDeptIds':''
})
}
}, },
bindFlagpartyFlagChange(e) { bindFlagpartyFlagChange(e) {
this.setData({ this.setData({
@ -576,7 +573,18 @@ Page({
return false return false
} }
if (!this.data.form.identityNo) { if (!this.data.form.identityNo) {
this.showToast('请填写身份证号') this.showToast('请填写身份证号码')
return false
}
this.data.form.identityNo = this.idNo
if (this.data.form.identityNo.length != 18) {
this.showToast('请填写正确的身份证号码')
return false
}else {
this.data.form.identityNo = this.idNo;
}
if (this.data.form.mobile.length != 11) {
this.showToast('请填写正确的手机号码')
return false return false
} }
if (!this.data.form.workUnit) { if (!this.data.form.workUnit) {
@ -587,7 +595,7 @@ Page({
this.showToast('请填写专业特长') this.showToast('请填写专业特长')
return false return false
} }
if (!this.data.form.mobile || this.data.form.mobile.length < 11) { if (!this.data.form.mobile) {
this.showToast('请填写正确的手机号码') this.showToast('请填写正确的手机号码')
return false return false
} }
@ -605,10 +613,8 @@ Page({
// return false // return false
// } // }
} else if (this.data.form.shibei == '0') { } else if (this.data.form.shibei == '0') {
// if (this.data.form.allDeptIds.length == 0) { this.data.form.villageName = '',
// this.showToast('请填写单位包联社区名称名称') this.data.form.allDeptIds = []
// return false
// }
} }
const para = { const para = {
...this.data.form ...this.data.form
@ -630,9 +636,9 @@ Page({
if (res.code) { if (res.code) {
api.userInfoUpdate(para).then(res => { api.userInfoUpdate(para).then(res => {
if (res.code == 0) { if (res.code == 0) {
wx.removeStorageSync('userInfo') wx.removeStorageSync('userInfo');
this.getUserInfo() this.getUserInfo();
than.showToast('修改成功') than.showToast('修改成功');
} else { } else {
than.showToast(res.msg) than.showToast(res.msg)
} }
@ -700,12 +706,10 @@ Page({
this.showToast('请输入姓名') this.showToast('请输入姓名')
return return
} }
if (!this.data.form.identityNo) { if (!this.data.form.identityNo && this.data.form.identityNo.length == 18) {
this.showToast('请填写身份证号') this.showToast('请填写正确的身份证号')
return return
} else { }
this.data.form.identityNo = this.idNo
}
if (!this.data.form.workIndustry) { if (!this.data.form.workIndustry) {
this.showToast('请填写专业特长') this.showToast('请填写专业特长')
return return
@ -728,10 +732,8 @@ Page({
// return // return
// } // }
} else if (this.data.form.shibei == '0') { } else if (this.data.form.shibei == '0') {
// if (this.data.form.allDeptIds.length == 0) { this.data.form.allDeptIds = [],
// this.showToast('请填写单位包联社区名称名称') this.data.form.villageName = ''
// return
// }
} }
this.setData({ this.setData({
visible: true visible: true

8
miniprogram/subpages/checkIn/pages/checkIn/register/register.js

@ -52,10 +52,10 @@ Page({
workUnit: '', //工作单位 workUnit: '', //工作单位
workType: '', //单位性质 workType: '', //单位性质
workIndustry: '', //所属行业 workIndustry: '', //所属行业
party: 1, //是否为党员 party: 0, //是否为党员
volunteer: 1, //是否加入志愿者 volunteer: 0, //是否加入志愿者
gridStaff: 1, //是否红色网格 gridStaff: 0, //是否红色网格
owners: 1, //是否参加业主委员会 owners: 0, //是否参加业主委员会
allDeptIds: [], //社区id allDeptIds: [], //社区id
shibei: '1', //是否居住在市北 shibei: '1', //是否居住在市北
couplingCommunity: [] couplingCommunity: []

Loading…
Cancel
Save