|
|
|
@ -535,26 +535,21 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log(12)
|
|
|
|
|
|
|
|
// 2. 防止重复点击(倒计时中)
|
|
|
|
// 2. 防止重复点击(倒计时中)
|
|
|
|
if (this.smsCountdown > 0) {
|
|
|
|
if (this.smsCountdown > 0) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log(34)
|
|
|
|
|
|
|
|
// 3. 调用发送接口
|
|
|
|
// 3. 调用发送接口
|
|
|
|
uni.showLoading({
|
|
|
|
uni.showLoading({
|
|
|
|
title: '发送中...'
|
|
|
|
title: '发送中...'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
console.log(56)
|
|
|
|
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
data: res
|
|
|
|
data: res
|
|
|
|
} = await uni.$http.post('/sms/sendCode', {
|
|
|
|
} = await uni.$http.post('/sms/sendCode', {
|
|
|
|
phone: phone
|
|
|
|
phone: phone
|
|
|
|
});
|
|
|
|
});
|
|
|
|
console.log(78)
|
|
|
|
|
|
|
|
uni.hideLoading();
|
|
|
|
uni.hideLoading();
|
|
|
|
console.log(9)
|
|
|
|
|
|
|
|
if (res && res.code === 200) {
|
|
|
|
if (res && res.code === 200) {
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
title: '验证码已发送',
|
|
|
|
title: '验证码已发送',
|
|
|
|
@ -563,6 +558,15 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
// 开始倒计时
|
|
|
|
// 开始倒计时
|
|
|
|
this.startCountdown();
|
|
|
|
this.startCountdown();
|
|
|
|
|
|
|
|
} else if (res && res.code === 201) {
|
|
|
|
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
|
|
|
|
title: '验证码已发送',
|
|
|
|
|
|
|
|
type: 'success',
|
|
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// 开始倒计时
|
|
|
|
|
|
|
|
this.startCountdown();
|
|
|
|
|
|
|
|
this.form.smsCode=res.data
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
title: res.msg || '发送失败,请重试',
|
|
|
|
title: res.msg || '发送失败,请重试',
|
|
|
|
|