Compare commits
4 Commits
104e04a8cc
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 70f4f97d53 | |||
| 013dfb4bee | |||
| f02f3f5c04 | |||
| adde209c57 |
@@ -176,7 +176,7 @@ const videoRef = ref<HTMLVideoElement | null>(null)
|
|||||||
const openVideoModal = () => {
|
const openVideoModal = () => {
|
||||||
videoModalVisible.value = true
|
videoModalVisible.value = true
|
||||||
}
|
}
|
||||||
|
// console.log('11')
|
||||||
const handleVideoModalClose = () => {
|
const handleVideoModalClose = () => {
|
||||||
if (videoRef.value) {
|
if (videoRef.value) {
|
||||||
videoRef.value.pause()
|
videoRef.value.pause()
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 176 KiB |
@@ -42,8 +42,13 @@
|
|||||||
$ {{ (userInfo.commission / 100 || 0).toFixed(2) }}
|
$ {{ (userInfo.commission / 100 || 0).toFixed(2) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button variant="ghost" class="hover:bg-transparent" @click="walletDialogRef?.show()">
|
<Button
|
||||||
点击提现
|
variant="ghost"
|
||||||
|
class="hover:bg-transparent"
|
||||||
|
:disabled="isCheckingWithdrawal"
|
||||||
|
@click="handleWithdrawClick"
|
||||||
|
>
|
||||||
|
{{ hasPendingWithdrawal ? '审核中' : '点击提现' }}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -109,6 +114,8 @@ const inviteStats = ref({
|
|||||||
history_count: 0,
|
history_count: 0,
|
||||||
})
|
})
|
||||||
const isUserLoading = ref(true)
|
const isUserLoading = ref(true)
|
||||||
|
const isCheckingWithdrawal = ref(false)
|
||||||
|
const hasPendingWithdrawal = ref(false)
|
||||||
async function init() {
|
async function init() {
|
||||||
// 1. 用户信息 & 设备列表
|
// 1. 用户信息 & 设备列表
|
||||||
isUserLoading.value = true
|
isUserLoading.value = true
|
||||||
@@ -130,6 +137,8 @@ async function init() {
|
|||||||
request.get('/api/v1/public/user/invite/stats').then((res: any) => {
|
request.get('/api/v1/public/user/invite/stats').then((res: any) => {
|
||||||
inviteStats.value = res
|
inviteStats.value = res
|
||||||
})
|
})
|
||||||
|
|
||||||
|
checkPendingWithdrawal()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@@ -161,6 +170,43 @@ const referralText = computed(() => {
|
|||||||
return `超级合伙人 返佣比例${percentage}%`
|
return `超级合伙人 返佣比例${percentage}%`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
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,
|
||||||
|
})
|
||||||
|
hasPendingWithdrawal.value = (res?.list || []).some((item: any) => item.status === 0)
|
||||||
|
if (hasPendingWithdrawal.value) {
|
||||||
|
toast.info('已有提现申请审核中,请勿重复提交')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Check withdrawal logs error:', error)
|
||||||
|
if (showErrorToast) {
|
||||||
|
toast.error('提现记录检查失败,请稍后重试')
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
} finally {
|
||||||
|
isCheckingWithdrawal.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function copy(text: string) {
|
function copy(text: string) {
|
||||||
navigator.clipboard.writeText(text).then(() => {
|
navigator.clipboard.writeText(text).then(() => {
|
||||||
toast.success('已复制到剪贴板')
|
toast.success('已复制到剪贴板')
|
||||||
|
|||||||
Reference in New Issue
Block a user