Browse Source

1、修改注册与个人信息表单,增加行政区域选择;

shibei
luyan 1 year ago
parent
commit
d86d9a2994
  1. 79
      miniprogram/pages/formid/formid.js
  2. 95
      miniprogram/pages/formid/formid.wxml
  3. 9
      miniprogram/subpages/checkIn/pages/checkIn/register/register.js

79
miniprogram/pages/formid/formid.js

@ -31,6 +31,7 @@ Page({
shibei: '1', //是否居住在市北 shibei: '1', //是否居住在市北
workIndustryText: '', //所属行业其他输入框, workIndustryText: '', //所属行业其他输入框,
couplingCommunity: [], //包联社区 couplingCommunity: [], //包联社区
region:''
}, },
selectedStatus: false, selectedStatus: false,
selectOption: [{ selectOption: [{
@ -125,6 +126,44 @@ Page({
label: '其他', label: '其他',
value: '11' value: '11'
}], }],
regionOptions:[
{
label: '市南区',
value: '0'
},
{
label: '李沧区',
value: '1'
},
{
label: '崂山区',
value: '2'
},
{
label: '西海岸新区',
value: '3'
},
{
label: '城阳区',
value: '4'
},
{
label: '即墨区',
value: '5'
},
{
label: '胶州市',
value: '6'
},
{
label: '平度市',
value: '7'
},
{
label: '莱西市',
value: '8'
},
],
workTypeInput: false, workTypeInput: false,
workTypeText: '', //单位类型为其他的输入框值 workTypeText: '', //单位类型为其他的输入框值
newArr: [], newArr: [],
@ -158,11 +197,20 @@ Page({
let end = obj.identityNo.slice(15, 18); let end = obj.identityNo.slice(15, 18);
obj.identityNo = str + temp + end; obj.identityNo = str + temp + end;
} }
let region = ''
if(obj.villageName != ''){
if(obj.villageName.indexOf('-') > 1){
let temp = obj.villageName
region = temp.split('-')[0]
obj.villageName = temp.split('-')[1]
}
}
obj.allDeptIds = obj.allDeptIds.split(',') obj.allDeptIds = obj.allDeptIds.split(',')
obj.couplingCommunity = obj.couplingCommunity.split(',') obj.couplingCommunity = obj.couplingCommunity.split(',')
this.setData({ this.setData({
form: { form: {
...obj ...obj,
region:region
}, },
title: options.title, title: options.title,
}) })
@ -447,6 +495,11 @@ Page({
'form.villageName': e.detail.value 'form.villageName': e.detail.value
}) })
}, },
bindRegionVillageName(e) {
this.setData({
'form.villageName': e.detail.value
})
},
//单选框 //单选框
bindFlagshibeiChange(e) { bindFlagshibeiChange(e) {
this.getDeptTree() this.getDeptTree()
@ -485,6 +538,11 @@ Page({
'form.workType': this.data.selectOption[e.detail.value].label, 'form.workType': this.data.selectOption[e.detail.value].label,
}) })
}, },
handleChangeRegion(e) {
this.setData({
'form.region': this.data.regionOptions[e.detail.value].label,
})
},
handleChangeServiceType(e) { handleChangeServiceType(e) {
if (e.detail.value == '7') { if (e.detail.value == '7') {
@ -583,7 +641,7 @@ Page({
}else { }else {
this.data.form.identityNo = this.idNo; this.data.form.identityNo = this.idNo;
} }
if (this.data.form.mobile.length != 11) { if (this.data.form.mobile.length != 11 || !this.data.form.mobile) {
this.showToast('请填写正确的手机号码') this.showToast('请填写正确的手机号码')
return false return false
} }
@ -595,10 +653,6 @@ Page({
this.showToast('请填写专业特长') this.showToast('请填写专业特长')
return false return false
} }
if (!this.data.form.mobile) {
this.showToast('请填写正确的手机号码')
return false
}
if (this.data.form.shibei == '1') { if (this.data.form.shibei == '1') {
if (this.data.form.allDeptIds.length == 0) { if (this.data.form.allDeptIds.length == 0) {
this.showToast('请选择报到常住社区名称') this.showToast('请选择报到常住社区名称')
@ -613,7 +667,10 @@ Page({
// return false // return false
// } // }
} else if (this.data.form.shibei == '0') { } else if (this.data.form.shibei == '0') {
this.data.form.villageName = '', if(this.data.form.region != '' && this.data.form.villageName != ''){
let temp = this.data.form.region + '-' + this.data.form.villageName;
this.data.form.villageName = temp
}
this.data.form.allDeptIds = [] this.data.form.allDeptIds = []
} }
const para = { const para = {
@ -718,6 +775,7 @@ Page({
this.showToast('请填写手机号') this.showToast('请填写手机号')
return return
} }
if (this.data.form.shibei == '1') { if (this.data.form.shibei == '1') {
if (this.data.form.allDeptIds.length == 0) { if (this.data.form.allDeptIds.length == 0) {
this.showToast('请选择报到常住社区名称') this.showToast('请选择报到常住社区名称')
@ -732,8 +790,11 @@ Page({
// return // return
// } // }
} else if (this.data.form.shibei == '0') { } else if (this.data.form.shibei == '0') {
this.data.form.allDeptIds = [], if(!this.data.form.region){
this.data.form.villageName = '' this.showToast('请选择行政区域')
return
}
this.data.form.allDeptIds = []
} }
this.setData({ this.setData({
visible: true visible: true

95
miniprogram/pages/formid/formid.wxml

@ -6,7 +6,7 @@
<view class="title">姓名</view> <view class="title">姓名</view>
</view> </view>
<view class="right" readonly> <view class="right" readonly>
<input confirm-type="next" bindblur="bindRealNameInput" bindinput="bindRealNameInput" value="{{form.realName}}" placeholder-class="placeholder-style" placeholder="请输入" /> <input confirm-type="next" bindblur="bindRealNameInput" bindinput="bindRealNameInput" value="{{form.realName}}" placeholder-class="placeholder-style" placeholder="请输入姓名" />
</view> </view>
</view> </view>
<view class="list-item "> <view class="list-item ">
@ -15,7 +15,7 @@
<view class="title">身份证号</view> <view class="title">身份证号</view>
</view> </view>
<view class="right"> <view class="right">
<input confirm-type="next" bindblur="bindRealidentityNoInput" bindinput="bindRealidentityNoInput" value="{{form.identityNo}}" placeholder-class="placeholder-style" placeholder="请输入" /> <input confirm-type="next" bindblur="bindRealidentityNoInput" bindinput="bindRealidentityNoInput" value="{{form.identityNo}}" placeholder-class="placeholder-style" placeholder="请输入身份证号码" />
</view> </view>
</view> </view>
<view class="list-item "> <view class="list-item ">
@ -24,7 +24,7 @@
<view class="title">手机号码</view> <view class="title">手机号码</view>
</view> </view>
<view class="right"> <view class="right">
<input confirm-type="next" bindblur="bindRealMobileInput" bindinput="bindRealMobileInput" value="{{form.mobile}}" placeholder-class="placeholder-style" placeholder="请输入" /> <input confirm-type="next" bindblur="bindRealMobileInput" bindinput="bindRealMobileInput" value="{{form.mobile}}" placeholder-class="placeholder-style" placeholder="请输入手机号码" />
</view> </view>
</view> </view>
<view class="list-item " wx:if="{{!title}}"> <view class="list-item " wx:if="{{!title}}">
@ -33,7 +33,7 @@
<view class="title">密码</view> <view class="title">密码</view>
</view> </view>
<view class="right"> <view class="right">
<input confirm-type="next" password bindblur="bindPassWordInput" bindinput="bindPassWordInput" value="{{form.password}}" placeholder-class="placeholder-style" placeholder="请输入" /> <input confirm-type="next" password bindblur="bindPassWordInput" bindinput="bindPassWordInput" value="{{form.password}}" placeholder-class="placeholder-style" placeholder="请输入密码" />
</view> </view>
</view> </view>
<view class="list-item " wx:if="{{!title}}"> <view class="list-item " wx:if="{{!title}}">
@ -42,7 +42,7 @@
<view class="title">确认密码</view> <view class="title">确认密码</view>
</view> </view>
<view class="right"> <view class="right">
<input confirm-type="next" password bindblur="bindCheckPassWordInput" bindinput="bindCheckPassWordInput" value="{{checkPassword}}" placeholder-class="placeholder-style" placeholder="请输入" /> <input confirm-type="next" password bindblur="bindCheckPassWordInput" bindinput="bindCheckPassWordInput" value="{{checkPassword}}" placeholder-class="placeholder-style" placeholder="请确认密码" />
</view> </view>
</view> </view>
<view class="list-item gray"> <view class="list-item gray">
@ -51,7 +51,7 @@
<view class="title">工作单位</view> <view class="title">工作单位</view>
</view> </view>
<view class="right"> <view class="right">
<input confirm-type="next" bindblur="bindWorkUnitInput" bindinput="bindWorkUnitInput" value="{{form.workUnit}}" placeholder-class="placeholder-style" placeholder="请输入" /> <input confirm-type="next" bindblur="bindWorkUnitInput" bindinput="bindWorkUnitInput" value="{{form.workUnit}}" placeholder-class="placeholder-style" placeholder="**区**单位" />
</view> </view>
</view> </view>
<view class="list-item "> <view class="list-item ">
@ -61,29 +61,28 @@
</view> </view>
<view class="right"> <view class="right">
<picker range="{{selectOption}}" range-key="label" bindchange="handleChangeWorkType"> <picker range="{{selectOption}}" range-key="label" bindchange="handleChangeWorkType">
<view class="{{form.workType?'':'gray-font'}}">{{form.workType?form.workType:'请选择'}}</view> <view class="{{form.workType?'':'gray-font'}}">{{form.workType?form.workType:'请选择单位性质'}}</view>
</picker> </picker>
</view> </view>
</view> </view>
<view class="list-item gray"> <view class="list-item" wx:if="{{form.workType == '其他'}}">
<view class="left"> <view class="left">
<text class="must">*</text> <!-- <text class="must">*</text> -->
<view class="title">专业特长</view> <view class="title">单位性质(其他)</view>
</view> </view>
<view class="right"> <view class="right">
<input confirm-type="next" bindblur="bindWorkIndustryInput" bindinput="bindWorkIndustryInput" value="{{form.workIndustry}}" placeholder-class="placeholder-style" placeholder="请输入" /> <input confirm-type="next" bindblur="bindWorkTypeTextInput" bindinput="bindWorkTypeTextInput" value="{{workTypeText}}" placeholder-class="placeholder-style" placeholder="请输入单位性质" />
</view> </view>
</view> </view>
<view class="list-item" wx:if="{{form.workType == '其他'}}"> <view class="list-item gray">
<view class="left"> <view class="left">
<!-- <text class="must">*</text> --> <text class="must">*</text>
<view class="title">单位性质(其他)</view> <view class="title">专业特长</view>
</view> </view>
<view class="right"> <view class="right">
<input confirm-type="next" bindblur="bindWorkTypeTextInput" bindinput="bindWorkTypeTextInput" value="{{workTypeText}}" placeholder-class="placeholder-style" placeholder="请输入" /> <input confirm-type="next" bindblur="bindWorkIndustryInput" bindinput="bindWorkIndustryInput" value="{{form.workIndustry}}" placeholder-class="placeholder-style" placeholder="请输入专业特长" />
</view> </view>
</view> </view>
<!-- <view class="list-item gray" wx:if="{{form.workIndustry=='5'}}"> <!-- <view class="list-item gray" wx:if="{{form.workIndustry=='5'}}">
<view class="left"> <view class="left">
<text class="must">*</text> <text class="must">*</text>
@ -100,7 +99,7 @@
</view> </view>
<view class="right"> <view class="right">
<picker range="{{serviceOpitons}}" range-key="label" bindchange="handleChangeServiceType"> <picker range="{{serviceOpitons}}" range-key="label" bindchange="handleChangeServiceType">
<view class="{{form.hobbies?'':'gray-font'}}">{{form.hobbies?form.hobbies:'请选择'}}</view> <view class="{{form.hobbies?'':'gray-font'}}">{{form.hobbies?form.hobbies:'请选择服务意向'}}</view>
</picker> </picker>
</view> </view>
</view> </view>
@ -115,32 +114,54 @@
</radio-group> </radio-group>
</view> </view>
</view> </view>
<view class="list-item gray" wx:if="{{form.shibei==1}}"> <view wx:if="{{form.shibei == 1}}">
<view class="left"> <view class="list-item gray">
<text class="must">*</text> <view class="left">
<view class="title">常住社区名称</view> <text class="must">*</text>
<view class="title">常住社区名称</view>
</view>
<picker mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex}}" range="{{newArr}}">
<view class="picker">
<van-button type="primary" wx:if="{{changeFlag}}">
{{newArr[0][multiIndex[0]]}},{{newArr[1][multiIndex[1]]}}
</van-button>
<van-button wx:else class=" gray-font">
请选择常住社区
</van-button>
</view>
</picker>
</view> </view>
<picker mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex}}" range="{{newArr}}"> <view class="list-item ">
<view class="picker"> <view class="left">
<van-button type="primary" wx:if="{{changeFlag}}"> <text class="must">*</text>
{{newArr[0][multiIndex[0]]}},{{newArr[1][multiIndex[1]]}} <view class="title">常住小区名称</view>
</van-button>
<van-button wx:else class=" gray-font">
请选择
</van-button>
</view> </view>
</picker> <view class="right">
<input confirm-type="next" bindblur="bindvillageNameInput" bindinput="bindvillageNameInput" value="{{form.villageName}}" placeholder-class="placeholder-style" placeholder="请输入**小区" />
</view>
</view>
</view> </view>
<view wx:if="{{form.shibei == '0'}}">
<view class="list-item " wx:if="{{form.shibei == '1'}}"> <view class="list-item ">
<view class="left"> <view class="left">
<text class="must">*</text> <text class="must">*</text>
<view class="title">居住小区名称</view> <view class="title">行政区域</view>
</view>
<picker range="{{regionOptions}}" range-key="label" bindchange="handleChangeRegion">
<view class="{{form.region?'':'gray-font'}}">{{form.region?form.region:'请选择行政区域'}}</view>
</picker>
</view> </view>
<view class="right"> <view class="list-item ">
<input confirm-type="next" bindblur="bindvillageNameInput" bindinput="bindvillageNameInput" value="{{form.villageName}}" placeholder-class="placeholder-style" placeholder="请输入" /> <view class="left">
<text class="must">*</text>
<view class="title">居住地址</view>
</view>
<view class="right">
<input confirm-type="next" bindblur="bindRegionVillageName" bindinput="bindRegionVillageName" value="{{form.villageName}}" placeholder-class="placeholder-style" placeholder="**区**路**号**小区" />
</view>
</view> </view>
</view> </view>
<!-- <view class="list-item " wx:if="{{form.shibei == '1'}}"> <!-- <view class="list-item " wx:if="{{form.shibei == '1'}}">
<view class="left"> <view class="left">
<text class="must">*</text> <text class="must">*</text>

9
miniprogram/subpages/checkIn/pages/checkIn/register/register.js

@ -1,4 +1,3 @@
// subpages/checkIn/pages/checkIn/register/register.js
const api = require('../../../../../utils/partApi') const api = require('../../../../../utils/partApi')
const app = getApp() const app = getApp()
Page({ Page({
@ -616,8 +615,8 @@ Page({
naviLiveAddress: function (e) { naviLiveAddress: function (e) {
let wxMap = wx.createMapContext('map', this); let wxMap = wx.createMapContext('map', this);
wxMap.openMapApp({ wxMap.openMapApp({
latitude: 22.609587, latitude: parseFloat(this.tipData.liveLatitude),
longitude: 114.02931, longitude: parseFloat(this.tipData.liveLongitude),
destination: this.tipData.liveAddress, destination: this.tipData.liveAddress,
complete: res => { complete: res => {
console.log(res); console.log(res);
@ -627,8 +626,8 @@ Page({
naviCouplingAddress: function (e) { naviCouplingAddress: function (e) {
let wxMap = wx.createMapContext('map', this); let wxMap = wx.createMapContext('map', this);
wxMap.openMapApp({ wxMap.openMapApp({
latitude: 22.609587, latitude: parseFloat(this.tipData.couplingLatitude),
longitude: 114.02931, longitude: parseFloat(this.tipData.couplingLongitude),
destination: this.tipData.couplingAddress, destination: this.tipData.couplingAddress,
complete: res => { complete: res => {
console.log(res); console.log(res);

Loading…
Cancel
Save