调整验证码有效期提示和重发状态
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user