startSetInter: function () {
var that = this;
var times = 60
var i = setInterval(function () {
times--
if (times > 0) {
that.setData({
codeDisabled: true,
codeMsg: "重新获取" + times + "s",
})
} else {
clearInterval(i)
that.setData({
codeMsg: "重新获取验证码",
codeDisabled: false
})
}
}, 1000)
},
微信小程序获取验证码倒计时功能
最新推荐文章于 2021-09-13 13:59:17 发布