diff --git a/pages/home/wallet.vue b/pages/home/wallet.vue index 559fdf9..5528715 100644 --- a/pages/home/wallet.vue +++ b/pages/home/wallet.vue @@ -27,7 +27,7 @@ 可提现金额 - + {{ $fen2yuan(money_obj?.withdrawAmount || 0) }} @@ -105,11 +105,30 @@ return list; }); + const withdrawChannelEnabled = computed(() => { + const channels = Array.isArray(tradeChannelList.value) ? tradeChannelList.value : []; + const exact = channels.find( + (it) => String(it?.channelName || it?.name || '').trim() === '去提现' + ); + if (exact) return Number(exact?.status) === 1; + const fuzzy = channels.find((it) => { + const name = String(it?.channelName || it?.name || '').trim(); + return name.includes('去提现'); + }); + if (fuzzy) return Number(fuzzy?.status) === 1; + const anyWithdrawLike = channels.find((it) => { + const name = String(it?.channelName || it?.name || '').trim(); + return name.includes('提现'); + }); + if (anyWithdrawLike) return Number(anyWithdrawLike?.status) === 1; + return !channels.length; + }); + const fetchTradeChannels = async () => { try { const res = await incrementApi.getTradeChannelList(); if (res?.code === 0 && Array.isArray(res?.data)) { - tradeChannelList.value = res.data.filter((it) => Number(it?.status) === 1); + tradeChannelList.value = res.data; } } catch (e) {} }; @@ -137,6 +156,13 @@ fetchTradeChannels(); }); //充值提现弹框提示去跳转 + function onWithdrawClick() { + showLiquidationMenu.value = false; + if (!withdrawChannelEnabled.value) { + return; + } + jumpPage('提现', '/pages/home/pay/withdraw'); + } function jumpPage(typeTxt, url) { showLiquidationMenu.value = false; uni.showModal({