封装提示弹框
This commit is contained in:
@ -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) {}
|
||||
},
|
||||
// 勾选同意
|
||||
|
Reference in New Issue
Block a user