调整验证码有效期提示和重发状态

This commit is contained in:
2026-09-16 10:47:01 +08:00
parent e8e8e5a404
commit 5288dbf9b0
4 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -18,6 +18,7 @@ Page({
loading: false,
codeLoading: false,
countdown: 0,
codeSent: false,
countdownTimer: null,
agreementAccepted: false
},
@@ -58,7 +59,7 @@ Page({
if (!PHONE_REGEX.test(phone)) { wx.showToast({ title: '请输入正确手机号', icon: 'none' }); return }
if (this.data.codeLoading || this.data.countdown > 0) return
this.setData({ codeLoading: true })
try { await authApi.sendCode(phone); wx.showToast({ title: '验证码已发送' }); this.startCountdown() } catch (error) { wx.showToast({ title: error.message || '发送失败', icon: 'none' }) } finally { this.setData({ codeLoading: false }) }
try { await authApi.sendCode(phone); wx.showToast({ title: '验证码已发送' }); this.setData({ codeSent: true }); this.startCountdown() } catch (error) { wx.showToast({ title: error.message || '发送失败', icon: 'none' }) } finally { this.setData({ codeLoading: false }) }
},
continueFromPhone() {