|
|
@ -232,7 +232,7 @@ Page({ |
|
|
|
idCard: idCard, |
|
|
|
roomCode: this.data.roomCode |
|
|
|
} |
|
|
|
api.get(params).then(res => { |
|
|
|
api.getSkipDirection(params).then(res => { |
|
|
|
if (res.data.type == '1') { |
|
|
|
// 留在当前页面,进行注册绑定
|
|
|
|
this.getHouseInfo() |
|
|
@ -249,11 +249,53 @@ Page({ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 有信息,跳转
|
|
|
|
navigateTo2 (idCard) { |
|
|
|
const params = { |
|
|
|
idCard: idCard, |
|
|
|
roomCode: this.data.roomCode |
|
|
|
} |
|
|
|
api.getSkipDirection(params).then(res => { |
|
|
|
if (res.data.type == '1') { |
|
|
|
// 留在当前页面,进行注册绑定
|
|
|
|
wx.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '请联系工作人员添加房屋绑定关系', |
|
|
|
showCancel: false, |
|
|
|
success (res) { |
|
|
|
if (res.confirm) { |
|
|
|
console.log('用户点击确定') |
|
|
|
wx.reLaunch({ |
|
|
|
url: '/pages/index/index' |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} else if (res.data.type == '2') { |
|
|
|
// 直接跳转到房屋页面
|
|
|
|
wx.reLaunch({ |
|
|
|
url: `../index/index?roomCode=${this.data.roomCode}` |
|
|
|
}) |
|
|
|
} else { |
|
|
|
// 无权访问
|
|
|
|
wx.reLaunch({ |
|
|
|
url: `../noAccess/noAccess` |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取用户信息
|
|
|
|
getUserInfoById () { |
|
|
|
api.getUserInfo().then(res => { |
|
|
|
console.log("用户信息", res) |
|
|
|
if (res.data.identityNo) { |
|
|
|
this.setData({ |
|
|
|
'fmData.identityNo': res.data.identityNo, |
|
|
|
'fmData.realName': res.data.realName, |
|
|
|
'fmData.sex': this.getGender(res.data.identityNo), |
|
|
|
'fmData.mobile': res.data.mobile, |
|
|
|
'fmData.road': res.data.road |
|
|
|
}) |
|
|
|
this.navigateTo(res.data.identityNo) |
|
|
|
} else { |
|
|
|
this.getHouseInfo() |
|
|
@ -262,6 +304,38 @@ Page({ |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取用户信息2
|
|
|
|
getUserInfoById2 () { |
|
|
|
api.getUserInfo().then(res => { |
|
|
|
console.log("用户信息", res) |
|
|
|
if (res.data.identityNo) { |
|
|
|
this.setData({ |
|
|
|
'fmData.identityNo': res.data.identityNo, |
|
|
|
'fmData.realName': res.data.realName, |
|
|
|
'fmData.sex': this.getGender(res.data.identityNo), |
|
|
|
'fmData.mobile': res.data.mobile, |
|
|
|
'fmData.road': res.data.road |
|
|
|
}) |
|
|
|
this.navigateTo2(res.data.identityNo) |
|
|
|
} else { |
|
|
|
wx.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '绑定失败', |
|
|
|
showCancel: false, |
|
|
|
success (res) { |
|
|
|
if (res.confirm) { |
|
|
|
console.log('用户点击确定') |
|
|
|
wx.reLaunch({ |
|
|
|
url: '/pages/index/index' |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取房屋信息
|
|
|
|
getHouseInfo () { |
|
|
|
if (!this.data.roomCode) { |
|
|
@ -314,6 +388,14 @@ Page({ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getGender (psidno) { |
|
|
|
var num = psidno.charAt(16); |
|
|
|
if (num % 2 == 0) { |
|
|
|
return '0'; |
|
|
|
}else { |
|
|
|
return '1'; |
|
|
|
} |
|
|
|
}, |
|
|
|
// 校验身份证是否正确
|
|
|
|
identityCodeValid (idcode) { |
|
|
|
var weightFactor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2] |
|
|
@ -368,7 +450,7 @@ Page({ |
|
|
|
this.setData({ |
|
|
|
'fmData.identityNo': e.detail.value |
|
|
|
}) |
|
|
|
this.getFamilyMember() |
|
|
|
// this.getFamilyMember()
|
|
|
|
}, |
|
|
|
// 姓名 双向绑定
|
|
|
|
bindRealNameInput (e) { |
|
|
@ -571,7 +653,7 @@ Page({ |
|
|
|
} else if (this.data.getMobileType === 'self') { |
|
|
|
this.submitPersonalInfoBySelf() |
|
|
|
} |
|
|
|
this.submitHouseInfo() |
|
|
|
// this.submitHouseInfo()
|
|
|
|
}, |
|
|
|
// 提交完善信息-从微信获取手机号方式
|
|
|
|
submitPersonalInfoByWx () { |
|
|
@ -617,9 +699,10 @@ Page({ |
|
|
|
} |
|
|
|
console.log(para) |
|
|
|
api.completeResidentInfoV2(para).then(res => { |
|
|
|
wx.reLaunch({ |
|
|
|
url: `../index/index?roomCode=${!this.data.roomCode ? this.data.houseInfo.roomNo : this.data.roomCode}` |
|
|
|
}) |
|
|
|
// wx.reLaunch({
|
|
|
|
// url: `../index/index?roomCode=${!this.data.roomCode ? this.data.houseInfo.roomNo : this.data.roomCode}`
|
|
|
|
// })
|
|
|
|
this.getUserInfoById2() |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 提交完善信息,手机号输入方式
|
|
|
@ -666,9 +749,10 @@ Page({ |
|
|
|
} |
|
|
|
console.log(para) |
|
|
|
api.completeResidentInfo(para).then(res => { |
|
|
|
wx.reLaunch({ |
|
|
|
url: `../index/index?roomCode=${!this.data.roomCode ? this.data.houseInfo.roomNo : this.data.roomCode}` |
|
|
|
}) |
|
|
|
// wx.reLaunch({
|
|
|
|
// url: `../index/index?roomCode=${!this.data.roomCode ? this.data.houseInfo.roomNo : this.data.roomCode}`
|
|
|
|
// })
|
|
|
|
this.getUserInfoById2() |
|
|
|
}) |
|
|
|
}, |
|
|
|
submitHouseInfo () { |
|
|
|