qingyiay
2023-12-25 aef949a659d073443e81f22686b44bd440a69a0e
pages/login/resetPassword/resetPassword.vue
@@ -73,28 +73,67 @@
            },
            processLoading: false,
            rules: {
               password: {
                  type: 'string',
                  required: true,
                  message: '请填写密码',
                  trigger: ['blur', 'change']
               },
               secondPassword: {
                  type: 'string',
                  required: true,
                  message: '请填写二次密码',
                  trigger: ['blur', 'change']
               }
               password: [{
                     type: 'string',
                     required: true,
                     message: '请填写密码',
                     trigger: ['blur', 'change']
                  },
                  {
                     min: 2,
                     max: 10,
                     message: '密码长度应不小于2位,不大于10位  ',
                     trigger: ['blur', 'change']
                  },
                  {
                     pattern: /^[a-zA-Z0-9_]+$/,
                     message: '请输入正确格式的密码',
                     trigger: ['blur', 'change']
                  }
               ],
               secondPassword: [{
                     type: 'string',
                     required: true,
                     message: '请填写二次密码',
                     trigger: ['blur', 'change']
                  },
                  {
                     min: 2,
                     max: 10,
                     message: '密码长度应不小于2,不大于10',
                     trigger: ['blur', 'change']
                  }
               ]
            }
         }
      },
      computed: {
         roleType() {
            return uni.getStorageSync('roleType')
         }
      },
      onLoad(params) {
         this.userInfo = JSON.parse(params.userInfo)
         if (this.roleType === 3) {
            this.userInfo = JSON.parse(params.userInfo)
         } else {
            this.getUserInfo(params.phone, params.idCard)
         }
      },
      onReady() {
         this.$refs.uForm.setRules(this.rules)
      },
      methods: {
         getUserInfo(phone, idCard) {
            this.$reqGet('phoneAndCard', { phone, idCard }).then(res => {
               if (res.code === 0) {
                  this.userInfo = res.data
               } else {
                  uni.$u.toast('加载失败')
               }
            })
         },
         checkChange(name) {
            this.inputType = name.length === 0 ? 'password' : ''
            this.isFocus = true