Browse Source

优化

release
ZhaoTongYao 3 years ago
parent
commit
9ea589fe85
  1. 65
      epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.js
  2. 1
      epdc-resident-mp-yushan/subpages/family/pages/familyInfo/familyInfo.json
  3. 1
      epdc-resident-mp-yushan/subpages/family/pages/index/index.json
  4. 1
      epdc-resident-mp-yushan/subpages/family/pages/noAccess/noAccess.json

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

@ -44,6 +44,7 @@ Page({
houseInfo: {}, // 通过roomCode获取的房屋信息
inputDisabled: false, // 输入身份证号,查询到信息的话,禁止修改
selectBuildingId: '', // 选择的楼栋id
userState: ''
},
/**
@ -58,14 +59,6 @@ Page({
})
}
this.getUserState()
this.checkWxUnionId()
this.getWxCode()
wx.hideToast()
if (!this.data.roomCode) {
this.getPersonalInfo().then(res => {
this.getVillageList()
})
}
},
getVillageList () {
const params = {
@ -187,11 +180,22 @@ Page({
if (res.code) {
let code = res.code
api.getToken(code).then(res => {
const state = res.data.userState
app.globalData.infoCompleted = state
wx.setStorageSync('topGridName', res.data.grid)
wx.setStorageSync('token', res.data.token)
_this.getUserInfoById()
_this.data.userState = res.data.userState
if (_this.data.userState == '4') {
_this.getHouseInfo()
} else {
wx.setStorageSync('topGridName', res.data.grid)
wx.setStorageSync('token', res.data.token)
_this.getUserInfoById()
_this.checkWxUnionId()
_this.getWxCode()
if (!_this.data.roomCode) {
_this.getPersonalInfo().then(res => {
_this.getVillageList()
})
}
}
wx.hideToast()
})
} else {
console.log('登录失败' + res.errMsg)
@ -199,6 +203,29 @@ Page({
}
})
},
getTokenByGridId () {
let that = this
wx.login({
success(res) {
if (res.code) {
console.log('微信CODE: ' + res.code)
let wxCode = res.code
const para = {
inviteUserId: '',
gridId: that.data.houseInfo.gridId,
wxCode: wxCode
}
api.getTokenV3(para).then(function (res) {
wx.removeStorageSync('token')
wx.setStorageSync('token', res.data.token)
if (that.data.userState == '4') {
that.getUserState()
}
})
}
}
})
},
// 获取用户信息
getUserInfoById () {
api.getUserInfo().then(res => {
@ -222,11 +249,14 @@ Page({
roomCode: this.data.roomCode
}
api.getHouseInfo(params).then(res => {
console.log(res.data)
console.log('getHouseInfo: ', res.data)
if (res.code == 0) {
this.setData({
houseInfo: res.data
})
if (this.data.userState == '4') {
this.getTokenByGridId()
}
}
})
},
@ -493,7 +523,7 @@ Page({
return false
}
if (!this.data.fmData.road) {
this.showToast('请填写所在街道')
this.showToast('请填写路牌号')
return false
}
// if (!this.data.fmData.smsCode) {
@ -545,7 +575,7 @@ Page({
return false
}
if (!this.data.fmData.road) {
this.showToast('请填写所在街道')
this.showToast('请填写路牌号')
return false
}
const para = {
@ -584,7 +614,7 @@ Page({
return
}
if (!this.data.fmData.road) {
this.showToast('请填写所在街道')
this.showToast('请填写路牌号')
return false
}
const houseAddress = this.data.houseInfo.gridName + '-'
@ -597,6 +627,7 @@ Page({
unitId: this.data.houseInfo.id,
userName: this.data.fmData.realName,
idCard: this.data.fmData.identityNo,
gender: this.data.fmData.sex,
mobile: this.data.fmData.mobile,
houseAddress: houseAddress,
community: this.data.houseInfo.communityName,

1
epdc-resident-mp-yushan/subpages/family/pages/familyInfo/familyInfo.json

@ -1,3 +1,4 @@
{
"navigationBarTitleText": "详细信息",
"usingComponents": {}
}

1
epdc-resident-mp-yushan/subpages/family/pages/index/index.json

@ -1,3 +1,4 @@
{
"navigationBarTitleText": "我的家庭",
"usingComponents": {}
}

1
epdc-resident-mp-yushan/subpages/family/pages/noAccess/noAccess.json

@ -1,3 +1,4 @@
{
"navigationBarTitleText": "我的家庭",
"usingComponents": {}
}
Loading…
Cancel
Save