feat(withdraw): 后台支持提现总开关与方式过滤并升级钱包与提现页面体验
这个提交包含在:
@@ -7,7 +7,6 @@
|
||||
<view class="card-top ss-flex ss-row-between ss-col-center">
|
||||
<view class="top-tag ss-flex ss-col-center">
|
||||
<text class="tag-badge">现金资产</text>
|
||||
<text class="top-title">账户钱包余额</text>
|
||||
</view>
|
||||
<view
|
||||
class="eye-btn ss-flex ss-col-center"
|
||||
@@ -29,23 +28,15 @@
|
||||
<text class="hero-unit">元</text>
|
||||
</view>
|
||||
<button
|
||||
v-if="state.canWithdraw"
|
||||
class="ss-reset-button topup-btn ss-flex ss-row-center ss-col-center"
|
||||
@tap="sheep.$router.go('/pages/pay/recharge')"
|
||||
@tap="onWithdraw"
|
||||
>
|
||||
<text class="cicon-moneybag ss-m-r-6"></text>
|
||||
<text>充值</text>
|
||||
<text>提现</text>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<!-- 动态指示胶囊 -->
|
||||
<view class="rate-capsule ss-flex ss-row-between ss-col-center">
|
||||
<view class="capsule-left ss-flex ss-col-center">
|
||||
<text class="capsule-dot"></text>
|
||||
<text class="capsule-text">线上充值与收益分成全额入账 · 下单直接抵扣</text>
|
||||
</view>
|
||||
<text class="capsule-tag">即时可用</text>
|
||||
</view>
|
||||
|
||||
<!-- 底部数据栏:当前周期总收入 / 总支出 -->
|
||||
<view class="card-footer ss-flex ss-row-between ss-col-center">
|
||||
<view class="footer-metric">
|
||||
@@ -173,6 +164,7 @@
|
||||
|
||||
const state = reactive({
|
||||
showMoney: true,
|
||||
canWithdraw: false,
|
||||
date: [],
|
||||
currentTab: 0,
|
||||
pagination,
|
||||
@@ -210,6 +202,32 @@
|
||||
}
|
||||
});
|
||||
|
||||
async function checkWithdrawStatus() {
|
||||
try {
|
||||
const appStore = sheep.$store('app');
|
||||
if (appStore?.platform && typeof appStore.platform.withdraw_status === 'boolean') {
|
||||
state.canWithdraw = appStore.platform.withdraw_status;
|
||||
}
|
||||
const res = await sheep.$api.pay.withdraw.rules();
|
||||
if (res?.code === 1 && res.data) {
|
||||
const isOpen = (res.data.status === undefined || Number(res.data.status) === 1)
|
||||
&& Array.isArray(res.data.methods)
|
||||
&& res.data.methods.length > 0;
|
||||
state.canWithdraw = Boolean(isOpen);
|
||||
}
|
||||
} catch (e) {
|
||||
state.canWithdraw = false;
|
||||
}
|
||||
}
|
||||
|
||||
function onWithdraw() {
|
||||
if (!state.canWithdraw) {
|
||||
sheep.$helper.toast('暂未开启提现功能');
|
||||
return;
|
||||
}
|
||||
sheep.$router.go('/pages/pay/withdraw');
|
||||
}
|
||||
|
||||
async function getLogList(page = 1, list_rows = 10) {
|
||||
state.loadStatus = 'loading';
|
||||
try {
|
||||
@@ -239,11 +257,13 @@
|
||||
state.today = dayjs().format('YYYY-MM-DD');
|
||||
state.date = [state.today, state.today];
|
||||
sheep.$store('user').getInfo();
|
||||
checkWithdrawStatus();
|
||||
getLogList(1);
|
||||
});
|
||||
|
||||
onPullDownRefresh(async () => {
|
||||
await sheep.$store('user').getInfo();
|
||||
await checkWithdrawStatus();
|
||||
await getLogList(1);
|
||||
uni.stopPullDownRefresh();
|
||||
});
|
||||
@@ -318,14 +338,6 @@
|
||||
padding: 4rpx 14rpx;
|
||||
border-radius: 8rpx;
|
||||
font-weight: 600;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.top-title {
|
||||
font-size: 26rpx;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-weight: 400;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,39 +405,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* 胶囊指示栏 */
|
||||
.rate-capsule {
|
||||
margin-top: 24rpx;
|
||||
background: rgba(244, 211, 151, 0.1);
|
||||
border: 1rpx solid rgba(244, 211, 151, 0.22);
|
||||
border-radius: 12rpx;
|
||||
padding: 14rpx 20rpx;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
.capsule-left {
|
||||
.capsule-dot {
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #eabf76;
|
||||
margin-right: 12rpx;
|
||||
box-shadow: 0 0 8rpx #eabf76;
|
||||
}
|
||||
|
||||
.capsule-text {
|
||||
font-size: 24rpx;
|
||||
color: #fce8bf;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.capsule-tag {
|
||||
font-size: 20rpx;
|
||||
color: #f7d598;
|
||||
opacity: 0.85;
|
||||
}
|
||||
}
|
||||
|
||||
/* 底部收支汇总栏 */
|
||||
.card-footer {
|
||||
|
||||
在新工单中引用
屏蔽一个用户