|
@ -183,17 +183,20 @@ |
|
|
}, |
|
|
}, |
|
|
getCode() { |
|
|
getCode() { |
|
|
if (this.$refs.code.canGetCode) { |
|
|
if (this.$refs.code.canGetCode) { |
|
|
// 模拟向后端请求验证码 |
|
|
|
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '正在获取验证码' |
|
|
title: '正在获取验证码' |
|
|
}) |
|
|
}) |
|
|
setTimeout(() => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
// 这里此提示会被this.start()方法中的提示覆盖 |
|
|
|
|
|
uni.$uv.toast('验证码已发送'); |
|
|
|
|
|
// 通知验证码组件内部开始倒计时 |
|
|
|
|
|
this.$refs.code.start(); |
|
|
|
|
|
}, 2000); |
|
|
|
|
|
|
|
|
this.$api('sendSms', { |
|
|
|
|
|
username: this.form1.userName, |
|
|
|
|
|
}, res => { |
|
|
|
|
|
if (res.code == 200) { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
// 这里此提示会被this.start()方法中的提示覆盖 |
|
|
|
|
|
uni.$uv.toast('验证码已发送'); |
|
|
|
|
|
// 通知验证码组件内部开始倒计时 |
|
|
|
|
|
this.$refs.code.start(); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
uni.$uv.toast('请勿重复发送'); |
|
|
uni.$uv.toast('请勿重复发送'); |
|
|
} |
|
|
} |
|
|