zengh
2022-03-10 16fa6e007a0be0b8ed44134ef9a6a9aa76746980
1、手机号验证
2、积分商城提示研发中
2 files modified
49 ■■■■ changed files
pages/home/home.vue 9 ●●●● patch | view | raw | blame | history
pages/registerUser/registerUser.vue 40 ●●●● patch | view | raw | blame | history
pages/home/home.vue
@@ -246,6 +246,12 @@
                        type: 'warning',
                    })
                    return;
                }else if (index == 3) {
                    this.$refs.uToast.show({
                        title: '功能研发中',
                        type: 'warning',
                    })
                    return;
                } else {
                    uni.navigateTo({
                        url: url
@@ -278,7 +284,8 @@
                    method: 'GET',
                    data: {
                        current: this.page,
                        size: this.pagesize
                        size: this.pagesize,
                        rolename: this.$store.state.UserData.role_name
                    },
                    success: (res) => {
                        if (res.data.code == 200) {
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',