pages/login/supplier-login.vue
@@ -22,7 +22,7 @@
               </view>
               <view class="t-a input form-input" v-if="loginType=='pwd'">
                  <!-- <input type="text" name="userName" placeholder="请输入账号" v-model="userName" /> -->
                  <u-input placeholder="请输入账号" :border="false" v-model="userName"></u-input>
                  <u-input placeholder="请输入账号" :border="false" v-model="userName" @blur="validatePhoneNumber()"></u-input>
               </view>
               <view class="t-a input form-input" v-if="loginType=='pwd'">
@@ -31,7 +31,7 @@
               <view class="t-a input form-input" v-if="loginType=='code'">
                  <u-input placeholder="请输入手机号" :border="false" v-model="phoneNumber">
                  <u-input placeholder="请输入手机号" :border="false" v-model="phoneNumber" @blur="validatePhoneNumber()">
                     <template slot="suffix">
                        <view class="get-code" :style="{'color':getCodeBtnColor}" @click.stop="getCode()">
                           {{ getCodeText }}
@@ -385,7 +385,7 @@
            getCodeText: '获取验证码',
            getCodeBtnColor: "#20613D",
            getCodeisWaiting: false,
            Timer: undefined,
            Timer: undefined,
            protocal:false,
            // #ifdef PUB_SUPPLIER
            apitype: 'loginSupplier',
@@ -400,6 +400,23 @@
         };
      },
      methods: {
            // 手机号码正则表达式校验
            validatePhoneNumber() {
                // 手机号码正则表达式,可以根据需要调整
                const phoneRegex = /^[1][3-9][0-9]{9}$/;
                if (this.loginType == 'pwd') {
                    if (!phoneRegex.test(this.userName)) {
                        this.$message.showToast('请填写正确手机号码')
                    }
                }
                if (this.loginType == 'code') {
                    if (!phoneRegex.test(this.phoneNumber)) {
                        this.$message.showToast('请填写正确手机号码')
                    }
                }
            },
         async getCode() {
            console.log('getCode')
            uni.hideKeyboard() //隐藏已经显示的软键盘,如果软键盘没有显示则不做任何操作。
@@ -499,10 +516,10 @@
         changeAll(e) {
            this.pcfvalue = e.detail.value[0]
         },
         async login() {
            if(!this.protocal){
               this.$message.showToast('请同意用户协议')
               return
         async login() {
            if(!this.protocal){
               this.$message.showToast('请同意用户协议')
               return
            }
            uni.showLoading({
               title: '登陆中'