This commit is contained in:
Ling53666
2025-05-15 21:01:14 +08:00
parent 9b8553930b
commit 7c371623eb
35 changed files with 620 additions and 401 deletions

View File

@ -146,6 +146,39 @@ getcode(){
console.error('请求失败', err);
}
});
this.startCountdown();
},
startCountdown() {
this.setData({
isCountingDown: true,
countdown: 60
});
this.data.timer = setInterval(() => {
let count = this.data.countdown;
if (count <= 1) {
clearInterval(this.data.timer);
this.setData({
isCountingDown: false,
countdown: 60
});
} else {
this.setData({
countdown: count - 1
});
}
}, 1000);
},
onUnload() {
// 页面卸载时清除定时器
if (this.data.timer) {
clearInterval(this.data.timer);
}
},
back(){
wx.navigateTo({
url: '/pages/logain/logain',
})
}
})