Browse Source

优化

release
ZhaoTongYao 3 years ago
parent
commit
fdd771a17e
  1. BIN
      epdc-resident-mp-yushan/images/my-home.png
  2. 21
      epdc-resident-mp-yushan/pages/index/index.js
  3. 6
      epdc-resident-mp-yushan/pages/index/index.wxml
  4. 102
      epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.js
  5. 17
      epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.wxml
  6. 13
      epdc-resident-mp-yushan/utils/api.js

BIN
epdc-resident-mp-yushan/images/my-home.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

21
epdc-resident-mp-yushan/pages/index/index.js

@ -82,6 +82,7 @@ Page({
signCode: 0, signCode: 0,
isSignUp: 0, isSignUp: 0,
visible: false, visible: false,
identityNo: ''
}, },
onLoad(options) { onLoad(options) {
if (options.scene) { if (options.scene) {
@ -411,8 +412,21 @@ Page({
}, },
// 绑定家庭入口 // 绑定家庭入口
toFamily() { toFamily() {
wx.navigateTo({ const params = {
url: '/subpages/family/pages/bindFamily/bindFamily', idCard: this.data.identityNo
}
api.getRoomCodeByIdCard(params).then(res => {
if (res.data && res.data.roomCode) {
wx.navigateTo({
url: `/subpages/family/pages/index/index?roomCode=${res.data.roomCode}`,
})
} else {
wx.showToast({
title: '请扫房屋码绑定房屋',
icon: 'none',
duration: 2500
})
}
}) })
}, },
// 获取最新社区资讯 // 获取最新社区资讯
@ -613,7 +627,8 @@ Page({
api.getUserInfo().then(res => { api.getUserInfo().then(res => {
console.log("用户信息", res) console.log("用户信息", res)
this.setData({ this.setData({
isSignUp: res.data.isSignUp isSignUp: res.data.isSignUp,
identityNo: res.data.identityNo
}) })
}).catch(err => { }).catch(err => {
this.setData({ this.setData({

6
epdc-resident-mp-yushan/pages/index/index.wxml

@ -156,10 +156,10 @@
<complete-info-dialog completeInfoDialogVisible="{{completeInfoDialogVisible}}"></complete-info-dialog> <complete-info-dialog completeInfoDialogVisible="{{completeInfoDialogVisible}}"></complete-info-dialog>
</view> </view>
<!-- 悬浮按钮 --> <!-- 悬浮按钮 -->
<move-btn wx:if="{{vaccinationSwitch}}" button-width="142" button-height="164" button-left="620" area-top="120" area-height="80%" img-url="../../images/vaccines.png" bindmovebtnCallBack="toVaccines"></move-btn> <move-btn wx:if="{{vaccinationSwitch}}" button-width="142" button-height="164" button-left="620" area-top="120" area-height="85%" img-url="../../images/vaccines.png" bindmovebtnCallBack="toVaccines"></move-btn>
<!-- 测试使用 --> <!-- = -->
<!-- <move-btn wx:if="{{vaccinationSwitch}}" button-width="100" button-height="80" button-left="620" area-top="120" area-height="65%" img-url="../../images/logo.png" bindmovebtnCallBack="toFamily"></move-btn> --> <move-btn button-width="140" button-height="140" button-left="620" area-top="120" area-height="60%" img-url="../../images/my-home.png" bindmovebtnCallBack="toFamily"></move-btn>
<!-- 拨打电话 --> <!-- 拨打电话 -->

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

@ -232,7 +232,7 @@ Page({
idCard: idCard, idCard: idCard,
roomCode: this.data.roomCode roomCode: this.data.roomCode
} }
api.get(params).then(res => { api.getSkipDirection(params).then(res => {
if (res.data.type == '1') { if (res.data.type == '1') {
// 留在当前页面,进行注册绑定 // 留在当前页面,进行注册绑定
this.getHouseInfo() 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 () { getUserInfoById () {
api.getUserInfo().then(res => { api.getUserInfo().then(res => {
console.log("用户信息", res) console.log("用户信息", res)
if (res.data.identityNo) { 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) this.navigateTo(res.data.identityNo)
} else { } else {
this.getHouseInfo() this.getHouseInfo()
@ -262,6 +304,38 @@ Page({
console.log(err) 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 () { getHouseInfo () {
if (!this.data.roomCode) { 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) { identityCodeValid (idcode) {
var weightFactor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2] 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({ this.setData({
'fmData.identityNo': e.detail.value 'fmData.identityNo': e.detail.value
}) })
this.getFamilyMember() // this.getFamilyMember()
}, },
// 姓名 双向绑定 // 姓名 双向绑定
bindRealNameInput (e) { bindRealNameInput (e) {
@ -571,7 +653,7 @@ Page({
} else if (this.data.getMobileType === 'self') { } else if (this.data.getMobileType === 'self') {
this.submitPersonalInfoBySelf() this.submitPersonalInfoBySelf()
} }
this.submitHouseInfo() // this.submitHouseInfo()
}, },
// 提交完善信息-从微信获取手机号方式 // 提交完善信息-从微信获取手机号方式
submitPersonalInfoByWx () { submitPersonalInfoByWx () {
@ -617,9 +699,10 @@ Page({
} }
console.log(para) console.log(para)
api.completeResidentInfoV2(para).then(res => { api.completeResidentInfoV2(para).then(res => {
wx.reLaunch({ // wx.reLaunch({
url: `../index/index?roomCode=${!this.data.roomCode ? this.data.houseInfo.roomNo : this.data.roomCode}` // url: `../index/index?roomCode=${!this.data.roomCode ? this.data.houseInfo.roomNo : this.data.roomCode}`
}) // })
this.getUserInfoById2()
}) })
}, },
// 提交完善信息,手机号输入方式 // 提交完善信息,手机号输入方式
@ -666,9 +749,10 @@ Page({
} }
console.log(para) console.log(para)
api.completeResidentInfo(para).then(res => { api.completeResidentInfo(para).then(res => {
wx.reLaunch({ // wx.reLaunch({
url: `../index/index?roomCode=${!this.data.roomCode ? this.data.houseInfo.roomNo : this.data.roomCode}` // url: `../index/index?roomCode=${!this.data.roomCode ? this.data.houseInfo.roomNo : this.data.roomCode}`
}) // })
this.getUserInfoById2()
}) })
}, },
submitHouseInfo () { submitHouseInfo () {

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

@ -40,6 +40,15 @@
</radio-group> </radio-group>
</view> </view>
</view> </view>
<view class="item">
<view class="field">
<text class="z-stress">*</text>
路牌号
</view>
<view class="input">
<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 class="item" wx:if="{{getMobileType === 'wx'}}"> <view class="item" wx:if="{{getMobileType === 'wx'}}">
<view class="field"> <view class="field">
<text class="z-stress">*</text> <text class="z-stress">*</text>
@ -85,7 +94,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="item"> <!-- <view class="item">
<view class="field"> <view class="field">
<text class="z-stress">*</text> <text class="z-stress">*</text>
路牌号 路牌号
@ -93,7 +102,7 @@
<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="{{ houseInfo.houseAddress }}" placeholder="请输入" placeholder-class="z-ph" name="houseAddress" cursor-spacing="14" maxlength="100" />
</view> </view>
</view> </view> -->
<view class="item"> <view class="item">
<view class="field"> <view class="field">
<text class="z-white">*</text> <text class="z-white">*</text>
@ -152,7 +161,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="item"> <!-- <view class="item">
<view class="field"> <view class="field">
<text class="z-stress">*</text> <text class="z-stress">*</text>
路牌号 路牌号
@ -160,7 +169,7 @@
<view class="input"> <view class="input">
<input type="text" bindblur="bindRoadInput" bindinput="bindRoadInput" value="{{ fmData.road }}" placeholder="请输入" placeholder-class="z-ph" name="road" 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">
<view class="field"> <view class="field">
<text class="z-white">*</text> <text class="z-white">*</text>

13
epdc-resident-mp-yushan/utils/api.js

@ -83,7 +83,9 @@ module.exports = {
getUnitOption, getUnitOption,
getHouseOption, getHouseOption,
bindingFamily, bindingFamily,
getFamilyMember getFamilyMember,
getSkipDirection,
getRoomCodeByIdCard
} }
function getToken(wxCode) { function getToken(wxCode) {
@ -617,4 +619,13 @@ function bindingFamily(params) {
// 获取成员信息 // 获取成员信息
function getFamilyMember (params) { function getFamilyMember (params) {
return fly.get('custom/personroom/getFamilyMember', params) return fly.get('custom/personroom/getFamilyMember', params)
}
//
function getSkipDirection (params) {
return fly.get('custom/personroom/getSkipDirection', params)
}
//
function getRoomCodeByIdCard (params) {
return fly.get('custom/personroom/getRoomCodeByIdCard', params)
} }
Loading…
Cancel
Save