From f02f3f5c04f3cad60dc3b309f9315203ff0278e8 Mon Sep 17 00:00:00 2001 From: speakeloudest Date: Thu, 2 Jul 2026 10:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E5=85=A5=E9=A1=B5=E9=9D=A2=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=8F=90=E7=8E=B0=E5=AE=A1=E6=A0=B8=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UserCenter/components/UserInfo/index.vue | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/pages/UserCenter/components/UserInfo/index.vue b/src/pages/UserCenter/components/UserInfo/index.vue index d4c10f7..60fa99f 100644 --- a/src/pages/UserCenter/components/UserInfo/index.vue +++ b/src/pages/UserCenter/components/UserInfo/index.vue @@ -48,7 +48,7 @@ :disabled="isCheckingWithdrawal" @click="handleWithdrawClick" > - 点击提现 + {{ hasPendingWithdrawal ? '审核中' : '点击提现' }} @@ -115,6 +115,7 @@ const inviteStats = ref({ }) const isUserLoading = ref(true) const isCheckingWithdrawal = ref(false) +const hasPendingWithdrawal = ref(false) async function init() { // 1. 用户信息 & 设备列表 isUserLoading.value = true @@ -136,6 +137,8 @@ async function init() { request.get('/api/v1/public/user/invite/stats').then((res: any) => { inviteStats.value = res }) + + checkPendingWithdrawal() } onMounted(() => { @@ -168,23 +171,37 @@ const referralText = computed(() => { }) async function handleWithdrawClick() { + if (hasPendingWithdrawal.value) { + toast.info('已有提现申请审核中,请勿重复提交') + return + } if (isCheckingWithdrawal.value) return + const canWithdraw = await checkPendingWithdrawal(true) + if (canWithdraw) { + walletDialogRef.value?.show() + } +} + +async function checkPendingWithdrawal(showErrorToast = false) { 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) { + hasPendingWithdrawal.value = (res?.list || []).some((item: any) => item.status === 0) + if (hasPendingWithdrawal.value) { toast.info('已有提现申请审核中,请勿重复提交') - return + return false } - walletDialogRef.value?.show() + return true } catch (error) { console.error('Check withdrawal logs error:', error) - toast.error('提现记录检查失败,请稍后重试') + if (showErrorToast) { + toast.error('提现记录检查失败,请稍后重试') + } + return false } finally { isCheckingWithdrawal.value = false }