uni-app 验证码倒计时

2020-07-16  本文已影响0人  Jeex

手机验证码倒计时

getCurrentDown: function () {
    // this.showText = false;
    this.GetPhoneBtn =true;
    var interval = setInterval(() => {
      --this.second;
      this..codeText = this.second +'s重新获取'
    }, 1000)
    setTimeout(() => {
        clearInterval(interval)
        this.GetPhoneBtn = false;
        this.second = 60;
        this.codeText = '获取验证码'
     }, 60000)
},
上一篇 下一篇

猜你喜欢

热点阅读