yangan
2024-12-09 4bb06192ef938fdaa6d7d7e8f039d9b0f54d604d
pages/register/register.vue
@@ -322,6 +322,28 @@
          callback();
        }
      };
     //验证最大总重不能超过车货载重
     const maxVstotalFun1 = (rule, value, callback) =>{
      console.log('触发',this.registerFormModel.maximumPayload  ,this.registerFormModel.totalLoad,this.registerFormModel.maximumPayload  <= this.registerFormModel.totalLoad)
      if(!value || !this.registerFormModel.maximumPayload)callback()
      if(Number(value)   >= Number(this.registerFormModel.maximumPayload)){
         callback()
      }else{
         callback(new Error("车货总重不能小于最大载重"))
      }
     }
     const maxVstotalFun2 = (rule, value, callback) =>{
      console.log('触发',this.registerFormModel.maximumPayload  ,this.registerFormModel.totalLoad,this.registerFormModel.maximumPayload  <= this.registerFormModel.totalLoad)
      if(!value || !this.registerFormModel.totalLoad)callback()
      if(Number(value)   <= Number(this.registerFormModel.totalLoad)){
         callback()
      }else{
         callback(new Error("最大载重不能超过车货总重"))
      }
     }
      const checkPassword = (rule, value, callback) => {
        // let roles = this.$store.getters.roles;//当前用户角色id
        // let passL = 8;
@@ -345,7 +367,7 @@
        const regex2 = /^[A-Za-z]+$/
        // 校验符号
        const regex3 =
            /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]+$/
            /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]+$/;
        if(regex1.test(value)) {
          this.level.push('low')
          return callback('密码强度过低')
@@ -543,13 +565,15 @@
               maximumPayload: {
                  type: 'number',
                  required: true,
                  message: '请输入最大载重',
                  // message: '请输入最大载重',
                  validator: maxVstotalFun2,
                  trigger: ['blur', 'change']
               },
               totalLoad:{
                  type: 'number',
                  required: true,
                  message: '请输入车货总重',
                  // message: '请输入车货总重',
                  validator: maxVstotalFun1,
                  trigger: ['blur', 'change']
               }
            },
@@ -647,7 +671,7 @@
        this.$refs.regesterFormRef
            .validate()
            .then(res => {
           if(this.registerFormModel.totalLoad<=this.registerFormModel.maximumPayload){
           if(this.radiovalue1 === '司机' &&  this.registerFormModel.totalLoad<=this.registerFormModel.maximumPayload){
               uni.showToast({
                        title: '车货总重需要大于最大载重',
                        icon: 'none',