liuyg
2022-03-11 3cd3f10c65f219955991138068b5176e9d67a54a
pages/registerUser/registerUser.vue
@@ -92,7 +92,7 @@
            //       return callback(new Error('手机号格式不正确'));
            //    }
            // }
            if (identity.test(value)) {
               this.form.carId = value;
               return true
@@ -101,7 +101,7 @@
            }
            // if (value.length > 11) {
            // }
         };
@@ -176,7 +176,7 @@
                  title: '手机号',
                  img: 'phone-fill',
                  froms: 'phone',
                  requireds: false,
                  requireds: true,
                  placeholder: '请输入真实手机号'
               },
               // {
@@ -256,6 +256,24 @@
                  required: true,
                  message: '请输入真实姓名',
                  // 可以单个或者同时写两个触发验证方式 
                  trigger: ['change', 'blur'],
               }],
               phone: [{
                  required: true,
                  message: '请输入正确的手机号',
                  // 可以单个或者同时写两个触发验证方式
                  trigger: ['change', 'blur'],
               }, {
                  validator: (rule, value, callback) => {
                     var phone = /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/;
                     if (phone.test(value)) {
                        this.form.phone = value;
                        return true
                     } else {
                        return callback(new Error('手机号格式不正确'));
                     }
                  },
                  trigger: ['change', 'blur'],
               }],
               jobUnit: [{
@@ -386,26 +404,26 @@
               return
            }
            var that = this;
            //判断是否必填警号和工作地点
            if(that.form.role == "民警"){
            if (that.form.role == "民警") {
               that.rules.signals[0].required = true;
            }
            if(that.jobValue == "有"){
            if (that.jobValue == "有") {
               that.rules.jobUnit[0].required = true;
               that.rules.xq[0].required = true;
            }
            that.$refs.uForm.validate(valid => {
               if (valid) {
                  that.registerEvent()
               }else{
               } else {
                  return
               }
            });
            uni.request({
               url: that.$store.state.piAPI + '/zc/inspect',
               method: 'GET',