获取验证码倒计时
return{
second:120
}
getCodeFn() {
let flag = true;
if (this.user.phone == '' || this.$http.isPhone(this.user.phone) == false) {
this.$http.showTK({ title: '手机号为空或者验证错误', duration: 800 });
return;
} else {
if (this.flag) {
this.flag = false;
let time = setInterval(() => {
this.second--;
if (this.second < 0) {
this.second = '获取验证码';
this.flag = true;
this.second = 120;
clearInterval(time);
return;
}
}, 1000);
}
}
},