<script>
export default{
data() {
return{
count:0
}
},
methods:{
getcode() {
//倒计时
const TIME_COUNT = 59;
if (!this.timer) {
this.count = TIME_COUNT;
this.getCodeStatue = 1;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= TIME_COUNT) {
this.count--;
} else {
this.getCodeStatue = 2;
clearInterval(this.timer);
this.timer = null;
}
}, 1000);
}
}
}
}
</script>