增加提现审核中拦截

This commit is contained in:
2026-07-02 10:06:08 +08:00
parent 104e04a8cc
commit adde209c57
@@ -42,7 +42,12 @@
$ {{ (userInfo.commission / 100 || 0).toFixed(2) }}
</div>
</div>
<Button variant="ghost" class="hover:bg-transparent" @click="walletDialogRef?.show()">
<Button
variant="ghost"
class="hover:bg-transparent"
:disabled="isCheckingWithdrawal"
@click="handleWithdrawClick"
>
点击提现
</Button>
</div>
@@ -109,6 +114,7 @@ const inviteStats = ref({
history_count: 0,
})
const isUserLoading = ref(true)
const isCheckingWithdrawal = ref(false)
async function init() {
// 1. 用户信息 & 设备列表
isUserLoading.value = true
@@ -161,6 +167,29 @@ const referralText = computed(() => {
return `超级合伙人 返佣比例${percentage}%`
})
async function handleWithdrawClick() {
if (isCheckingWithdrawal.value) return
try {
isCheckingWithdrawal.value = true
const res: any = await request.get('/api/v1/public/user/withdrawal_log', {
page: 1,
size: 20,
})
const hasPendingWithdrawal = (res?.list || []).some((item: any) => item.status === 0)
if (hasPendingWithdrawal) {
toast.info('已有提现申请审核中,请勿重复提交')
return
}
walletDialogRef.value?.show()
} catch (error) {
console.error('Check withdrawal logs error:', error)
toast.error('提现记录检查失败,请稍后重试')
} finally {
isCheckingWithdrawal.value = false
}
}
function copy(text: string) {
navigator.clipboard.writeText(text).then(() => {
toast.success('已复制到剪贴板')