60秒倒计时
2018-01-01 21:10 卢焓然 阅读(158) 评论(0) 收藏 举报if (!(/^1[34578]\d{9}$/.test(this.$refs.isPhoneNumber.value))) {
alert('请输入正确的手机号')
} else {
alert('短信已发,请尽快使用')
const TIME_COUNT = 60
if (!this.timer) {
this.count = TIME_COUNT
this.isReally = false
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= TIME_COUNT) {
this.count--
} else {
this.isReally = true
clearInterval(this.timer)
}
}, 1000)
}
}
浙公网安备 33010602011771号