heyujie
2022-01-26 7656962ded2a6ccbe3eae75304b3789662d82711
src/pages/desktop/index/components/Desktop.vue
@@ -78,7 +78,7 @@
          </el-form>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button @click="activeDialog = false">取消</el-button>
          <el-button @click="cancelLogin">取消</el-button>
          <el-button type="primary" @click="loginShop">确定</el-button>
        </span>
      </el-dialog>
@@ -221,8 +221,9 @@
  data() {
    return {
      showFreeVersion: false,
      activeDialog: false,
      countdown: 60,innerDialog: false,
      activeDialog: true,
      countdown: 60,
      innerDialog: false,
      version: "SmartAI试用版",
      codeMsg: "获取验证码",
      versionState: "尚未激活",
@@ -270,24 +271,40 @@
        }
      }
    },
    loginShop(){
      loginShopInSmart({
        phoneNum:this.phone.phoneNum,
        verifyCode
      })
    loginShop() {
      // this.innerDialog = true
      //   this.activeDialog=false
      this.$refs["phoneLogin"].validate((valid) => {
        if (valid) {
          let param = {
            phoneNum: this.phone.phoneNum,
            verifyCode: this.phone.verifyCode,
          };
          loginShopInSmart(param).then((res) => {
            this.innerDialog = true;
            this.activeDialog = false;
          });
        } else {
          this.nullRule = {};
        }
      });
    },
    cancelLogin(){
      this.innerVisible= false
    },
    // 获取验证码
    getCode() {
      // 验证码60秒倒计时
      var pattern = /^1[345789]\d{9}$/;
      if (this.phone.phoneNum == "") {
        this.$refs['phoneLogin'].fields[0].validateMessage = "请输入手机号";
        this.$refs['phoneLogin'].fields[0].validateState = "error";
        this.$refs["phoneLogin"].fields[0].validateMessage = "请输入手机号";
        this.$refs["phoneLogin"].fields[0].validateState = "error";
        return;
      }
      if (!pattern.test(this.phone.phoneNum)) {
        this.$refs['phoneLogin'].fields[0].validateMessage = "手机号码格式有误";
        this.$refs['phoneLogin'].fields[0].validateState = "error";
        this.$refs["phoneLogin"].fields[0].validateMessage = "手机号码格式有误";
        this.$refs["phoneLogin"].fields[0].validateState = "error";
        return;
      }
      if (!this.timer) {
@@ -299,8 +316,8 @@
            this.gotCode = true;
          })
          .catch((err) => {
            this.$refs['phoneLogin'].fields[0].validateMessage = err.data.msg;
            this.$refs['phoneLogin'].fields[0].validateState = "error";
            this.$refs["phoneLogin"].fields[0].validateMessage = err.data.msg;
            this.$refs["phoneLogin"].fields[0].validateState = "error";
          });
      }
    },