微信小程序获取验证码倒计时

    xiaoxiao2021-03-25  99

    var that = this var count = 60; var re=/^1[3|4|5|7|8][0-9]\d{4,8}$/; if(!re.test(that.data.mobile)) { wx.showModal({ title: "请输入正确的手机号" }); return false; }else{ if(that.data.isdisable==false){ that.sendcode() wx.showModal({ title: "发送成功" }); var timer = setInterval(function () { count--; if (count >= 1) { that.setData({ verifyInfo: count + 's' }) } else { that.setData({ verifyInfo: '获取验证码' }) clearInterval(timer); that.data.isdisable = false; } }, 1000); that.data.isdisable = true; } }
    转载请注明原文地址: https://ju.6miu.com/read-10105.html

    最新回复(0)