Browse Source

修改身份证号码只填后6位

shibei
luyan 1 year ago
parent
commit
07603d27ae
  1. 7
      miniprogram/pages/forgotPwd/forgotPwd.js
  2. 4
      miniprogram/pages/forgotPwd/forgotPwd.wxml
  3. 29
      miniprogram/pages/formid/formid.js
  4. 4
      miniprogram/pages/formid/formid.wxml
  5. 8
      miniprogram/pages/login/login.wxml
  6. 4
      miniprogram/utils/config.js

7
miniprogram/pages/forgotPwd/forgotPwd.js

@ -93,15 +93,14 @@ Page({
submit(){ submit(){
if(!this.data.form.identityNo){ if(!this.data.form.identityNo){
wx.showToast({ wx.showToast({
title: '请输入身份证号码', title: '请输入身份证号码后6位',
icon:'none' icon:'none'
}) })
return false return false
} }
console.log(this.data.form.identityNo.length); if(this.data.form.identityNo.length !== 6){
if(this.data.form.identityNo.length !== 18){
wx.showToast({ wx.showToast({
title: '身份证号码错误,请确认身份证号码', title: '请确认身份证号码后6位',
icon:'none' icon:'none'
}) })
return false return false

4
miniprogram/pages/forgotPwd/forgotPwd.wxml

@ -3,11 +3,11 @@
<view class="list-item "> <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">身份证尾号(后6位)</view>
</view> </view>
<view class="right" readonly> <view class="right" readonly>
<input confirm-type="next" <input confirm-type="next"
bindblur="bindIdentityNo" bindinput="bindIdentityNo" value="{{form.identityNo}}" placeholder-class="placeholder-style" placeholder="请输入身份证号" /> bindblur="bindIdentityNo" bindinput="bindIdentityNo" value="{{form.identityNo}}" placeholder-class="placeholder-style" placeholder="请输入身份证号" />
</view> </view>
</view> </view>
<view class="list-item "> <view class="list-item ">

29
miniprogram/pages/formid/formid.js

@ -191,13 +191,16 @@ Page({
delete obj[key]; delete obj[key];
} }
} }
if (obj.identityNo.length == 18) { if(null != obj.identityNo && obj.identityNo != ''){
this.idNo = obj.identityNo; this.data.form.identityNo = obj.identityNo
let temp = '*********'; }
let str = obj.identityNo.slice(0, 4); // if (obj.identityNo.length == 18) {
let end = obj.identityNo.slice(15, 18); // this.idNo = obj.identityNo;
obj.identityNo = str + temp + end; // let temp = '*********';
} // let str = obj.identityNo.slice(0, 4);
// let end = obj.identityNo.slice(15, 18);
// obj.identityNo = str + temp + end;
// }
let region = '' let region = ''
if(obj.villageName != ''){ if(obj.villageName != ''){
if(obj.villageName.indexOf('-') > 1){ if(obj.villageName.indexOf('-') > 1){
@ -384,7 +387,6 @@ Page({
newArr: this.data.newArr, newArr: this.data.newArr,
changeFlag: true changeFlag: true
}) })
console.log(this.data.newArr);
}, },
//滑动社区 //滑动社区
bindMultiPickerColumnChangeC(e) { bindMultiPickerColumnChangeC(e) {
@ -587,7 +589,6 @@ Page({
// gridId: '1224104693058306049', // gridId: '1224104693058306049',
wxCode: res.code wxCode: res.code
} }
console.log(wxCode);
api.getTokenV3(para).then(function (res) { api.getTokenV3(para).then(function (res) {
global.Token = res.data.token global.Token = res.data.token
wx.removeStorageSync('token') wx.removeStorageSync('token')
@ -635,9 +636,9 @@ Page({
this.showToast('请填写身份证号码') this.showToast('请填写身份证号码')
return false return false
} }
this.data.form.identityNo = this.idNo // this.data.form.identityNo = this.idNo
if (this.data.form.identityNo.length != 18) { if (this.data.form.identityNo.length != 6) {
this.showToast('请填写正确的身份证号码') this.showToast('请输入身份证号码后6位')
return false return false
}else { }else {
this.data.form.identityNo = this.idNo; this.data.form.identityNo = this.idNo;
@ -759,8 +760,8 @@ Page({
this.showToast('请输入姓名') this.showToast('请输入姓名')
return return
} }
if (!this.data.form.identityNo && this.data.form.identityNo.length == 18) { if (!this.data.form.identityNo && this.data.form.identityNo.length == 6) {
this.showToast('请填写正确的身份证号码') this.showToast('请输入身份证号码后6位')
return return
} }
if (!this.data.form.workIndustry) { if (!this.data.form.workIndustry) {

4
miniprogram/pages/formid/formid.wxml

@ -12,10 +12,10 @@
<view class="list-item "> <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">身份证(后6位)</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 ">

8
miniprogram/pages/login/login.wxml

@ -6,7 +6,7 @@
<view class="info-bg"> <view class="info-bg">
<view class="name"> <view class="name">
<view class="info-input"> <view class="info-input">
<input bindinput="getmobile" placeholder="请输入手机号码或身份证号码" value="{{mobile}}"></input> <input bindinput="getmobile" placeholder="请输入手机号码" value="{{mobile}}"></input>
</view> </view>
</view> </view>
<view class="password"> <view class="password">
@ -15,9 +15,9 @@
</view> </view>
</view> </view>
<view class="login" bind:tap="handleLogin">登 录</view> <view class="login" bind:tap="handleLogin">登 录</view>
<view> <view style="display: flex;">
<view style="color: #f72f3f;font-size: 28rpx;margin-left: 150rpx;cursor: pointer;margin-top: 25rpx;" bind:tap="toRegister">去注册</view> <view style="color: #f72f3f;font-size: 28rpx;width: 50%;text-align: center;margin-top: 25rpx;" bind:tap="toRegister">去注册</view>
<view style="color: #f72f3f;font-size: 28rpx;margin-left: 400rpx; cursor: pointer;margin-top: -40rpx;" bind:tap="forgotPwd">忘记密码</view> <view style="color: #f72f3f;font-size: 28rpx;width: 50%;text-align: center;margin-top: 25rpx;" bind:tap="forgotPwd">忘记密码</view>
</view> </view>
</view> </view>
</view> </view>

4
miniprogram/utils/config.js

@ -8,8 +8,8 @@ module.exports = {
// 现在小程序的功能 主要走咱这边自己的接口,另外 党群服务中心、需求清单、问卷调查走产品的接口,所以导致接口半路径不同 // 现在小程序的功能 主要走咱这边自己的接口,另外 党群服务中心、需求清单、问卷调查走产品的接口,所以导致接口半路径不同
function BASEURL() { function BASEURL() {
// return "https://epdc-shibei.elinkservice.cn/epdc-api/api/" // 正式环境 return "https://epdc-shibei.elinkservice.cn/epdc-api/api/" // 正式环境
return "http://localhost:10994/epdc-api/api/" // return "http://localhost:10994/epdc-api/api/"
} }
// 获取 党群服务中心、需求清单、问卷调查 等模块的半路径 // 获取 党群服务中心、需求清单、问卷调查 等模块的半路径
function getProductionBaseUrl () { function getProductionBaseUrl () {

Loading…
Cancel
Save