封装提示弹框

This commit is contained in:
fengerli
2025-07-24 10:05:17 +08:00
parent c0a9c0b3f2
commit 51ab4d0bfa
9 changed files with 307 additions and 144 deletions

View File

@ -91,25 +91,33 @@
return false;
}
try {
await resourceSmsCode({
const res = await resourceSmsCode({
phonenumber: this.phone
})
// 更新倒计时状态
this.isCounting = true;
this.showView = true;
this.countdown = 60
const timer = setInterval(() => {
this.countdown--
if (this.countdown <= 0) {
clearInterval(timer)
this.isCounting = false;
this.showView = false;
}
}, 1000)
uni.showToast({
title: '验证码已发送',
icon: 'none'
})
if (res.code == 200) {
// 更新倒计时状态
this.isCounting = true;
this.showView = true;
this.countdown = 60
const timer = setInterval(() => {
this.countdown--
if (this.countdown <= 0) {
clearInterval(timer)
this.isCounting = false;
this.showView = false;
}
}, 1000)
uni.showToast({
title: '验证码已发送',
icon: 'none'
})
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
} catch (error) {}
},
// 勾选同意