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 524aed8..7384849 100644 --- a/epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.js +++ b/epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.js @@ -226,16 +226,38 @@ Page({ } }) }, + // 有信息,跳转 + navigateTo (idCard) { + const params = { + idCard: idCard, + roomCode: this.data.roomCode + } + api.get(params).then(res => { + if (res.data.type == '1') { + // 留在当前页面,进行注册绑定 + this.getHouseInfo() + } 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) { - wx.reLaunch({ - url: `../index/index?roomCode=${this.data.roomCode}` - }) + this.navigateTo(res.data.identityNo) + } else { + this.getHouseInfo() } - this.getHouseInfo() }).catch(err => { console.log(err) })