qingyiay
2023-08-14 76c41f4669a36b0d4cb5b82906419408a6b7de96
pages/login/userPassword.vue
@@ -7,7 +7,7 @@
               clearable
               maxlength="32"
               type="text"
               placeholder="请输入用户名"
               placeholder="请输入手机号"
               prefixIcon="account"
               prefixIconStyle="font-size: 22px;color: #909399"
            ></u--input>
@@ -43,9 +43,10 @@
   },
   data() {
      return {
         // username: '12222222222', // 客户
         username: '13333333332',// 司机
         password: '123456',
         username: '', // 客户
         // username:'13333333331',//货代
         // username: '13333333332',// 司机
         password: '',
         remember: true,
         baseUrl: ''
      };
@@ -86,7 +87,7 @@
                     //查询用户详细信息并储存
                     this.$reqGet('getUserEntity')
                        .then(res => {
                           this.$u.toast('恭喜您,登录成功!');
                           this.$u.toast('登录成功');
                           this.setUserTabbar(res.data.type);
                           uni.setStorageSync('roleType', res.data.type);
                           setCustomerId(res.data.customerid);
@@ -106,17 +107,26 @@
                     this.$u.toast(res.msg);
                  }
               } else {
                  this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('openid') }, 'params').then(res => {
                     uni.hideLoading();
                     if (res.code == 0) {
                        this.$u.toast('绑定成功!即将回到登录页!');
                        setTimeout(() => {
                           uni.navigateBack();
                        }, 1000);
                     } else {
                        this.$u.toast(res.msg ? res.msg : '绑定失败');
                  uni.login({
                     success: res => {
                        if (res.code) {
                           uni.setStorageSync('bindcode', res.code);
                        }
                     }
                  });
                  if (uni.getStorageSync('bindcode')) {
                     this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('bindcode') }, 'params').then(res => {
                        uni.hideLoading();
                        if (res.code == 0) {
                           this.$u.toast('绑定成功!即将回到登录页!');
                           setTimeout(() => {
                              uni.navigateBack();
                           }, 1000);
                        } else {
                           this.$u.toast(res.msg ? res.msg : '绑定失败');
                        }
                     });
                  }
               }
            })
            .catch(e => {