Browse Source

增加对身份证号码的校验规则

master
453530270@qq.com 3 years ago
parent
commit
6637408a57
  1. 2
      pages/home.vue
  2. 1
      pages/login/index.vue
  3. 6
      pages/verfiy/index.vue

2
pages/home.vue

@ -298,7 +298,7 @@
// height: 460rpx; // height: 460rpx;
height: 28vh; height: 28vh;
width: 100%; width: 100%;
padding: 10%; padding: 10% 10% 12%;
// margin-bottom: 22rpx; // margin-bottom: 22rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;

1
pages/login/index.vue

@ -203,6 +203,7 @@ import { checkLogin, showError } from '@/core/app'
width: 66rpx; width: 66rpx;
height: 100%; height: 100%;
select{ select{
font-size: 32rpx; font-size: 32rpx;
border: none; border: none;

6
pages/verfiy/index.vue

@ -139,6 +139,12 @@
this.$toast('手机号持有人身份证号') this.$toast('手机号持有人身份证号')
return false return false
} }
//
let regIdNo = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if(!regIdNo.test(str)){
this.$toast('身份证号填写错误');
return false;
}
if(str.length<18 || str.length>18){ if(str.length<18 || str.length>18){
this.$toast("手机号持有人身份证号异常") this.$toast("手机号持有人身份证号异常")
return false return false

Loading…
Cancel
Save