Browse Source

注册绑定房屋

release
ZhaoTongYao 3 years ago
parent
commit
24fa218403
  1. 2
      epdc-resident-mp-yushan/pages/index/index.wxml
  2. 627
      epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.js
  3. 1
      epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.json
  4. 165
      epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.wxml
  5. 70
      epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.wxss
  6. 40
      epdc-resident-mp-yushan/utils/api.js

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

@ -159,7 +159,7 @@
<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="100" button-height="80" button-left="620" area-top="-100" area-height="80%" img-url="../../images/logo.png" bindmovebtnCallBack="toFamily"></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>
<!-- 拨打电话 -->

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

@ -1,15 +1,4 @@
// subpages/family/pages/bindFamily/bindFamily.js
import {
bindingFamily,
getPlotOption,
getBuildingOption,
getUnitOption,
getHouseOption,
addFamilyMember,
updateFamilyMember,
getFamilyMember
} from '../../utils/api.js'
const api = require('../../../../utils/api')
const app = getApp()
@ -20,42 +9,18 @@ Page({
data: {
isApplied: true,
fmData: {
nickname: "",
surname: "",
name: "",
street: "",
district: "",
buildingAddress: "",
idNum: "",
mobile: '',
roadRelationName:'',
villageRelationName:'',
buildRelationName:'',
unitRelationName:'',
houseRelationName:'',
identityNo: '', // 身份证号
realName: '', // 姓名
sex: '', // 性别
mobile: '', // 手机号
smsCode: '', // 验证码
road: '', // 什么路
villageName: '', // 小区
dwellingPlace: '', // 楼栋号-单元室
partyFlag: '0'
},
submitBtnIsAllowed: false,
loadingHidden:false,
roadRelationList:[
{
label:'111',
value:0
},
{
label:'222',
value:1
},
],
villageRelationList:[
{
label:'111',
value:0
},
{
label:'222',
value:1
},
],
villageRelationList:[],
villageDisable:true,
buildRelationList:[],
buildDisable:true,
@ -63,6 +28,22 @@ Page({
unitDisable:true,
houseRelationList:[],
houseDisable:true,
roomCode: '', // 通过扫房屋二维码进入到该页面,会有个房屋编码
smsCodeText: '获取验证码', // 获取验证码button内容
getMobileType: 'wx', // 获取手机号的方式,默认从微信获取,但是微信新获取部分用户会有各种莫名其妙的bug,所以增加手机号/验证码的方式
unionIdStatus: '0', // 是否完善过个人信息,完善过更新,未完善过增加
wxInfo: {
encryptedData:'',// 完整信息的加密数据
iv: '', // 初始向量
wxCode: '', // 微信cod
},
gridInfo: {
gridName: '', // 网格名称
gridId: '' // 网格id
},
houseInfo: {}, // 通过roomCode获取的房屋信息
inputDisabled: false, // 输入身份证号,查询到信息的话,禁止修改
selectBuildingId: '', // 选择的楼栋id
},
/**
@ -70,13 +51,137 @@ Page({
*/
onLoad: function (options) {
wx.showToast({title: '加载中', icon: 'loading', duration: 10000});
if (options.q) {
let arr = decodeURIComponent(options.q).split('/')
this.setData({
roomCode: arr[arr.length - 1]
})
}
this.getUserState()
let idCard = options
console.log(idCard)
this.checkWxUnionId()
this.getWxCode()
wx.hideToast()
if (!this.data.roomCode) {
this.getPersonalInfo().then(res => {
this.getVillageList()
})
}
},
getVillageList () {
const params = {
streetId: '',
communityId: '',
gridId: '', //this.data.gridInfo.gridId
}
api.getPlotOptionApp(params).then(res => {
if (res.data.length > 0) {
res.data.forEach(item => {
let ob = {
label: item.dictName,
value: item.dictValue
}
this.data.villageRelationList.push(ob)
})
this.setData({
villageRelationList: this.data.villageRelationList
})
}
})
},
getBuildingList (plotId) {
const params = {
plotId: plotId
}
api.getBuildingOptionApp(params).then(res => {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
let ob = {
label: item.dictName,
value: item.dictValue
}
this.data.buildRelationList.push(ob)
})
this.setData({
buildRelationList: this.data.buildRelationList
})
}
})
},
getUnitOption (buildingId) {
const params = {
buildingId: buildingId
}
api.getUnitOption(params).then(res => {
if (res.data.length > 0) {
res.data.forEach(item => {
let ob = {
label: item.dictName,
value: item.dictValue
}
this.data.unitRelationList.push(ob)
})
this.setData({
unitRelationList: this.data.unitRelationList
})
}
})
},
getHouseOption (buildingId, unit) {
const params = {
buildingId: buildingId,
unit: unit
}
api.getHouseOption(params).then(res => {
if (res.data.length > 0) {
res.data.forEach(item => {
let ob = {
label: item.dictName,
value: item.dictValue
}
this.data.houseRelationList.push(ob)
})
this.setData({
houseRelationList: this.data.houseRelationList
})
}
})
},
// 获取之前完善的个人信息
getPersonalInfo () {
return new Promise((resolve, reject) => {
api.prepareComplete().then(res => {
console.log('获取个人信息', res)
for(const key in this.data.gridInfo) {
this.data.gridInfo[key] = res.data[key]
}
this.setData({
gridInfo: this.data.gridInfo
})
resolve(true)
}).catch(err => {
console.log(err)
reject(false)
})
})
},
// 查看用户是否完善个人信息
checkWxUnionId() {
api.checkWxUnionId().then(res => {
console.log('查看用户是否已保存unionId', res)
this.setData({
unionIdStatus: res.data
// unionIdStatus: '0'
})
}).catch(err => {
this.setData({
unionIdStatus: '0'
})
console.log(err)
})
},
// 根据微信code查询用户当前状态
getUserState() {
let _this = this
wx.login({
success(res) {
if (res.code) {
@ -86,6 +191,7 @@ Page({
app.globalData.infoCompleted = state
wx.setStorageSync('topGridName', res.data.grid)
wx.setStorageSync('token', res.data.token)
_this.getUserInfoById()
})
} else {
console.log('登录失败' + res.errMsg)
@ -93,97 +199,406 @@ Page({
}
})
},
getMember(){
getFamilyMember().then((res) => {
// 获取用户信息
getUserInfoById () {
api.getUserInfo().then(res => {
console.log("用户信息", res)
// if (res.data.identityNo) {
// wx.reLaunch({
// url: `../familyInfo/familyInfo`
// })
// }
this.getHouseInfo()
}).catch(err => {
console.log(err)
})
},
// 获取房屋信息
getHouseInfo () {
if (!this.data.roomCode) {
return
}
const params = {
roomCode: this.data.roomCode
}
api.getHouseInfo(params).then(res => {
console.log(res.data)
if (res.code == 0) {
this.setData({
houseInfo: res.data
})
}
})
},
// 获取成员信息
getFamilyMember () {
if (!this.data.fmData.identityNo) {
return
}
if (this.data.fmData.identityNo.length < 16) {
return
}
const params = {
idCard: this.data.fmData.identityNo
}
api.getFamilyMember(params).then(res => {
console.log(res.data)
if (res.data) {
this.setData({
'fmData.realName': res.data.userName ? res.data.userName : '',
'fmData.sex': res.data.gender ? res.data.gender : '',
'fmData.mobile': res.data.mobile ? res.data.mobile : '',
inputDisabled: true
})
}
})
},
roadSyncPicker(e){
// 身份证号
bindIdCardInput (e) {
this.setData({
'fmData.roadRelationName' : this.data.roadRelationList[e.detail.value].label
'fmData.identityNo': e.detail.value
})
console.log(this.data.fmData)
},
syncPicker(e){
if(e.currentTarget.dataset.type ==='road' && !this.data.fmData.roadRelationName){
bindIdCardBlur (e) {
this.setData({
'fmData.identityNo': e.detail.value
})
this.getFamilyMember()
},
// 姓名 双向绑定
bindRealNameInput (e) {
this.setData({
'fmData.realName': e.detail.value
})
console.log(this.data.fmData)
},
// 选择性别
bindSexChange (e) {
this.setData({
'fmData.sex': e.detail.value
})
console.log(this.data.fmData)
},
// 更换手机验证方式
changeGetMobileType () {
let type = 'wx'
if (this.data.getMobileType === 'wx') {
type = 'self'
} else if (this.data.getMobileType === 'self') {
type = 'wx'
}
this.setData({
getMobileType: type
})
},
// 手机号 双向绑定
bindMobileInput (e) {
this.setData({
'fmData.mobile': e.detail.value
})
console.log(this.data.fmData)
},
// 验证码 双向绑定
bindSmsCodeInput (e) {
this.setData({
'fmData.smsCode': e.detail.value
})
console.log(this.data.fmData)
},
// 获取手机号
getPhoneNumber (e) {
if (e.detail.errMsg === 'getPhoneNumber:ok') {
const para = {
wxCode: '',
encryptedData: e.detail.encryptedData,
iv: e.detail.iv
}
const that = this
wx.login({
success (res) {
para.wxCode = res.code
api.getWxPhone(para).then(data => {
console.log('获取微信手机号', data)
that.setData({
'fmData.mobile': data.data
})
}).catch(err => {
console.log(err)
})
}
})
}
},
// 获取验证码
getSmsCode () {
if (!this.data.fmData.mobile) {
wx.showToast({
title: '请先选择路牌号',
title: '请先输入手机号',
icon: 'none',
duration: 1000//持续的时间
duration: 2500
})
return false
}
this.setData({
smsCodeText: '获取中...'
})
const mobile = this.data.fmData.mobile
api.sendSms(mobile).then(res => {
wx.showToast({
title: '验证码发送成功',
icon: 'none',
duration: 2500
})
let num = 60
this.setData({
smsCodeText: "60s后重新获取"
})
const timer = setInterval(() => {
if (num >= 1) {
this.setData({
smsCodeText: `${num}s后重新获取`
})
--num
} else {
clearInterval(timer)
this.setData({
smsCodeText: '获取验证码'
})
}
}, 1000)
}).catch(err =>{
console.log(err)
this.setData({
smsCodeText: '获取验证码'
})
})
},
syncPicker(e){
// if(e.currentTarget.dataset.type ==='road' && !this.data.fmData.road){
// wx.showToast({
// title: '请先选择路牌号',
// icon: 'none',
// duration: 1000 // 持续的时间
// })
// }
},
// 路牌号 双向绑定
bindRoadInput (e) {
this.setData({
'houseInfo.houseAddress': e.detail.value,
'fmData.road': e.detail.value
})
console.log(this.data.houseInfo)
},
villageSyncPicker(e){
this.setData({
'fmData.villageRelationName' : this.data.villageRelationList[e.detail.value].label
'houseInfo.plot' : 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)
},
buildSyncPicker(e){
this.setData({
'fmData.buildRelationName' : e.detail.label
'houseInfo.buildingNo' : this.data.buildRelationList[e.detail.value].label,
selectBuildingId: this.data.buildRelationList[e.detail.value].value,
'fmData.dwellingPlace': this.data.buildRelationList[e.detail.value].label
})
this.getUnitOption(this.data.buildRelationList[e.detail.value].value)
},
unitSyncPicker(e){
this.setData({
'fmData.unitRelationName' : e.detail.label
'houseInfo.unit' : this.data.unitRelationList[e.detail.value].label
})
this.getHouseOption(this.data.selectBuildingId, this.data.unitRelationList[e.detail.value].value)
},
houseSyncPicker(e){
this.setData({
'fmData.houseRelationName' : e.detail.label
'houseInfo.roomNo' : this.data.houseRelationList[e.detail.value].label,
'houseInfo.id': this.data.houseRelationList[e.detail.value].value
})
},
submit(e){
let { nickname, surname,name,street,district,buildingAddress,idNum,mobile} = e.detail.value;
this.setDate({
nickname, surname,name,street,district,buildingAddress,idNum,mobile
// 获取wxCode
getWxCode() {
const that = this
return new Promise((resolve, reject) => {
wx.login({
success(res) {
that.setData({
'wxInfo.wxCode': res.code
})
console.log('wxInfo', that.data.wxInfo)
resolve(true)
},
fail (err) {
reject(false)
}
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
// 获取用户信息
getUserInfo(e) {
if (e.detail.errMsg === 'getUserInfo:ok') {
this.setData({
'wxInfo.encryptedData': e.detail.encryptedData,
'wxInfo.iv': e.detail.iv
})
this.getWxCode().then(() => {
this.submitPersonalInfo()
}).catch(() => {
wx.showToast({
title: '获取wxCode失败,请重新提交',
icon: 'none',
duration: 2500
})
})
} else {
wx.showToast({
title: '请授权,再完善个人信息',
icon: 'none',
duration: 2500
})
return false
}
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
submitPersonalInfo () {
if (this.data.getMobileType === 'wx') {
this.submitPersonalInfoByWx()
} else if (this.data.getMobileType === 'self') {
this.submitPersonalInfoBySelf()
}
this.submitHouseInfo()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
// 提交完善信息-从微信获取手机号方式
submitPersonalInfoByWx () {
if (!this.data.fmData.identityNo) {
this.showToast('请输入身份证号')
return false
}
if (!this.data.fmData.realName) {
this.showToast('请填写姓名')
return false
}
if (!this.data.fmData.sex) {
this.showToast('请选择性别')
return false
}
if (!this.data.fmData.mobile) {
this.showToast('请填写手机号')
return false
}
// if (!this.data.fmData.smsCode) {
// this.showToast('请填写验证码')
// return false
// }
const para = {
partyFlag: '0',
identityNo: this.data.fmData.identityNo,
mobile: this.data.fmData.mobile,
smsCode: this.data.fmData.smsCode,
realName: this.data.fmData.realName,
sex: this.data.fmData.sex,
road: this.data.fmData.road,
villageName: this.data.fmData.villageName,
dwellingPlace: this.data.fmData.dwellingPlace,
gridId: this.data.gridInfo.gridId ? this.data.gridInfo.gridId : this.data.houseInfo.gridId,
wxCode: this.data.unionIdStatus === '0' ? this.data.wxInfo.wxCode : '',
encryptedData: this.data.unionIdStatus === '0' ? this.data.wxInfo.encryptedData : '',
iv: this.data.unionIdStatus === '0' ? this.data.wxInfo.iv : ''
}
console.log(para)
api.completeResidentInfoV2(para).then(res => {
wx.reLaunch({
url: "../index/index"
})
})
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
// 提交完善信息,手机号输入方式
submitPersonalInfoBySelf () {
if (!this.data.fmData.identityNo) {
this.showToast('请输入身份证号')
return false
}
if (!this.data.fmData.realName) {
this.showToast('请填写姓名')
return false
}
if (!this.data.fmData.sex) {
this.showToast('请选择性别')
return false
}
if (!this.data.fmData.mobile) {
this.showToast('请填写手机号')
return false
}
if (!this.data.fmData.smsCode) {
this.showToast('请填写验证码')
return false
}
if (!this.data.fmData.road) {
this.showToast('请填写所在街道')
return false
}
const para = {
partyFlag: '0',
identityNo: this.data.fmData.identityNo,
mobile: this.data.fmData.mobile,
smsCode: this.data.fmData.smsCode,
realName: this.data.fmData.realName,
sex: this.data.fmData.sex,
road: this.data.fmData.road,
villageName: this.data.fmData.villageName,
dwellingPlace: this.data.fmData.dwellingPlace,
gridId: this.data.gridInfo.gridId ? this.data.gridInfo.gridId : this.data.houseInfo.gridId,
wxCode: this.data.unionIdStatus === '0' ? this.data.wxInfo.wxCode : '',
encryptedData: this.data.unionIdStatus === '0' ? this.data.wxInfo.encryptedData : '',
iv: this.data.unionIdStatus === '0' ? this.data.wxInfo.iv : ''
}
console.log(para)
api.completeResidentInfo(para).then(res => {
wx.reLaunch({
url: "../index/index"
})
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
submitHouseInfo () {
if (!this.data.fmData.identityNo) {
this.showToast('请输入您的身份证号')
return
}
if (!this.data.fmData.realName) {
this.showToast('请输入您的姓名')
return
}
if (!this.data.fmData.mobile) {
this.showToast('请输入您的手机号')
return
}
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,
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,
buildingNo: this.data.houseInfo.buildingNo ? this.data.houseInfo.buildingNo : this.data.houseInfo.buildingName,
unit: this.data.houseInfo.unit,
roomNo: this.data.houseInfo.roomNo
}
api.bindingFamily(params).then(res => {
console.log(res.data)
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
// 代码简化,弹窗统一封装
showToast (title) {
wx.showToast({
title: title,
icon: 'none',
duration: 2000
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

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

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

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

@ -1,7 +1,7 @@
<form wx:if="{{isApplied}}" class="m-fm" bindsubmit="submit" report-submit="true">
<view class="fm">
<view class="item-title">基础信息</view>
<view class="item">
<!-- <view class="item">
<view class="field">
<text class="z-stress">*</text>
昵称
@ -9,55 +9,79 @@
<view class="input">
<input type="text" value="{{ fmData.nickname }}" placeholder="请输入您的昵称" placeholder-class="z-ph" name="nickname" cursor-spacing="14" maxlength="100" />
</view>
</view>
</view> -->
<view class="item">
<view class="field">
<text class="z-stress">*</text>
身份证号
</view>
<view class="input">
<input type="text" value="{{ fmData.surname }}" placeholder="请输入您的姓氏" placeholder-class="z-ph" name="surname" cursor-spacing="14" maxlength="100" />
<input type="text" bindblur="bindIdCardBlur" bindinput="bindIdCardInput" value="{{ fmData.identityNo }}" placeholder="请输入您的身份证号码" placeholder-class="z-ph" name="identityNo" cursor-spacing="14" maxlength="18" />
</view>
</view>
<view class="item">
<view class="field">
<text class="z-stress">*</text>
</view>
<view class="input">
<input type="text" value="{{ fmData.name }}" placeholder="请输入您的名字" placeholder-class="z-ph" name="name" cursor-spacing="14" maxlength="100" />
<input disabled="{{inputDisabled}}" type="text" bindblur="bindRealNameInput" bindinput="bindRealNameInput" value="{{ fmData.realName }}" placeholder="请输入您的名字" placeholder-class="z-ph" name="realName" cursor-spacing="14" maxlength="100" />
</view>
</view>
<view class="item">
<view class="field">
<text class="z-stress">*</text>
手机号
性别
</view>
<view class="input">
<input type="text" value="{{ fmData.mobile }}" placeholder="请输入您的手机号" placeholder-class="z-ph" name="mobile" cursor-spacing="14" maxlength="100" />
<radio-group class="radio-group" bindchange="bindSexChange">
<radio checked="{{fmData.sex === '1'}}" value="1" color="#F82525" class="radio" disabled="{{inputDisabled}}">男</radio>
<radio checked="{{fmData.sex === '0'}}" value="0" color="#F82525" class="radio" disabled="{{inputDisabled}}">女</radio>
</radio-group>
</view>
</view>
<view class="item">
<view class="item" wx:if="{{getMobileType === 'wx'}}">
<view class="field">
<text class="z-stress">*</text>
身份证
手机
</view>
<view class="input">
<input type="text" value="{{ fmData.idNum }}" placeholder="请输入您的身份证号码" placeholder-class="z-ph" name="idNum" cursor-spacing="14" maxlength="18" />
<view class="input input-box">
<input wx:if="{{fmData.mobile}}" disabled="{{true}}" type="number" bindblur="bindMobileInput" bindinput="bindMobileInput" value="{{fmData.mobile}}" placeholder-class="z-ph" placeholder="请获取手机号" />
<button hover-class="button-hover" class="get-code" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">{{fmData.mobile ? '重新获取' : '获取手机号'}}</button>
</view>
</view>
<view class="item" wx:if="{{getMobileType === 'self'}}">
<view class="field">
<text class="z-stress">*</text>
手机号
</view>
<view class="input-box">
<input disabled="{{inputDisabled}}" type="number" bindblur="bindMobileInput" bindinput="bindMobileInput" value="{{fmData.mobile}}" placeholder-class="z-ph" placeholder="请获取手机号" />
</view>
</view>
<view class="item" wx:if="{{getMobileType === 'self'}}">
<view class="field">
<text class="z-stress">*</text>
验证码
</view>
<view class="input-box">
<input bindblur="bindSmsCodeInput" bindinput="bindSmsCodeInput" value="{{fmData.smsCode}}" placeholder-class="z-ph" placeholder="请输入验证码" />
<button disabled="{{smsCodeText !== '获取验证码'}}" bindtap="getSmsCode" hover-class="button-hover" class="get-code">{{smsCodeText}}</button>
</view>
</view>
</view>
<view class="note" bindtap="changeGetMobileType">{{getMobileType === 'wx' ? '*如若获取手机号异常,请点击切换至手机号/验证码注册方式' : '*点击可切回至从微信获取手机号注册方式'}}</view>
<view class="fm mt20">
<view class="fm mt20" wx:if="{{roomCode}}">
<!-- <view class="item-title border-bot0">现居住地</view> -->
<view class="item">
<view class="field">
<view class="field-text">所属网格</view>
</view>
<view class="value">
<view class="input">
{{fmData.sex}}
<view class="input right">
{{gridInfo.gridName}}
</view>
</view>
</view>
@ -67,13 +91,76 @@
路牌号
</view>
<view class="value">
<picker class="picker" range="{{roadRelationList}}" range-key="label" bindchange="roadSyncPicker">
<view class="picker-text" wx:if="{{fmData.roadRelationName}}">
{{fmData.roadRelationName}}
</view>
<view class="picker-text z-weak" wx:else>请选择</view>
<image class="menu-arrow" src="/subpages/family/images/arrow.png" mode="aspectFit" />
</picker>
<view class="input right">
{{houseInfo.roadName}}
</view>
</view>
</view>
<view class="item">
<view class="field">
<text class="z-white">*</text>
小区名称
</view>
<view class="value">
<view class="input right">
{{houseInfo.plotName}}
</view>
</view>
</view>
<view class="item">
<view class="field">
<text class="z-white">*</text>
楼栋
</view>
<view class="value">
<view class="input right">
{{houseInfo.buildingName}}
</view>
</view>
</view>
<view class="item">
<view class="field">
<text class="z-white">*</text>
单元
</view>
<view class="value">
<view class="input right">
{{houseInfo.unit}}
</view>
</view>
</view>
<view class="item">
<view class="field">
<text class="z-stress">*</text>
房屋
</view>
<view class="value">
<view class="input right">
{{houseInfo.roomNo}}
</view>
</view>
</view>
</view>
<view class="fm mt20" wx:else>
<!-- <view class="item-title border-bot0">现居住地</view> -->
<view class="item">
<view class="field">
<view class="field-text">所属网格</view>
</view>
<view class="value">
<view class="input">
{{gridInfo.gridName}}
</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="{{ houseInfo.houseAddress }}" placeholder="请输入" placeholder-class="z-ph" name="houseAddress" cursor-spacing="14" maxlength="100" />
</view>
</view>
<view class="item">
@ -82,9 +169,9 @@
小区名称
</view>
<view class="value">
<picker class="picker" range="{{villageRelationList}}" range-key="label" bindchange="villageSyncPicker" disabled="{{!fmData.roadRelationName}}">
<view class="picker-text" wx:if="{{fmData.villageRelationName}}">
{{fmData.villageRelationName}}
<picker class="picker" range="{{villageRelationList}}" range-key="label" bindchange="villageSyncPicker">
<view class="picker-text" wx:if="{{houseInfo.plot}}">
{{houseInfo.plot}}
</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" />
@ -97,9 +184,9 @@
楼栋
</view>
<view class="value">
<picker class="picker" range="{{buildRelationList}}" range-key="label" bindchange="buildSyncPicker">
<view class="picker-text" wx:if="{{fmData.buildRelationName}}">
{{fmData.buildRelationName}}
<picker class="picker" range="{{buildRelationList}}" range-key="label" bindchange="buildSyncPicker" disabled="{{buildRelationList.length == 0}}">
<view class="picker-text" wx:if="{{houseInfo.buildingNo}}">
{{houseInfo.buildingNo}}
</view>
<view class="picker-text z-weak" wx:else>请选择</view>
<image class="menu-arrow" src="/subpages/family/images/arrow.png" mode="aspectFit" />
@ -112,9 +199,9 @@
单元
</view>
<view class="value">
<picker class="picker" range="{{unitRelationList}}" range-key="label" bindchange="unitSyncPicker">
<view class="picker-text" wx:if="{{fmData.unitRelationName}}">
{{fmData.unitRelationName}}
<picker class="picker" range="{{unitRelationList}}" range-key="label" bindchange="unitSyncPicker" disabled="{{unitRelationList.length == 0}}">
<view class="picker-text" wx:if="{{houseInfo.unit}}">
{{houseInfo.unit}}
</view>
<view class="picker-text z-weak" wx:else>请选择</view>
<image class="menu-arrow" src="/subpages/family/images/arrow.png" mode="aspectFit" />
@ -127,9 +214,9 @@
房屋
</view>
<view class="value">
<picker class="picker" range="{{houseRelationList}}" range-key="label" bindchange="houseSyncPicker">
<view class="picker-text" wx:if="{{fmData.houseRelationName}}">
{{fmData.houseRelationName}}
<picker class="picker" range="{{houseRelationList}}" range-key="label" bindchange="houseSyncPicker" disabled="{{houseRelationList.length == 0}}">
<view class="picker-text" wx:if="{{houseInfo.roomNo}}">
{{houseInfo.roomNo}}
</view>
<view class="picker-text z-weak" wx:else>请选择</view>
<image class="menu-arrow" src="/subpages/family/images/arrow.png" mode="aspectFit" />
@ -137,7 +224,11 @@
</view>
</view>
</view>
<button formType="submit" class="submit-btn {{ submitBtnIsAllowed ? '' : 'z-disabled'}}" plain="true">
提交
</button>
<view class="submit-button" wx:if="{{unionIdStatus === '1'}}">
<button bindtap="submitPersonalInfo" hover-class="hover-submit">提交</button>
</view>
<view class="submit-button" wx:if="{{unionIdStatus === '0'}}">
<button hover-class="hover-submit" open-type="getUserInfo" bindgetuserinfo="getUserInfo">提交</button>
</view>
</form>

70
epdc-resident-mp-yushan/subpages/family/pages/bindFamily/bindFamily.wxss

@ -63,4 +63,72 @@
.item{
position: relative;
}
.value{position:absolute;right:0;width:410rpx;display:flex;font-size:32rpx;font-family:Source Han Serif SC;font-weight:400;color:#333;line-height:60rpx}.value .picker{position:relative;width:100%;padding-right:40rpx;text-align:right}.value .picker .z-weak{color:#999}.value .picker .menu-arrow{position:absolute;top:20rpx;right:0;width:16rpx;height:23rpx}
.value{position:absolute;right:0;width:410rpx;display:flex;font-size:32rpx;font-family:Source Han Serif SC;font-weight:400;color:#333;line-height:60rpx}.value .picker{position:relative;width:100%;padding-right:40rpx;text-align:right}.value .picker .z-weak{color:#999}.value .picker .menu-arrow{position:absolute;top:20rpx;right:0;width:16rpx;height:23rpx}
.m-fm .fm .item .right {
text-align: right;
}
.input radio-group {
height: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
color: #999;
font-size: 28rpx;
}
.input radio-group radio + radio {
margin-left: 20rpx;
}
.item .input-box {
width: 560rpx !important;
display: flex;
align-items: center;
justify-content: flex-end;
}
.item .input-box input {
text-align: right;
}
.input-box .button-hover {
background: rgb(175, 1, 1);
}
.get-code {
padding: 0 15rpx;
width: 150rpx;
height: 60rpx;
line-height: 60rpx;
background: linear-gradient(to right, #F40C0C, #FF4E4E);
color: #fff;
font-size: 24rpx;
border-radius: 6rpx;
margin: 0;
margin-left: 25rpx;
}
.note {
font-size: 22rpx;
color: #999;
line-height: 62rpx;
margin-left: 20rpx;
}
.submit-button {
width: 100%;
height: 84rpx;
display: flex;
align-items: center;
justify-content: center;
margin: 30rpx 0 65rpx;
}
.submit-button button {
height: 84rpx;
line-height: 84rpx;
width: 560rpx;
padding: 0;
text-align: center;
color: #fff;
font-size: 33rpx;
border-radius: 16rpx;
background: linear-gradient(to right, #F40C0C, #FF4E4E);
}
.submit-button .hover-submit {
background: rgb(175, 1, 1);
}

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

@ -75,7 +75,14 @@ module.exports = {
getVolunteerDetail: getVolunteerDetail,
getVolunteerList: getVolunteerList,
handleApply: handleApply,
userInfoSignUp: userInfoSignUp
userInfoSignUp: userInfoSignUp,
getHouseInfo,
getPlotOptionApp,
getBuildingOptionApp,
getUnitOption,
getHouseOption,
bindingFamily,
getFamilyMember
}
function getToken(wxCode) {
@ -574,4 +581,35 @@ function handleApply(params) {
// 用户签到
function userInfoSignUp () {
return fly.get("app-user/user/sign")
}
// 获取房屋信息
function getHouseInfo (params) {
return fly.get('custom/personroom/getHouseInfo', params)
}
// 获取小区下拉列表
function getPlotOptionApp (params) {
return fly.get('custom/personroom/getPlotOptionApp', params)
}
// 获取楼栋下拉列表
function getBuildingOptionApp (params) {
return fly.get('custom/personroom/getBuildingOptionApp', params)
}
// 获取单元下拉列表
function getUnitOption (params) {
return fly.get('custom/personroom/getUnitOption', params)
}
// 获取房屋下拉列表
function getHouseOption (params) {
return fly.get('custom/personroom/getHouseOption', params)
}
// 绑定我的家庭房屋
function bindingFamily(params) {
return fly.post("custom/personroom/bindingFamily", params)
}
// 获取成员信息
function getFamilyMember (params) {
return fly.get('custom/personroom/getFamilyMember', params)
}
Loading…
Cancel
Save