feat: 添加跳转链接、提现跳转实名认证
This commit is contained in:
@@ -92,6 +92,7 @@
|
||||
const smsCountdown = ref(0);
|
||||
const smsScene = 7;
|
||||
let smsTimer = null;
|
||||
const submitting = ref(false);
|
||||
|
||||
const sanitizeAmountInput = (val) => {
|
||||
let next = String(val ?? '').replace(/[^\d.]/g, '');
|
||||
@@ -136,6 +137,7 @@
|
||||
};
|
||||
|
||||
const submit = async () => {
|
||||
if (submitting.value) return;
|
||||
const amt = amountNumber.value;
|
||||
if (!amt) {
|
||||
sheep.$helper.toast('请输入去变现数量');
|
||||
@@ -154,12 +156,32 @@
|
||||
if (!mobile) return;
|
||||
const money = Math.round(amt * 100);
|
||||
const payload = { money, mobile, scene: smsScene, code: smsCode.value };
|
||||
const res = await incrementApi.walletLiquidation(payload).catch(() => ({ code: -1 }));
|
||||
if (res?.code === 0) {
|
||||
sheep.$helper.toast('变现成功,请等待审核');
|
||||
amount.value = '';
|
||||
smsCode.value = '';
|
||||
refreshWallet();
|
||||
submitting.value = true;
|
||||
try {
|
||||
const res = await incrementApi.walletLiquidation(payload).catch(() => ({ code: -1 }));
|
||||
if (res?.code === 0) {
|
||||
sheep.$helper.toast('变现成功,请等待审核');
|
||||
amount.value = '';
|
||||
smsCode.value = '';
|
||||
refreshWallet();
|
||||
return;
|
||||
}
|
||||
if (res?.code === 1006001000) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未实名认证,是否前往实名认证?',
|
||||
cancelText: '取消',
|
||||
confirmText: '去认证',
|
||||
success: (modalRes) => {
|
||||
if (!modalRes?.confirm) return;
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/realname',
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user