diff --git a/epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.js b/epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.js index ac4a53a..e8c744f 100644 --- a/epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.js +++ b/epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.js @@ -71,7 +71,7 @@ Page({ const params = { streetId: '', communityId: '', - gridId: '', //this.data.gridInfo.gridId + gridId: this.data.gridInfo.gridId } api.getPlotOptionApp(params).then(res => { if (res.data.length > 0) { @@ -203,11 +203,11 @@ Page({ getUserInfoById () { api.getUserInfo().then(res => { console.log("用户信息", res) - // if (res.data.identityNo) { - // wx.reLaunch({ - // url: `../familyInfo/familyInfo` - // }) - // } + if (res.data.identityNo) { + wx.reLaunch({ + url: `../index/index?roomCode=${this.data.roomCode}` + }) + } this.getHouseInfo() }).catch(err => { console.log(err) @@ -250,6 +250,10 @@ Page({ 'fmData.mobile': res.data.mobile ? res.data.mobile : '', inputDisabled: true }) + } else { + this.setData({ + inputDisabled: false + }) } }) }, @@ -387,14 +391,14 @@ Page({ // 路牌号 双向绑定 bindRoadInput (e) { this.setData({ - 'houseInfo.houseAddress': e.detail.value, + // 'houseInfo.houseAddress': e.detail.value, 'fmData.road': e.detail.value }) console.log(this.data.houseInfo) }, villageSyncPicker(e){ this.setData({ - 'houseInfo.plot' : this.data.villageRelationList[e.detail.value].label, + 'houseInfo.plotName' : this.data.villageRelationList[e.detail.value].label, 'fmData.villageName' : this.data.villageRelationList[e.detail.value].label }) this.getBuildingList(this.data.villageRelationList[e.detail.value].value) @@ -488,6 +492,10 @@ Page({ this.showToast('请填写手机号') return false } + if (!this.data.fmData.road) { + this.showToast('请填写所在街道') + return false + } // if (!this.data.fmData.smsCode) { // this.showToast('请填写验证码') // return false @@ -510,7 +518,7 @@ Page({ console.log(para) api.completeResidentInfoV2(para).then(res => { wx.reLaunch({ - url: "../index/index" + url: `../index/index?roomCode=${!this.data.roomCode ? this.data.houseInfo.roomNo : this.data.roomCode}` }) }) }, @@ -558,7 +566,7 @@ Page({ console.log(para) api.completeResidentInfo(para).then(res => { wx.reLaunch({ - url: "../index/index" + url: `../index/index?roomCode=${!this.data.roomCode ? this.data.houseInfo.roomNo : this.data.roomCode}` }) }) }, @@ -575,16 +583,25 @@ Page({ this.showToast('请输入您的手机号') return } + if (!this.data.fmData.road) { + this.showToast('请填写所在街道') + return false + } + const houseAddress = this.data.houseInfo.gridName + '-' + + this.data.houseInfo.plotName + '-' + + this.data.houseInfo.buildingName + '-' + + this.data.houseInfo.unit + '-' + + this.data.houseInfo.roomNo const params = { flag: this.data.inputDisabled ? '0' : '1', // 是否新增人员表示(0:否;1:是) unitId: this.data.houseInfo.id, userName: this.data.fmData.realName, idCard: this.data.fmData.identityNo, mobile: this.data.fmData.mobile, - houseAddress: this.data.houseInfo.houseAddress ? this.data.houseInfo.houseAddress : this.data.houseInfo.roadName, - community: this.data.houseInfo.plot ? this.data.houseInfo.plot : this.data.houseInfo.communityName, + houseAddress: houseAddress, + community: this.data.houseInfo.communityName, deptId: this.data.gridInfo.gridId ? this.data.gridInfo.gridId : this.data.houseInfo.gridId, - plot: this.data.houseInfo.plot ? this.data.houseInfo.plot : this.data.houseInfo.plotName, + plot: this.data.houseInfo.plotName, buildingNo: this.data.houseInfo.buildingNo ? this.data.houseInfo.buildingNo : this.data.houseInfo.buildingName, unit: this.data.houseInfo.unit, roomNo: this.data.houseInfo.roomNo diff --git a/epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.wxml b/epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.wxml index 63ac2ba..a4cdf16 100644 --- a/epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.wxml +++ b/epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.wxml @@ -79,9 +79,9 @@ 所属网格 - - - {{gridInfo.gridName}} + + + {{houseInfo.gridName}} @@ -90,10 +90,8 @@ * 路牌号 - - - {{houseInfo.roadName}} - + + @@ -148,8 +146,8 @@ 所属网格 - - + + {{gridInfo.gridName}} @@ -160,7 +158,7 @@ 路牌号 - + @@ -170,8 +168,8 @@ - - {{houseInfo.plot}} + + {{houseInfo.plotName}} 请选择 diff --git a/epdc-resident-mp-yushan/subpages/family/pages/index/index.js b/epdc-resident-mp-yushan/subpages/family/pages/index/index.js index 733eaab..a55faf0 100644 --- a/epdc-resident-mp-yushan/subpages/family/pages/index/index.js +++ b/epdc-resident-mp-yushan/subpages/family/pages/index/index.js @@ -21,12 +21,12 @@ Page({ title: "加载中", mask: true, }); - // this.setData({ - // roomCode : options.roomCode.toString() - // }) this.setData({ - roomCode:'3702110100420037200006' + roomCode : options.roomCode }) + // this.setData({ + // roomCode:'3702110100420037200006' + // }) wx.setStorage({ key: 'roomCode', data: this.data.roomCode