Commit 968f58e5 authored by wykolor's avatar wykolor

feat: 优化获取验证码

parent 4c213d5f
...@@ -210,16 +210,24 @@ const Withdraw = defineComponent({ ...@@ -210,16 +210,24 @@ const Withdraw = defineComponent({
async (res: TencentCaptchaResponse) => { async (res: TencentCaptchaResponse) => {
const { ret, randstr, ticket } = res; const { ret, randstr, ticket } = res;
if (ret === 0) { if (ret === 0) {
state.smsVerifyPass = true;
state.tencentCaptchPass = true; state.tencentCaptchPass = true;
countDown(60, 1000, (time: number) => { state.smsVerifyPass = true;
time === 0 ? (state.showTime = `获取验证码`) : (state.showTime = `${time} 后再获取`); try {
if (time === 0) { const { data } = await checkCaptcha({ randStr: randstr, ticket });
state.smsVerifyPass = false; Toast("发送验证码成功");
} state.mobileTip = data;
}); countDown(60, 1000, (time: number) => {
const { data } = await checkCaptcha({ randStr: randstr, ticket }); time === 0
state.mobileTip = data; ? (state.showTime = `获取验证码`)
: (state.showTime = `${time} 后再获取`);
if (time === 0) {
state.smsVerifyPass = false;
}
});
} catch {
Toast("发送验证码失败,请重试");
state.smsVerifyPass = false;
}
} }
}, },
{ {
...@@ -441,7 +449,7 @@ export default Withdraw; ...@@ -441,7 +449,7 @@ export default Withdraw;
.van-button { .van-button {
width: 220px; width: 220px;
height: 80px; height: 80px;
background: #027AFF; background: #027aff;
border-radius: 0px 8px 8px 0px; border-radius: 0px 8px 8px 0px;
font-size: 26px; font-size: 26px;
box-sizing: border-box; box-sizing: border-box;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment