feat: 提现添加权限配置

This commit is contained in:
2026-09-28 14:00:26 +08:00
parent 6d2f1c4fdb
commit 4b0aab8a51
+28 -2
View File
@@ -27,7 +27,7 @@
<view class="line" />
<view class="flex m-t-22 withdraw_row">
<view class="title"> 可提现金额 </view>
<view class="num m-l-34" @click="jumpPage('提现', '/pages/home/pay/withdraw')">
<view class="num m-l-34" @click="onWithdrawClick">
{{ $fen2yuan(money_obj?.withdrawAmount || 0) }}
</view>
</view>
@@ -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({