Browse Source

优化

release
ZhaoTongYao 3 years ago
parent
commit
bc035f7f51
  1. 43
      epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.js
  2. 22
      epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.wxml
  3. 8
      epdc-resident-mp-yushan/subpages/family/pages/index/index.js

43
epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.js

@ -71,7 +71,7 @@ Page({
const params = { const params = {
streetId: '', streetId: '',
communityId: '', communityId: '',
gridId: '', //this.data.gridInfo.gridId gridId: this.data.gridInfo.gridId
} }
api.getPlotOptionApp(params).then(res => { api.getPlotOptionApp(params).then(res => {
if (res.data.length > 0) { if (res.data.length > 0) {
@ -203,11 +203,11 @@ Page({
getUserInfoById () { getUserInfoById () {
api.getUserInfo().then(res => { api.getUserInfo().then(res => {
console.log("用户信息", res) console.log("用户信息", res)
// if (res.data.identityNo) { if (res.data.identityNo) {
// wx.reLaunch({ wx.reLaunch({
// url: `../familyInfo/familyInfo` url: `../index/index?roomCode=${this.data.roomCode}`
// }) })
// } }
this.getHouseInfo() this.getHouseInfo()
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
@ -250,6 +250,10 @@ Page({
'fmData.mobile': res.data.mobile ? res.data.mobile : '', 'fmData.mobile': res.data.mobile ? res.data.mobile : '',
inputDisabled: true inputDisabled: true
}) })
} else {
this.setData({
inputDisabled: false
})
} }
}) })
}, },
@ -387,14 +391,14 @@ Page({
// 路牌号 双向绑定 // 路牌号 双向绑定
bindRoadInput (e) { bindRoadInput (e) {
this.setData({ this.setData({
'houseInfo.houseAddress': e.detail.value, // 'houseInfo.houseAddress': e.detail.value,
'fmData.road': e.detail.value 'fmData.road': e.detail.value
}) })
console.log(this.data.houseInfo) console.log(this.data.houseInfo)
}, },
villageSyncPicker(e){ villageSyncPicker(e){
this.setData({ 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 'fmData.villageName' : this.data.villageRelationList[e.detail.value].label
}) })
this.getBuildingList(this.data.villageRelationList[e.detail.value].value) this.getBuildingList(this.data.villageRelationList[e.detail.value].value)
@ -488,6 +492,10 @@ Page({
this.showToast('请填写手机号') this.showToast('请填写手机号')
return false return false
} }
if (!this.data.fmData.road) {
this.showToast('请填写所在街道')
return false
}
// if (!this.data.fmData.smsCode) { // if (!this.data.fmData.smsCode) {
// this.showToast('请填写验证码') // this.showToast('请填写验证码')
// return false // return false
@ -510,7 +518,7 @@ Page({
console.log(para) console.log(para)
api.completeResidentInfoV2(para).then(res => { api.completeResidentInfoV2(para).then(res => {
wx.reLaunch({ 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) console.log(para)
api.completeResidentInfo(para).then(res => { api.completeResidentInfo(para).then(res => {
wx.reLaunch({ 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('请输入您的手机号') this.showToast('请输入您的手机号')
return 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 = { const params = {
flag: this.data.inputDisabled ? '0' : '1', // 是否新增人员表示(0:否;1:是) flag: this.data.inputDisabled ? '0' : '1', // 是否新增人员表示(0:否;1:是)
unitId: this.data.houseInfo.id, unitId: this.data.houseInfo.id,
userName: this.data.fmData.realName, userName: this.data.fmData.realName,
idCard: this.data.fmData.identityNo, idCard: this.data.fmData.identityNo,
mobile: this.data.fmData.mobile, mobile: this.data.fmData.mobile,
houseAddress: this.data.houseInfo.houseAddress ? this.data.houseInfo.houseAddress : this.data.houseInfo.roadName, houseAddress: houseAddress,
community: this.data.houseInfo.plot ? this.data.houseInfo.plot : this.data.houseInfo.communityName, community: this.data.houseInfo.communityName,
deptId: this.data.gridInfo.gridId ? this.data.gridInfo.gridId : this.data.houseInfo.gridId, 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, buildingNo: this.data.houseInfo.buildingNo ? this.data.houseInfo.buildingNo : this.data.houseInfo.buildingName,
unit: this.data.houseInfo.unit, unit: this.data.houseInfo.unit,
roomNo: this.data.houseInfo.roomNo roomNo: this.data.houseInfo.roomNo

22
epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.wxml

@ -79,9 +79,9 @@
<view class="field"> <view class="field">
<view class="field-text">所属网格</view> <view class="field-text">所属网格</view>
</view> </view>
<view class="value"> <view class="value" style="width: 510rpx;">
<view class="input right"> <view class="input right" style="width: 500rpx;">
{{gridInfo.gridName}} {{houseInfo.gridName}}
</view> </view>
</view> </view>
</view> </view>
@ -90,10 +90,8 @@
<text class="z-stress">*</text> <text class="z-stress">*</text>
路牌号 路牌号
</view> </view>
<view class="value"> <view class="input">
<view class="input right"> <input type="text" bindblur="bindRoadInput" bindinput="bindRoadInput" value="{{ houseInfo.houseAddress }}" placeholder="请输入" placeholder-class="z-ph" name="houseAddress" cursor-spacing="14" maxlength="100" />
{{houseInfo.roadName}}
</view>
</view> </view>
</view> </view>
<view class="item"> <view class="item">
@ -148,8 +146,8 @@
<view class="field"> <view class="field">
<view class="field-text">所属网格</view> <view class="field-text">所属网格</view>
</view> </view>
<view class="value"> <view class="value" style="width: 510rpx;">
<view class="input"> <view class="input right" style="width: 500rpx;">
{{gridInfo.gridName}} {{gridInfo.gridName}}
</view> </view>
</view> </view>
@ -160,7 +158,7 @@
路牌号 路牌号
</view> </view>
<view class="input"> <view class="input">
<input type="text" bindblur="bindRoadInput" bindinput="bindRoadInput" value="{{ houseInfo.houseAddress }}" placeholder="请输入" placeholder-class="z-ph" name="houseAddress" cursor-spacing="14" maxlength="100" /> <input type="text" bindblur="bindRoadInput" bindinput="bindRoadInput" value="{{ fmData.road }}" placeholder="请输入" placeholder-class="z-ph" name="road" cursor-spacing="14" maxlength="100" />
</view> </view>
</view> </view>
<view class="item"> <view class="item">
@ -170,8 +168,8 @@
</view> </view>
<view class="value"> <view class="value">
<picker class="picker" range="{{villageRelationList}}" range-key="label" bindchange="villageSyncPicker"> <picker class="picker" range="{{villageRelationList}}" range-key="label" bindchange="villageSyncPicker">
<view class="picker-text" wx:if="{{houseInfo.plot}}"> <view class="picker-text" wx:if="{{houseInfo.plotName}}">
{{houseInfo.plot}} {{houseInfo.plotName}}
</view> </view>
<view class="picker-text z-weak" wx:else bind:tap="syncPicker" data-type='road'>请选择</view> <view class="picker-text z-weak" wx:else bind:tap="syncPicker" data-type='road'>请选择</view>
<image class="menu-arrow" src="/subpages/family/images/arrow.png" mode="aspectFit" /> <image class="menu-arrow" src="/subpages/family/images/arrow.png" mode="aspectFit" />

8
epdc-resident-mp-yushan/subpages/family/pages/index/index.js

@ -21,12 +21,12 @@ Page({
title: "加载中", title: "加载中",
mask: true, mask: true,
}); });
// this.setData({
// roomCode : options.roomCode.toString()
// })
this.setData({ this.setData({
roomCode:'3702110100420037200006' roomCode : options.roomCode
}) })
// this.setData({
// roomCode:'3702110100420037200006'
// })
wx.setStorage({ wx.setStorage({
key: 'roomCode', key: 'roomCode',
data: this.data.roomCode data: this.data.roomCode

Loading…
Cancel
Save