ソースを参照

登录新增身份证号码

谢杰标 2 年 前
コミット
cbe3b194f1
2 ファイル変更26 行追加1 行削除
  1. 22 1
      pages2/register/register.vue
  2. 4 0
      pages4/login/login.vue

+ 22 - 1
pages2/register/register.vue

@@ -41,6 +41,12 @@
               placeholder-style="color:#999999"
               placeholder="请输入登录密码"
           /></u-form-item>
+          <u-form-item prop="idcard"
+            ><u-input
+              v-model="form.idcard"
+              placeholder-style="color:#999999"
+              placeholder="请输入身份证号码"
+          /></u-form-item>
         </u-form>
       </view>
       <view style="margin: 30rpx 0">
@@ -631,6 +637,20 @@ export default {
             trigger: ["change"],
           },
         ],
+        idcard: [
+          {
+            required: true,
+            message: "请输入身份证号",
+            trigger: ["change", "blur"],
+          },
+          {
+          	validator: (rule, value, callback) => {
+          		return this.$u.test.idCard(value);
+          	},
+          	message: '身份证号不正确',
+          	trigger: ['change', 'blur']
+          }
+        ],
       },
       isUse: false,
       isBack: false,
@@ -669,6 +689,7 @@ export default {
             tel: this.form.tel,
             code: this.form.code,
             pwd: this.form.pwd,
+            idcard: this.form.idcard
           };
           if (uni.getStorageSync("newUser_sc")) {
             datas["shareCode"] = uni.getStorageSync("newUser_sc");
@@ -857,7 +878,7 @@ export default {
 }
 .login_box {
   width: 100%;
-  height: 500rpx;
+  height: 580rpx;
   background: #ffffff;
   box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(1, 99, 235, 0.1);
   border-radius: 24rpx;

+ 4 - 0
pages4/login/login.vue

@@ -275,6 +275,10 @@ export default {
           shareActivityCode: this.shareActivityCode,
         })
         .then((res) => {
+          if(res.data.code == 666){
+            this.toRegister()
+            return 
+          }
           if (res.data.code == 200) {
             this.loginCallback(res, "wxlogin");
           } else {