feat: 收益全额直入商城余额、存量结转与奖项名称全局规范化对齐
这个提交包含在:
@@ -10,7 +10,7 @@
|
||||
<view class="asset-line"></view>
|
||||
<view class="asset-item">
|
||||
<view class="asset-label">可用兑换券</view>
|
||||
<view class="asset-val text-red">¥ {{ userVoucherAvailable }}</view>
|
||||
<view class="asset-val text-red">{{ userVoucherAvailable }} 个</view>
|
||||
</view>
|
||||
<button class="ss-reset-button earn-btn" @tap="sheep.$router.go('/pages/commission/voucher')">
|
||||
券明细
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
></uni-icons>
|
||||
</button>
|
||||
</view>
|
||||
<view class="ss-flex" @tap="sheep.$router.go('/pages/user/wallet/commission')">
|
||||
<view class="ss-flex" @tap="sheep.$router.go('/pages/commission/rewards')">
|
||||
<view class="header-title ss-m-r-4">查看明细</view>
|
||||
<text class="cicon-play-arrow"></text>
|
||||
</view>
|
||||
@@ -26,20 +26,20 @@
|
||||
<view class="metric-row ss-flex">
|
||||
<view
|
||||
class="ss-flex-1 ss-flex-col ss-col-center metric-item"
|
||||
@tap="sheep.$router.go('/pages/user/wallet/commission')"
|
||||
@tap="sheep.$router.go('/pages/commission/rewards')"
|
||||
>
|
||||
<view class="item-title">累计收益(元)</view>
|
||||
<view class="item-detail">
|
||||
{{ state.showMoney ? agentInfo?.total_income || '0.00' : '***' }}
|
||||
{{ state.showMoney ? agentInfo?.total_income || userInfo?.total_income || '0.00' : '***' }}
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="ss-flex-1 ss-flex-col ss-col-center metric-item"
|
||||
@tap="sheep.$router.go('/pages/user/wallet/commission')"
|
||||
@tap="sheep.$router.go('/pages/user/wallet/money')"
|
||||
>
|
||||
<view class="item-title">可提现(元)</view>
|
||||
<view class="item-title">商城余额(元)</view>
|
||||
<view class="item-detail">
|
||||
{{ state.showMoney ? userInfo?.commission || '0.00' : '***' }}
|
||||
{{ state.showMoney ? userInfo?.money || '0.00' : '***' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -61,7 +61,7 @@
|
||||
class="ss-flex-1 ss-flex-col ss-col-center metric-item"
|
||||
@tap="sheep.$router.go('/pages/commission/voucher')"
|
||||
>
|
||||
<view class="item-title">可用兑换券(元)</view>
|
||||
<view class="item-title">可用兑换券(个)</view>
|
||||
<view class="item-detail">
|
||||
{{
|
||||
state.showMoney
|
||||
|
||||
@@ -143,8 +143,8 @@
|
||||
title: '收益奖励已暂停',
|
||||
badge: '暂缓计奖',
|
||||
btnText: '去选购恢复',
|
||||
tip: '次日完成任意一笔本人自购订单即可自动恢复保活',
|
||||
lastOrderText: lastTime > 0 ? `上次自购: ${dayjs(lastTime * 1000).format('MM-DD HH:mm')}` : '暂无自购记录',
|
||||
tip: '完成任意一笔自购或直推订单即可自动恢复保活',
|
||||
lastOrderText: lastTime > 0 ? `上次有效订单: ${dayjs(lastTime * 1000).format('MM-DD HH:mm')}` : '暂无有效订单记录',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -164,8 +164,8 @@
|
||||
title: '收益奖励已暂停',
|
||||
badge: '暂缓计奖',
|
||||
btnText: '去选购恢复',
|
||||
tip: '近30日暂无本人自购,次日下单后即可自动激活',
|
||||
lastOrderText: lastTime > 0 ? `上次自购: ${dayjs(lastTime * 1000).format('MM-DD HH:mm')}` : '',
|
||||
tip: '近30日暂无自购或直推订单,完成下单后即可自动激活',
|
||||
lastOrderText: lastTime > 0 ? `上次有效订单: ${dayjs(lastTime * 1000).format('MM-DD HH:mm')}` : '',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -175,8 +175,8 @@
|
||||
title: '30天保活临期预警',
|
||||
badge: `仅剩 ${remainingDays} 天`,
|
||||
btnText: '立即自购保活',
|
||||
tip: '即将暂停分润!请在倒计时结束前完成自购续期',
|
||||
lastOrderText: lastTime > 0 ? `上次自购: ${dayjs(lastTime * 1000).format('MM-DD HH:mm')}` : '',
|
||||
tip: '即将暂停分润!请在倒计时结束前完成自购或直推续期',
|
||||
lastOrderText: lastTime > 0 ? `上次有效订单: ${dayjs(lastTime * 1000).format('MM-DD HH:mm')}` : '',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -185,8 +185,8 @@
|
||||
title: '30天收益资格生效中',
|
||||
badge: '正常活跃',
|
||||
btnText: '去自购续期',
|
||||
tip: '已满足30日保活,享有全部团队分红与奖项',
|
||||
lastOrderText: lastTime > 0 ? `上次自购: ${dayjs(lastTime * 1000).format('MM-DD HH:mm')}` : '',
|
||||
tip: '已满足30日保活(自购/直推有效),享有全部团队分红与奖项',
|
||||
lastOrderText: lastTime > 0 ? `上次有效订单: ${dayjs(lastTime * 1000).format('MM-DD HH:mm')}` : '',
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -22,7 +22,10 @@
|
||||
</view>
|
||||
|
||||
<!-- 马币市值动态指示胶囊 -->
|
||||
<view class="rate-capsule ss-flex ss-row-between ss-col-center">
|
||||
<view
|
||||
class="rate-capsule ss-flex ss-row-between ss-col-center"
|
||||
v-if="state.info.show_madow_rate !== false && state.info.show_madow_rate !== 0 && state.info.show_madow_rate !== '0'"
|
||||
>
|
||||
<view class="capsule-left ss-flex ss-col-center">
|
||||
<text class="capsule-dot"></text>
|
||||
<text class="capsule-text">马币市值 1 马豆 ≈ {{ state.info.madow_rate || '0' }} 元</text>
|
||||
@@ -178,6 +181,7 @@
|
||||
madow: sheep.$store('user').userInfo?.madow || '0',
|
||||
madow_rate: sheep.$store('user').userInfo?.madow_rate || '0',
|
||||
madow_value: sheep.$store('user').userInfo?.madow_value || '0.00',
|
||||
show_madow_rate: sheep.$store('user').userInfo?.show_madow_rate ?? 1,
|
||||
},
|
||||
list: [],
|
||||
inited: false,
|
||||
@@ -214,6 +218,9 @@
|
||||
state.info.madow = data.madow ?? state.info.madow;
|
||||
state.info.madow_rate = data.madow_rate ?? state.info.madow_rate;
|
||||
state.info.madow_value = data.madow_value ?? state.info.madow_value;
|
||||
if (data.show_madow_rate !== undefined) {
|
||||
state.info.show_madow_rate = data.show_madow_rate;
|
||||
}
|
||||
const list = pickList(data);
|
||||
state.list = page === 1 ? list : _.concat(state.list, list);
|
||||
state.page = data.list?.current_page || data.current_page || page;
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
<view class="header-box ss-flex ss-row-center ss-col-center">
|
||||
<view class="card-box ui-BG-Main ui-Shadow-Main">
|
||||
<view class="card-head ss-flex ss-col-center">
|
||||
<view class="card-title">本月已结算收益(元)</view>
|
||||
<view class="card-title">累计已结算收益(元)</view>
|
||||
</view>
|
||||
<view class="money-num ss-m-t-24">{{ state.overview.month_income || '0.00' }}</view>
|
||||
<view class="card-sub ss-m-t-20">
|
||||
本月未达成 {{ state.overview.skip_count || 0 }} 笔
|
||||
<view class="money-num ss-m-t-24">{{ displayTotalIncome }}</view>
|
||||
<view class="card-sub ss-flex ss-row-between ss-col-center ss-m-t-20">
|
||||
<text>本月已结算: ¥{{ state.overview.month_income || '0.00' }}</text>
|
||||
<text v-if="Number(state.overview.skip_count || 0) > 0">本月未达成 {{ state.overview.skip_count }} 笔</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -131,13 +132,22 @@
|
||||
|
||||
const tabMaps = computed(() => [
|
||||
{ name: '全部', value: 'all' },
|
||||
{ name: '开拓奖', value: 'push3' },
|
||||
{ name: '推荐提成', value: 'push3' },
|
||||
{ name: roleNames.value.maker || '创客', value: 'maker' },
|
||||
{ name: roleNames.value.venue || '酒道馆', value: 'venue' },
|
||||
{ name: roleNames.value.county || '区县', value: 'county' },
|
||||
{ name: '加权奖励', value: 'share' },
|
||||
{ name: '加权奖', value: 'share' },
|
||||
]);
|
||||
|
||||
const displayTotalIncome = computed(() => {
|
||||
return (
|
||||
state.overview.total_income ||
|
||||
agentInfo.value?.total_income ||
|
||||
userInfo.value?.total_income ||
|
||||
'0.00'
|
||||
);
|
||||
});
|
||||
|
||||
const emptyPagination = {
|
||||
data: [],
|
||||
current_page: 1,
|
||||
@@ -155,6 +165,7 @@
|
||||
buyerId: 0,
|
||||
buyerName: '',
|
||||
overview: {
|
||||
total_income: '0.00',
|
||||
month_income: '0.00',
|
||||
skip_count: 0,
|
||||
},
|
||||
@@ -185,6 +196,7 @@
|
||||
try {
|
||||
const res = await sheep.$api.partner.overview();
|
||||
if (res?.code === 1) {
|
||||
state.overview.total_income = res.data?.total_income || '0.00';
|
||||
state.overview.month_income = res.data?.month_income || '0.00';
|
||||
state.overview.skip_count = res.data?.skip_count || 0;
|
||||
}
|
||||
@@ -209,6 +221,9 @@
|
||||
...pageData,
|
||||
data: page === 1 ? pageData.data : _.concat(state.pagination.data, pageData.data),
|
||||
};
|
||||
if (res.data?.total_income !== undefined) {
|
||||
state.overview.total_income = res.data.total_income;
|
||||
}
|
||||
if (res.data?.month_income !== undefined) {
|
||||
state.overview.month_income = res.data.month_income;
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@
|
||||
<view class="metric-val">
|
||||
{{ item.agent?.direct_order_seq !== undefined ? '第' + item.agent.direct_order_seq + '单' : '--' }}
|
||||
</view>
|
||||
<view class="metric-lbl">开拓循环序号</view>
|
||||
<view class="metric-lbl">提成循环序号</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -472,10 +472,10 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 30天自购保活详情 -->
|
||||
<!-- 30天收益保活详情 -->
|
||||
<view class="drawer-section ss-m-b-24">
|
||||
<view class="section-title ss-flex ss-row-between ss-col-center">
|
||||
<text>30天自购保活状态</text>
|
||||
<text>30天收益保活状态</text>
|
||||
<text
|
||||
class="status-text-bold"
|
||||
:class="{
|
||||
@@ -495,13 +495,13 @@
|
||||
</view>
|
||||
<view class="section-box active-detail-box">
|
||||
<view class="detail-line ss-flex ss-row-between">
|
||||
<text class="line-label">最近本人下单时间:</text>
|
||||
<text class="line-label">最近有效订单时间:</text>
|
||||
<text class="line-val">
|
||||
{{ formatLastOrderTime(state.currentMember.agent?.last_self_order_time) }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="detail-line ss-flex ss-row-between ss-m-t-12">
|
||||
<text class="line-label">推荐开拓序号:</text>
|
||||
<text class="line-label">推荐提成序号:</text>
|
||||
<text class="line-val">
|
||||
{{ state.currentMember.agent?.direct_order_seq !== undefined ? '当前第 ' + state.currentMember.agent.direct_order_seq + ' 单' : '0 单' }}
|
||||
</text>
|
||||
|
||||
@@ -18,9 +18,8 @@
|
||||
<!-- 兑换券核心大字数 -->
|
||||
<view class="voucher-hero ss-flex ss-col-bottom ss-row-between">
|
||||
<view class="hero-left ss-flex ss-col-bottom">
|
||||
<text class="hero-symbol">¥</text>
|
||||
<text class="hero-num">{{ state.info.voucher_available || '0.00' }}</text>
|
||||
<text class="hero-unit">元</text>
|
||||
<text class="hero-unit">个</text>
|
||||
</view>
|
||||
<button
|
||||
class="ss-reset-button exchange-btn ss-flex ss-row-center ss-col-center"
|
||||
@@ -45,22 +44,22 @@
|
||||
<view class="footer-metric">
|
||||
<text class="metric-label">累计获得</text>
|
||||
<view class="metric-val-wrap ss-flex ss-col-bottom">
|
||||
<text class="currency-symbol">¥</text>
|
||||
<text class="metric-val">{{ state.info.voucher_total || '0.00' }}</text>
|
||||
<text class="metric-unit">个</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer-metric">
|
||||
<text class="metric-label">已释放</text>
|
||||
<view class="metric-val-wrap ss-flex ss-col-bottom">
|
||||
<text class="currency-symbol">¥</text>
|
||||
<text class="metric-val">{{ state.info.voucher_released || '0.00' }}</text>
|
||||
<text class="metric-unit">个</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer-metric">
|
||||
<text class="metric-label">已使用</text>
|
||||
<view class="metric-val-wrap ss-flex ss-col-bottom">
|
||||
<text class="currency-symbol">¥</text>
|
||||
<text class="metric-val">{{ state.info.voucher_used || '0.00' }}</text>
|
||||
<text class="metric-unit">个</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -102,7 +101,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="log-amount ss-flex ss-col-center">
|
||||
<text class="amount-num">¥{{ item.total_amount || item.total || item.voucher_total || '0.00' }}</text>
|
||||
<text class="amount-num">{{ item.total_amount || item.total || item.voucher_total || '0.00' }} 个</text>
|
||||
<text class="amount-status ss-m-l-12" :class="item.status === 2 ? 'finished' : 'releasing'">
|
||||
{{ item.status_text || (item.status === 2 ? '已完成' : '释放中') }}
|
||||
</text>
|
||||
@@ -123,13 +122,13 @@
|
||||
<!-- 详细指标标签 -->
|
||||
<view class="log-tags ss-flex ss-col-center ss-m-t-16">
|
||||
<view class="tag-item">
|
||||
<text class="tag-txt">已释放 ¥{{ item.released_amount || item.released || '0.00' }}</text>
|
||||
<text class="tag-txt">已释放 {{ item.released_amount || item.released || '0.00' }} 个</text>
|
||||
</view>
|
||||
<view class="tag-item" v-if="item.daily_amount">
|
||||
<text class="tag-txt">每日释放 ¥{{ item.daily_amount }}</text>
|
||||
<text class="tag-txt">每日释放 {{ item.daily_amount }} 个</text>
|
||||
</view>
|
||||
<view class="tag-item" v-if="calcRemain(item) !== null">
|
||||
<text class="tag-txt">待释放 ¥{{ calcRemain(item) }}</text>
|
||||
<text class="tag-txt">待释放 {{ calcRemain(item) }} 个</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -448,6 +447,14 @@
|
||||
color: #f4d397;
|
||||
font-family: OPPOSANS, DIN, -apple-system, sans-serif;
|
||||
}
|
||||
|
||||
.metric-unit {
|
||||
font-size: 22rpx;
|
||||
color: #f4d397;
|
||||
font-weight: 500;
|
||||
margin-left: 4rpx;
|
||||
margin-bottom: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
<view class="item-title">兑换券</view>
|
||||
<view class="ss-flex ss-col-center" @tap="openVoucher">
|
||||
<text class="item-value text-red" v-if="Number(state.orderInfo.voucher_fee || state.orderPayload.voucher_fee) > 0"
|
||||
>-¥{{ state.orderInfo.voucher_fee || state.orderPayload.voucher_fee }}</text
|
||||
>-{{ state.orderInfo.voucher_fee || state.orderPayload.voucher_fee }} 个</text
|
||||
>
|
||||
<text
|
||||
class="item-value"
|
||||
@@ -109,7 +109,7 @@
|
||||
v-else
|
||||
>{{
|
||||
Number(state.orderInfo.voucher_available) > 0
|
||||
? '可用 ¥' + (state.orderInfo.voucher_available || '0.00')
|
||||
? '可用 ' + (state.orderInfo.voucher_available || '0.00') + ' 个'
|
||||
: '暂无可用兑换券'
|
||||
}}</text
|
||||
>
|
||||
@@ -169,17 +169,17 @@
|
||||
<view class="ss-p-x-20 ss-p-y-30">
|
||||
<view class="ss-m-b-16 ss-m-l-20" style="font-size: 32rpx; font-weight: 600">兑换券抵扣</view>
|
||||
<view class="ss-m-b-30 ss-m-l-20" style="color: #999; font-size: 24rpx">
|
||||
可用 ¥{{ state.orderInfo.voucher_available || '0.00' }},先用商城优惠券再用兑换券
|
||||
可用 {{ state.orderInfo.voucher_available || '0.00' }} 个,先用商城优惠券再用兑换券
|
||||
</view>
|
||||
<view class="ss-flex ss-col-center ss-m-x-20 ss-m-b-40" style="border-bottom: 1px solid #eee">
|
||||
<view style="font-size: 40rpx; font-weight: 600">¥</view>
|
||||
<uni-easyinput
|
||||
:inputBorder="false"
|
||||
class="ss-flex-1"
|
||||
type="digit"
|
||||
v-model="state.voucherInput"
|
||||
placeholder="请输入抵扣金额"
|
||||
placeholder="请输入使用数量"
|
||||
/>
|
||||
<view style="font-size: 32rpx; font-weight: 600; color: #333; margin-left: 8rpx">个</view>
|
||||
</view>
|
||||
<button class="ss-reset-button ui-BG-Main-Gradient ss-r-40 ui-Shadow-Main" style="height: 80rpx" @tap="onConfirmVoucher">
|
||||
确定
|
||||
@@ -317,9 +317,9 @@
|
||||
const voucherFee = Number(state.orderInfo.voucher_fee || state.orderPayload.voucher_fee || 0);
|
||||
let confirmContent = '确定立即兑换此商品?';
|
||||
if (hasScore && voucherFee > 0) {
|
||||
confirmContent = `确定使用 ${voucherFee} 元兑换券与 ${state.orderInfo.score_amount} 积分立即兑换?`;
|
||||
confirmContent = `确定使用 ${voucherFee} 个兑换券与 ${state.orderInfo.score_amount} 积分立即兑换?`;
|
||||
} else if (voucherFee > 0) {
|
||||
confirmContent = `确定使用 ${voucherFee} 元兑换券立即兑换(现金实付 0 元)?`;
|
||||
confirmContent = `确定使用 ${voucherFee} 个兑换券立即兑换(现金实付 0 元)?`;
|
||||
} else if (hasScore) {
|
||||
confirmContent = `确定使用 ${state.orderInfo.score_amount} 积分立即兑换?`;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<view class="cashier-container">
|
||||
<!-- 1. 顶部待支付金额卡片 -->
|
||||
<view class="amount-card ss-flex-col ss-col-center">
|
||||
<view class="amount-label">应付金额</view>
|
||||
<view class="amount-label">{{ currentAmountLabel }}</view>
|
||||
<view class="amount-val-wrap ss-flex ss-col-bottom ss-row-center">
|
||||
<text class="currency-symbol">¥</text>
|
||||
<text class="amount-integer">{{ priceParts.integer }}</text>
|
||||
@@ -68,6 +68,22 @@
|
||||
<text class="meta-label">订单内容</text>
|
||||
<text class="meta-val ellipsis-1">{{ orderSubject }}</text>
|
||||
</view>
|
||||
<!-- 历史已付金额明细 -->
|
||||
<view
|
||||
class="order-meta-row ss-flex ss-row-between ss-col-center ss-m-t-12"
|
||||
v-if="alreadyPaidFee > 0"
|
||||
>
|
||||
<text class="meta-label">已付金额</text>
|
||||
<text class="meta-val text-success font-bold">¥{{ alreadyPaidFee.toFixed(2) }}</text>
|
||||
</view>
|
||||
<!-- 开启混合支付时的抵扣明细 -->
|
||||
<view
|
||||
class="order-meta-row ss-flex ss-row-between ss-col-center ss-m-t-12"
|
||||
v-if="isMixedPaySupported && useMixedPay && deductMoney > 0"
|
||||
>
|
||||
<text class="meta-label">余额抵扣</text>
|
||||
<text class="meta-val text-orange font-bold">-¥{{ deductMoney.toFixed(2) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -84,6 +100,39 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 余额不足全额支付时:专属余额混合支付抵扣卡片 -->
|
||||
<view
|
||||
class="mixed-pay-card ss-flex ss-row-between ss-col-center ss-m-t-24"
|
||||
v-if="isMixedPaySupported"
|
||||
>
|
||||
<view class="mixed-left ss-flex ss-col-center">
|
||||
<view class="mixed-icon-wrap ss-flex ss-row-center ss-col-center">
|
||||
<image
|
||||
class="mixed-icon-img"
|
||||
:src="sheep.$url.static('/assets/addons/shopro/uniapp/pay/wallet.png')"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
</view>
|
||||
<view class="mixed-info ss-flex-col">
|
||||
<view class="mixed-title-row ss-flex ss-col-center">
|
||||
<text class="mixed-title">余额混合支付</text>
|
||||
<text class="mixed-tag">组合立省</text>
|
||||
</view>
|
||||
<text class="mixed-desc">
|
||||
可用余额 ¥{{ userBalance.toFixed(2) }},本单可抵扣 ¥{{ deductMoney.toFixed(2) }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mixed-right ss-flex ss-col-center">
|
||||
<switch
|
||||
:checked="useMixedPay"
|
||||
@change="onToggleMixedPay"
|
||||
color="var(--ui-BG-Main, #ff3000)"
|
||||
style="transform: scale(0.8); transform-origin: right center;"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付列表 -->
|
||||
<view class="payment-list">
|
||||
<view
|
||||
@@ -120,6 +169,13 @@
|
||||
>
|
||||
推荐
|
||||
</text>
|
||||
<!-- 混合支付下第三方需补足金额标签 -->
|
||||
<text
|
||||
class="method-tag mixed-amount-tag"
|
||||
v-if="isMixedPaySupported && useMixedPay && ['wechat', 'alipay', 'apple'].includes(item.value)"
|
||||
>
|
||||
需付 ¥{{ thirdPayFee.toFixed(2) }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<!-- 余额支付专享余额状态展示 -->
|
||||
@@ -140,6 +196,15 @@
|
||||
<text>余额充足</text>
|
||||
</view>
|
||||
|
||||
<!-- 混合支付抵扣中 -->
|
||||
<view
|
||||
class="balance-badge mixed ss-flex ss-col-center"
|
||||
v-else-if="isMixedPaySupported && useMixedPay"
|
||||
>
|
||||
<text class="cicon-check ss-m-r-4"></text>
|
||||
<text>已启用抵扣</text>
|
||||
</view>
|
||||
|
||||
<!-- 余额不足 -->
|
||||
<view
|
||||
class="balance-badge danger ss-flex ss-col-center"
|
||||
@@ -158,12 +223,22 @@
|
||||
<text>去充值</text>
|
||||
<text class="cicon-forward"></text>
|
||||
</view>
|
||||
|
||||
<!-- 快捷开启混合支付入口 -->
|
||||
<view
|
||||
class="mixed-link-btn ss-flex ss-col-center ss-m-l-10"
|
||||
v-if="isMixedPaySupported && !useMixedPay"
|
||||
@tap.stop="onEnableMixedPay"
|
||||
>
|
||||
<text>开启混合支付</text>
|
||||
<text class="cicon-forward"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 余额充足时的扣款提示 -->
|
||||
<view
|
||||
class="balance-deduct-tip ss-m-t-4"
|
||||
v-if="item.value === 'money' && isBalanceEnough && payFee > 0"
|
||||
v-if="item.value === 'money' && isBalanceEnough && remainPayFee > 0"
|
||||
>
|
||||
<text>支付后剩余 ¥{{ remainingBalance }}</text>
|
||||
</view>
|
||||
@@ -254,29 +329,85 @@ const userBalance = computed(() => {
|
||||
return isNaN(m) ? 0 : m;
|
||||
});
|
||||
|
||||
const payFee = computed(() => {
|
||||
// 订单原始总应付金额
|
||||
const payTotalFee = computed(() => {
|
||||
const f = parseFloat(state.orderInfo?.pay_fee);
|
||||
return isNaN(f) ? 0 : f;
|
||||
});
|
||||
|
||||
// 余额是否充足
|
||||
const isBalanceEnough = computed(() => {
|
||||
return userBalance.value >= payFee.value && payFee.value > 0;
|
||||
// 订单当前剩余应付金额
|
||||
const remainPayFee = computed(() => {
|
||||
const rf =
|
||||
state.orderInfo?.remain_pay_fee !== undefined
|
||||
? parseFloat(state.orderInfo.remain_pay_fee)
|
||||
: parseFloat(state.orderInfo?.pay_fee);
|
||||
return isNaN(rf) ? 0 : Math.max(0, rf);
|
||||
});
|
||||
|
||||
// 扣减后剩余余额
|
||||
// 历史已付金额
|
||||
const alreadyPaidFee = computed(() => {
|
||||
const diff = payTotalFee.value - remainPayFee.value;
|
||||
return diff > 0 ? diff : 0;
|
||||
});
|
||||
|
||||
// 余额是否充足(是否可全额支付当前剩余待付金额)
|
||||
const isBalanceEnough = computed(() => {
|
||||
return userBalance.value >= remainPayFee.value && remainPayFee.value > 0;
|
||||
});
|
||||
|
||||
// 扣减后剩余余额(若全额使用余额支付)
|
||||
const remainingBalance = computed(() => {
|
||||
const rem = userBalance.value - payFee.value;
|
||||
const rem = userBalance.value - remainPayFee.value;
|
||||
return rem >= 0 ? rem.toFixed(2) : "0.00";
|
||||
});
|
||||
|
||||
// 是否支持混合支付:商品订单、有可用余额但不足以全额付清、且剩余待付款大于0
|
||||
const isMixedPaySupported = computed(() => {
|
||||
return (
|
||||
state.orderType === "goods" &&
|
||||
userBalance.value > 0 &&
|
||||
userBalance.value < remainPayFee.value &&
|
||||
remainPayFee.value > 0
|
||||
);
|
||||
});
|
||||
|
||||
// 用户是否启用混合支付开关(满足条件时默认开启)
|
||||
const useMixedPay = ref(true);
|
||||
|
||||
// 混合支付下抵扣的余额金额
|
||||
const deductMoney = computed(() => {
|
||||
if (!isMixedPaySupported.value || !useMixedPay.value) return 0;
|
||||
return Math.min(userBalance.value, remainPayFee.value);
|
||||
});
|
||||
|
||||
// 混合支付下第三方渠道需补足支付的金额
|
||||
const thirdPayFee = computed(() => {
|
||||
const diff = remainPayFee.value - deductMoney.value;
|
||||
return diff > 0 ? diff : 0;
|
||||
});
|
||||
|
||||
// 顶部卡片展示的当前待付金额
|
||||
const currentDueFee = computed(() => {
|
||||
if (isMixedPaySupported.value && useMixedPay.value && deductMoney.value > 0) {
|
||||
return thirdPayFee.value;
|
||||
}
|
||||
return remainPayFee.value;
|
||||
});
|
||||
|
||||
// 顶部金额标题
|
||||
const currentAmountLabel = computed(() => {
|
||||
if (isMixedPaySupported.value && useMixedPay.value && deductMoney.value > 0) {
|
||||
return "在线待付金额";
|
||||
}
|
||||
if (alreadyPaidFee.value > 0) {
|
||||
return "剩余应付金额";
|
||||
}
|
||||
return "应付金额";
|
||||
});
|
||||
|
||||
// 金额拆分整数与小数
|
||||
const priceParts = computed(() => {
|
||||
const fee = state.orderInfo?.pay_fee;
|
||||
if (fee === undefined || fee === null || fee === "") {
|
||||
return { integer: "0", decimal: "00" };
|
||||
}
|
||||
const num = parseFloat(fee);
|
||||
const num = currentDueFee.value;
|
||||
if (isNaN(num)) return { integer: "0", decimal: "00" };
|
||||
const str = num.toFixed(2);
|
||||
const parts = str.split(".");
|
||||
@@ -382,6 +513,18 @@ const orderSubject = computed(() => {
|
||||
return state.orderInfo.order_title || "商城商品订单";
|
||||
});
|
||||
|
||||
// 支付方式名称映射
|
||||
function getMethodTitle(val) {
|
||||
const map = {
|
||||
wechat: "微信支付",
|
||||
alipay: "支付宝",
|
||||
money: "余额支付",
|
||||
apple: "Apple Pay",
|
||||
offline: "货到付款",
|
||||
};
|
||||
return map[val] || "在线支付";
|
||||
}
|
||||
|
||||
// 3. 实时平滑倒计时逻辑
|
||||
let countdownTimer = null;
|
||||
const countdownStr = ref("");
|
||||
@@ -442,9 +585,39 @@ function autoSelectPayment() {
|
||||
return;
|
||||
}
|
||||
|
||||
// 若开启了混合支付,优先确保选择有效的第三方通道(非 money)
|
||||
if (isMixedPaySupported.value && useMixedPay.value) {
|
||||
if (
|
||||
state.payment &&
|
||||
state.payment !== "money" &&
|
||||
list.some((item) => item.value === state.payment)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isWechatEnv.value) {
|
||||
const wechatItem = list.find((item) => item.value === "wechat");
|
||||
if (wechatItem) {
|
||||
state.payment = "wechat";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const alipayItem = list.find((item) => item.value === "alipay");
|
||||
if (alipayItem) {
|
||||
state.payment = "alipay";
|
||||
return;
|
||||
}
|
||||
|
||||
const nonMoneyItem = list.find((item) => item.value !== "money");
|
||||
if (nonMoneyItem) {
|
||||
state.payment = nonMoneyItem.value;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 若当前已选中的支付方式依然可用且非禁用
|
||||
if (state.payment && list.some((item) => item.value === state.payment)) {
|
||||
// 若当前选中的是余额支付但余额不足,尝试智能自动切换至微信支付
|
||||
if (state.payment === "money" && !isBalanceEnough.value) {
|
||||
const wechatItem = list.find((item) => item.value === "wechat");
|
||||
if (wechatItem) {
|
||||
@@ -500,7 +673,47 @@ function autoSelectPayment() {
|
||||
state.payment = list[0].value;
|
||||
}
|
||||
|
||||
// 5. 点击切换支付方式
|
||||
// 5. 混合支付开关与交互
|
||||
function onToggleMixedPay(e) {
|
||||
useMixedPay.value = e.detail.value;
|
||||
if (useMixedPay.value) {
|
||||
if (state.payment === "money") {
|
||||
const nonMoney = visiblePayMethods.value.find(
|
||||
(i) => !i.disabled && i.value !== "money",
|
||||
);
|
||||
if (nonMoney) {
|
||||
state.payment =
|
||||
isWechatEnv.value &&
|
||||
visiblePayMethods.value.some((i) => i.value === "wechat")
|
||||
? "wechat"
|
||||
: nonMoney.value;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (state.payment === "money" && !isBalanceEnough.value) {
|
||||
sheep.$helper.toast("已关闭混合支付,当前可用余额不足以全额付款");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onEnableMixedPay() {
|
||||
useMixedPay.value = true;
|
||||
if (state.payment === "money") {
|
||||
const nonMoney = visiblePayMethods.value.find(
|
||||
(i) => !i.disabled && i.value !== "money",
|
||||
);
|
||||
if (nonMoney) {
|
||||
state.payment =
|
||||
isWechatEnv.value &&
|
||||
visiblePayMethods.value.some((i) => i.value === "wechat")
|
||||
? "wechat"
|
||||
: nonMoney.value;
|
||||
}
|
||||
}
|
||||
sheep.$helper.toast("已开启余额混合支付");
|
||||
}
|
||||
|
||||
// 6. 点击切换支付方式
|
||||
function onSelectPay(item) {
|
||||
if (item.disabled) {
|
||||
if (item.value === "offline") {
|
||||
@@ -508,26 +721,55 @@ function onSelectPay(item) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
state.payment = item.value;
|
||||
|
||||
if (item.value === "money" && !isBalanceEnough.value) {
|
||||
if (item.value === "money") {
|
||||
if (isBalanceEnough.value) {
|
||||
state.payment = "money";
|
||||
return;
|
||||
}
|
||||
|
||||
if (isMixedPaySupported.value) {
|
||||
if (!useMixedPay.value) {
|
||||
uni.showModal({
|
||||
title: "混合支付推荐",
|
||||
content: `当前可用余额 ¥${userBalance.value.toFixed(2)} 不足全额支付该订单(待付 ¥${remainPayFee.value.toFixed(2)})。是否启用【余额混合支付】抵扣 ¥${deductMoney.value.toFixed(2)},剩余 ¥${(remainPayFee.value - deductMoney.value).toFixed(2)} 通过微信/支付宝支付?`,
|
||||
confirmText: "启用混合支付",
|
||||
cancelText: "去充值",
|
||||
confirmColor: "var(--ui-BG-Main, #ff3000)",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
onEnableMixedPay();
|
||||
} else {
|
||||
onGoRecharge();
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
sheep.$helper.toast("已启用余额抵扣,请选择补足方式(如微信或支付宝)");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
sheep.$helper.toast("可用余额不足,可前往充值或切换支付方式");
|
||||
return;
|
||||
}
|
||||
|
||||
state.payment = item.value;
|
||||
}
|
||||
|
||||
// 6. 复制订单号
|
||||
// 7. 复制订单号
|
||||
function onCopyOrderSn() {
|
||||
if (!state.orderInfo?.order_sn) return;
|
||||
sheep.$helper.copyText(state.orderInfo.order_sn);
|
||||
sheep.$helper.toast("订单号已复制");
|
||||
}
|
||||
|
||||
// 7. 前往充值页面
|
||||
// 8. 前往充值页面
|
||||
function onGoRecharge() {
|
||||
sheep.$router.go("/pages/pay/recharge");
|
||||
}
|
||||
|
||||
// 8. 检查订单支付状态
|
||||
// 9. 检查订单支付状态
|
||||
function checkPayStatus() {
|
||||
if (state.orderInfo.status === "unpaid") {
|
||||
state.payStatus = 1;
|
||||
@@ -547,7 +789,7 @@ function checkPayStatus() {
|
||||
state.payStatus = 2;
|
||||
}
|
||||
|
||||
// 9. 获取充值订单信息
|
||||
// 10. 获取充值订单信息
|
||||
async function setRechargeOrder(id) {
|
||||
state.loading = true;
|
||||
try {
|
||||
@@ -567,7 +809,7 @@ async function setRechargeOrder(id) {
|
||||
}
|
||||
}
|
||||
|
||||
// 10. 获取商品订单信息
|
||||
// 11. 获取商品订单信息
|
||||
async function setGoodsOrder(id) {
|
||||
state.loading = true;
|
||||
try {
|
||||
@@ -598,7 +840,7 @@ async function setGoodsOrder(id) {
|
||||
}
|
||||
}
|
||||
|
||||
// 11. 底部按钮文案与可用性计算
|
||||
// 12. 底部按钮文案与可用性计算
|
||||
const isButtonDisabled = computed(() => {
|
||||
if (state.isSubmitting) return true;
|
||||
if (state.payStatus !== 1) return true;
|
||||
@@ -624,13 +866,19 @@ const payButtonText = computed(() => {
|
||||
|
||||
// 选中余额支付且余额不足时
|
||||
if (state.payment === "money" && !isBalanceEnough.value) {
|
||||
return "余额不足 · 去充值";
|
||||
return isMixedPaySupported.value ? "余额不足 · 开启混合支付" : "余额不足 · 去充值";
|
||||
}
|
||||
|
||||
return `立即支付 ¥${payFee.value.toFixed(2)}`;
|
||||
// 混合支付模式
|
||||
if (isMixedPaySupported.value && useMixedPay.value && deductMoney.value > 0) {
|
||||
const title = getMethodTitle(state.payment);
|
||||
return `混合支付 · ${title}付 ¥${thirdPayFee.value.toFixed(2)} (已抵余额¥${deductMoney.value.toFixed(2)})`;
|
||||
}
|
||||
|
||||
return `立即支付 ¥${remainPayFee.value.toFixed(2)}`;
|
||||
});
|
||||
|
||||
// 12. 支付流程核心入口
|
||||
// 13. 支付流程核心入口
|
||||
async function onPay() {
|
||||
if (state.payStatus !== 1 || state.isSubmitting) return;
|
||||
|
||||
@@ -639,27 +887,58 @@ async function onPay() {
|
||||
return;
|
||||
}
|
||||
|
||||
// 余额支付流程
|
||||
// 混合支付流程
|
||||
if (isMixedPaySupported.value && useMixedPay.value && deductMoney.value > 0) {
|
||||
if (state.payment === "money") {
|
||||
sheep.$helper.toast("请选择补足剩余款项的支付通道(微信或支付宝)");
|
||||
return;
|
||||
}
|
||||
if (state.payment === "offline") {
|
||||
sheep.$helper.toast("货到付款不支持混合支付");
|
||||
return;
|
||||
}
|
||||
|
||||
const title = getMethodTitle(state.payment);
|
||||
uni.showModal({
|
||||
title: "混合支付确认",
|
||||
content: `本次将扣除账户可用余额 ¥${deductMoney.value.toFixed(2)},并通过 ${title} 支付剩余 ¥${thirdPayFee.value.toFixed(2)}。确定发起支付吗?`,
|
||||
confirmText: "确认支付",
|
||||
cancelText: "取消",
|
||||
confirmColor: "var(--ui-BG-Main, #ff3000)",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
submitPayment({ money: deductMoney.value });
|
||||
}
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 纯余额支付流程
|
||||
if (state.payment === "money") {
|
||||
if (!isBalanceEnough.value) {
|
||||
uni.showModal({
|
||||
title: "余额不足",
|
||||
content: `当前可用余额为 ¥${userBalance.value.toFixed(2)},不足以支付该订单(¥${payFee.value.toFixed(2)}),是否前往充值?`,
|
||||
confirmText: "去充值",
|
||||
cancelText: "取消",
|
||||
confirmColor: "var(--ui-BG-Main, #ff3000)",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
onGoRecharge();
|
||||
}
|
||||
},
|
||||
});
|
||||
if (isMixedPaySupported.value) {
|
||||
onEnableMixedPay();
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: "余额不足",
|
||||
content: `当前可用余额为 ¥${userBalance.value.toFixed(2)},不足以支付该订单(待付 ¥${remainPayFee.value.toFixed(2)}),是否前往充值?`,
|
||||
confirmText: "去充值",
|
||||
cancelText: "取消",
|
||||
confirmColor: "var(--ui-BG-Main, #ff3000)",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
onGoRecharge();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
uni.showModal({
|
||||
title: "余额支付确认",
|
||||
content: `本次将扣除 ¥${payFee.value.toFixed(2)},支付后账户剩余 ¥${remainingBalance.value}。确定支付吗?`,
|
||||
content: `本次将扣除 ¥${remainPayFee.value.toFixed(2)},支付后账户剩余 ¥${remainingBalance.value}。确定支付吗?`,
|
||||
confirmText: "确认支付",
|
||||
cancelText: "取消",
|
||||
confirmColor: "var(--ui-BG-Main, #ff3000)",
|
||||
@@ -689,18 +968,19 @@ async function onPay() {
|
||||
return;
|
||||
}
|
||||
|
||||
// 微信支付、支付宝支付等常规通道
|
||||
// 微信支付、支付宝支付等常规全额通道
|
||||
submitPayment();
|
||||
}
|
||||
|
||||
// 提交支付
|
||||
async function submitPayment() {
|
||||
async function submitPayment(options = {}) {
|
||||
state.isSubmitting = true;
|
||||
try {
|
||||
await sheep.$platform.pay(
|
||||
state.payment,
|
||||
state.orderType,
|
||||
state.orderInfo.order_sn,
|
||||
options,
|
||||
);
|
||||
} catch (err) {
|
||||
console.error("支付发起异常:", err);
|
||||
@@ -709,7 +989,7 @@ async function submitPayment() {
|
||||
}
|
||||
}
|
||||
|
||||
// 13. 生命周期钩子
|
||||
// 14. 生命周期钩子
|
||||
onLoad((options) => {
|
||||
// 微信公众号 iOS 路由刷新边缘兼容
|
||||
if (
|
||||
@@ -864,6 +1144,18 @@ onUnmounted(() => {
|
||||
color: #333333;
|
||||
max-width: 440rpx;
|
||||
text-align: right;
|
||||
|
||||
&.text-success {
|
||||
color: #52c41a;
|
||||
}
|
||||
|
||||
&.text-orange {
|
||||
color: #fa8c16;
|
||||
}
|
||||
|
||||
&.font-bold {
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
@@ -925,6 +1217,63 @@ onUnmounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
// 专属混合支付卡片
|
||||
.mixed-pay-card {
|
||||
background: linear-gradient(135deg, #fff9f6 0%, #fff4ef 100%);
|
||||
border: 2rpx solid rgba(255, 87, 34, 0.22);
|
||||
border-radius: 18rpx;
|
||||
padding: 20rpx 22rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.mixed-left {
|
||||
flex: 1;
|
||||
|
||||
.mixed-icon-wrap {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 50%;
|
||||
margin-right: 18rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(255, 87, 34, 0.12);
|
||||
|
||||
.mixed-icon-img {
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.mixed-info {
|
||||
flex: 1;
|
||||
|
||||
.mixed-title-row {
|
||||
.mixed-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.mixed-tag {
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
background: linear-gradient(90deg, #ff7a45, #ff4d4f);
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 6rpx;
|
||||
margin-left: 12rpx;
|
||||
line-height: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.mixed-desc {
|
||||
font-size: 22rpx;
|
||||
color: #777777;
|
||||
margin-top: 6rpx;
|
||||
font-family: OPPOSANS, sans-serif;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.payment-list {
|
||||
.pay-option-item {
|
||||
padding: 28rpx 0;
|
||||
@@ -972,6 +1321,13 @@ onUnmounted(() => {
|
||||
color: #1890ff;
|
||||
border: 1rpx solid #91d5ff;
|
||||
}
|
||||
|
||||
&.mixed-amount-tag {
|
||||
background: #fff7e6;
|
||||
color: #fa8c16;
|
||||
border: 1rpx solid #ffd591;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1008,6 +1364,13 @@ onUnmounted(() => {
|
||||
border: 1rpx solid #b7eb8f;
|
||||
}
|
||||
|
||||
&.mixed {
|
||||
background: #e6f7ff;
|
||||
color: #1890ff;
|
||||
border: 1rpx solid #91d5ff;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&.danger {
|
||||
background: #fff2f0;
|
||||
color: #ff4d4f;
|
||||
@@ -1028,6 +1391,20 @@ onUnmounted(() => {
|
||||
margin-left: 2rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.mixed-link-btn {
|
||||
font-size: 22rpx;
|
||||
color: #fa8c16;
|
||||
font-weight: 600;
|
||||
background: rgba(250, 140, 22, 0.1);
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.cicon-forward {
|
||||
font-size: 18rpx;
|
||||
margin-left: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.balance-deduct-tip {
|
||||
|
||||
@@ -11,8 +11,11 @@
|
||||
]"
|
||||
>
|
||||
<view class="">
|
||||
<view class="num-title">可提现金额(元)</view>
|
||||
<view class="num-title">可提现佣金(元)</view>
|
||||
<view class="wallet-num">{{ userInfo.commission || '0.00' }}</view>
|
||||
<view class="ss-m-t-10" style="font-size: 22rpx; color: rgba(255,255,255,0.85);">
|
||||
商城可用余额:¥{{ userInfo.money || '0.00' }}
|
||||
</view>
|
||||
</view>
|
||||
<button class="ss-reset-button log-btn" @tap="sheep.$router.go('/pages/pay/withdraw-log')"
|
||||
>提现记录</button
|
||||
@@ -57,7 +60,10 @@
|
||||
|
||||
<!-- 提现说明 -->
|
||||
<view class="draw-notice">
|
||||
<view class="title ss-m-b-30">提现说明</view>
|
||||
<view class="title ss-m-b-20">提现说明</view>
|
||||
<view class="tip-banner ss-m-b-20" style="background: #fff8f2; color: #ff6000; font-size: 22rpx; padding: 16rpx 20rpx; border-radius: 12rpx; line-height: 1.5;">
|
||||
💡 提示:商城收益分成已全额直接入账商城余额,可用于下单直接抵扣。历史存量佣金可转入商城余额消费。
|
||||
</view>
|
||||
<view class="draw-list" v-for="(rule, index) in state.rulesList" :key="index">
|
||||
{{ index + 1 }}.{{ rule }}
|
||||
</view>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<view class="header-box ss-flex ss-row-center ss-col-center">
|
||||
<view class="card-box ui-BG-Main ui-Shadow-Main">
|
||||
<view class="card-head ss-flex ss-col-center">
|
||||
<view class="card-title ss-m-r-10">可提现收益(元)</view>
|
||||
<view class="card-title ss-m-r-10">商城可用余额(元)</view>
|
||||
<view
|
||||
@tap="state.showMoney = !state.showMoney"
|
||||
class="ss-eye-icon"
|
||||
@@ -12,31 +12,37 @@
|
||||
></view>
|
||||
</view>
|
||||
<view class="ss-flex ss-row-between ss-col-center ss-m-t-30">
|
||||
<view class="money-num">{{ state.showMoney ? userInfo.commission : '*****' }}</view>
|
||||
<view class="money-num">{{ state.showMoney ? (userInfo.money || '0.00') : '*****' }}</view>
|
||||
<view class="ss-flex">
|
||||
<view class="ss-m-r-20">
|
||||
<button
|
||||
class="ss-reset-button withdraw-btn"
|
||||
@tap="sheep.$router.go('/pages/pay/withdraw')"
|
||||
>
|
||||
提现
|
||||
<view class="ss-m-r-20" v-if="Number(userInfo.commission || 0) > 0">
|
||||
<button class="ss-reset-button balance-btn" @tap="state.showModal = true">
|
||||
转余额
|
||||
</button>
|
||||
</view>
|
||||
<button class="ss-reset-button balance-btn ss-m-l-20" @tap="state.showModal = true">
|
||||
转余额
|
||||
<button
|
||||
class="ss-reset-button withdraw-btn"
|
||||
@tap="sheep.$router.go('/pages/goods/list')"
|
||||
>
|
||||
去消费
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="ss-flex">
|
||||
<view class="ss-flex ss-row-between ss-m-t-30">
|
||||
<view class="loading-money">
|
||||
<view class="loading-money-title">待结算收益</view>
|
||||
<view class="loading-money-num">{{
|
||||
state.showMoney ? agentInfo.pending_reward || '0.00' : '*****'
|
||||
}}</view>
|
||||
</view>
|
||||
<view class="loading-money ss-m-l-100">
|
||||
<view class="loading-money-title">可提现收益</view>
|
||||
<view class="loading-money">
|
||||
<view class="loading-money-title">累计总收益</view>
|
||||
<view class="loading-money-num">{{
|
||||
state.showMoney ? agentInfo.total_income || userInfo.total_income || '0.00' : '*****'
|
||||
}}</view>
|
||||
</view>
|
||||
<view class="loading-money" v-if="Number(userInfo.commission || 0) > 0">
|
||||
<view class="loading-money-title">历史未转佣金</view>
|
||||
<view class="loading-money-num">{{
|
||||
state.showMoney ? userInfo.commission || '0.00' : '*****'
|
||||
}}</view>
|
||||
@@ -60,8 +66,8 @@
|
||||
</uni-datetime-picker>
|
||||
|
||||
<view class="total-box">
|
||||
<view class="ss-m-b-10">总收入¥{{ state.pagination.income.toFixed(2) }}</view>
|
||||
<view>总支出¥{{ (-state.pagination.expense).toFixed(2) }}</view>
|
||||
<view class="ss-m-b-10">周期收益¥{{ (state.pagination.income || 0).toFixed(2) }}</view>
|
||||
<view v-if="state.pagination.expense < 0">退回扣减¥{{ (-state.pagination.expense).toFixed(2) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<su-tabs
|
||||
@@ -114,9 +120,17 @@
|
||||
>
|
||||
<view class="list-content">
|
||||
<view class="title-box ss-flex ss-row-between ss-m-b-20">
|
||||
<text class="title ss-line-1"
|
||||
>{{ item.event_text }}{{ item.memo ? '-' + item.memo : '' }}</text
|
||||
>
|
||||
<view class="ss-flex ss-col-center">
|
||||
<text class="title ss-line-1"
|
||||
>{{ item.event_text }}{{ item.memo ? '-' + item.memo : '' }}</text
|
||||
>
|
||||
<text
|
||||
v-if="item.type === 'money'"
|
||||
class="reward-tag ss-m-l-10"
|
||||
style="font-size: 20rpx; color: #ff5722; background: #fff0eb; padding: 2rpx 8rpx; border-radius: 6rpx;"
|
||||
>已入余额</text
|
||||
>
|
||||
</view>
|
||||
<view class="money">
|
||||
<text v-if="item.amount >= 0" class="add">+{{ item.amount }}</text>
|
||||
<text v-else class="minus">{{ item.amount }}</text>
|
||||
@@ -135,7 +149,7 @@
|
||||
contentdown: '上拉加载更多',
|
||||
}"
|
||||
/>
|
||||
<view class="wallet-tip">马豆与兑换券不在本页,请到收益中心查看。</view>
|
||||
<view class="wallet-tip">收益分成已全额直接入账商城可用余额,可用于下单消费抵扣。马豆与兑换券请前往收益中心查看。</view>
|
||||
</s-layout>
|
||||
</template>
|
||||
|
||||
@@ -172,6 +186,10 @@
|
||||
name: '全部',
|
||||
value: 'all',
|
||||
},
|
||||
{
|
||||
name: '收益分成',
|
||||
value: 'reward',
|
||||
},
|
||||
{
|
||||
name: '收入',
|
||||
value: 'income',
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<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>
|
||||
<text class="capsule-text">线上充值与收益分成全额入账 · 下单直接抵扣</text>
|
||||
</view>
|
||||
<text class="capsule-tag">即时可用</text>
|
||||
</view>
|
||||
@@ -185,6 +185,10 @@
|
||||
name: '全部',
|
||||
value: 'all',
|
||||
},
|
||||
{
|
||||
name: '收益分成',
|
||||
value: 'reward',
|
||||
},
|
||||
{
|
||||
name: '收入',
|
||||
value: 'income',
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
<view class="value-box ss-flex ss-col-bottom ss-row-center">
|
||||
<view class="value-text ss-line-1">{{ displayMadow }}</view>
|
||||
</view>
|
||||
<view class="sub-text">约¥{{ userInfo?.madow_value || '0.00' }}</view>
|
||||
<view class="menu-title ss-m-t-8">马豆</view>
|
||||
<view class="menu-title ss-m-t-16">马豆</view>
|
||||
</view>
|
||||
<view
|
||||
class="menu-item ss-flex-col ss-row-center ss-col-center"
|
||||
@@ -27,7 +26,7 @@
|
||||
>
|
||||
<view class="value-box ss-flex ss-col-bottom ss-row-center">
|
||||
<view class="value-text ss-line-1">{{ userInfo?.voucher_available || '0.00' }}</view>
|
||||
<view class="unit-text ss-m-l-6">元</view>
|
||||
<view class="unit-text ss-m-l-6">个</view>
|
||||
</view>
|
||||
<view class="menu-title ss-m-t-16">兑换券</view>
|
||||
</view>
|
||||
|
||||
@@ -75,8 +75,8 @@ const useProvider = (_provider = '') => {
|
||||
};
|
||||
|
||||
// 支付服务转发
|
||||
const pay = (payment, orderType, orderSN) => {
|
||||
return new Pay(payment, orderType, orderSN);
|
||||
const pay = (payment, orderType, orderSN, options = {}) => {
|
||||
return new Pay(payment, orderType, orderSN, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,10 +15,11 @@ import {
|
||||
*/
|
||||
|
||||
export default class SheepPay {
|
||||
constructor(payment, orderType, orderSN) {
|
||||
constructor(payment, orderType, orderSN, options = {}) {
|
||||
this.payment = payment;
|
||||
this.orderSN = orderSN;
|
||||
this.orderType = orderType;
|
||||
this.options = options || {};
|
||||
this.payAction();
|
||||
}
|
||||
|
||||
@@ -91,22 +92,31 @@ export default class SheepPay {
|
||||
order_sn: this.orderSN,
|
||||
payment: this.payment,
|
||||
};
|
||||
if (this.options && Number(this.options.money) > 0) {
|
||||
data.money = Number(this.options.money);
|
||||
}
|
||||
if (uni.getStorageSync('openid')) {
|
||||
data.openid = uni.getStorageSync('openid');
|
||||
}
|
||||
sheep.$api.pay.prepay(data).then((res) => {
|
||||
res.code === 1 && resolve(res);
|
||||
if (res.data === -1 && res.msg === 'miss_openid') {
|
||||
uni.showModal({
|
||||
title: '微信支付',
|
||||
content: '请先绑定微信再使用微信支付',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
sheep.$platform.useProvider('wechat').bind();
|
||||
}
|
||||
},
|
||||
});
|
||||
if (res && res.code === 1) {
|
||||
resolve(res);
|
||||
} else {
|
||||
if (res && res.data === -1 && res.msg === 'miss_openid') {
|
||||
uni.showModal({
|
||||
title: '微信支付',
|
||||
content: '请先绑定微信再使用微信支付',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
sheep.$platform.useProvider('wechat').bind();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
reject(res);
|
||||
}
|
||||
}).catch((err) => {
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -114,51 +124,75 @@ export default class SheepPay {
|
||||
// 微信公众号JSSDK支付
|
||||
async wechatOfficialAccountPay() {
|
||||
let that = this;
|
||||
let {
|
||||
code,
|
||||
data,
|
||||
msg
|
||||
} = await this.prepay();
|
||||
if (code !== 1) {
|
||||
console.log('支付错误', msg);
|
||||
return;
|
||||
}
|
||||
$wxsdk.wxpay(data.pay_data, {
|
||||
success: () => {
|
||||
try {
|
||||
let {
|
||||
code,
|
||||
data,
|
||||
msg
|
||||
} = await this.prepay();
|
||||
if (code !== 1) {
|
||||
console.log('支付错误', msg);
|
||||
return;
|
||||
}
|
||||
if (!data?.pay_data) {
|
||||
that.payResult('success');
|
||||
},
|
||||
cancel: () => {
|
||||
sheep.$helper.toast('支付已手动取消');
|
||||
},
|
||||
fail: () => {
|
||||
that.payResult('fail');
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
$wxsdk.wxpay(data.pay_data, {
|
||||
success: () => {
|
||||
that.payResult('success');
|
||||
},
|
||||
cancel: () => {
|
||||
sheep.$helper.toast('支付已手动取消');
|
||||
},
|
||||
fail: () => {
|
||||
that.payResult('fail');
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
console.log('预支付未完成:', e);
|
||||
}
|
||||
}
|
||||
|
||||
//浏览器微信H5支付
|
||||
async wechatWapPay() {
|
||||
const {
|
||||
code,
|
||||
data
|
||||
} = await this.prepay();
|
||||
if (code === 1) {
|
||||
const redirect_url = `${getRootUrl()}pages/pay/result?orderSN=${this.orderSN}&payment=${this.payment
|
||||
}&orderType=${this.orderType}`;
|
||||
location.href = `${data.pay_data.h5_url}&redirect_url=${encodeURIComponent(redirect_url)}`;
|
||||
try {
|
||||
const {
|
||||
code,
|
||||
data
|
||||
} = await this.prepay();
|
||||
if (code === 1) {
|
||||
if (!data?.pay_data) {
|
||||
this.payResult('success');
|
||||
return;
|
||||
}
|
||||
const redirect_url = `${getRootUrl()}pages/pay/result?orderSN=${this.orderSN}&payment=${this.payment
|
||||
}&orderType=${this.orderType}`;
|
||||
location.href = `${data.pay_data.h5_url}&redirect_url=${encodeURIComponent(redirect_url)}`;
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('预支付未完成:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// 支付链接
|
||||
async redirectPay() {
|
||||
let {
|
||||
code,
|
||||
data
|
||||
} = await this.prepay();
|
||||
if (code === 1) {
|
||||
const redirect_url = `${getRootUrl()}pages/pay/result?orderSN=${this.orderSN}&payment=${this.payment
|
||||
}&orderType=${this.orderType}`;
|
||||
location.href = data.pay_data + encodeURIComponent(redirect_url);
|
||||
try {
|
||||
let {
|
||||
code,
|
||||
data
|
||||
} = await this.prepay();
|
||||
if (code === 1) {
|
||||
if (!data?.pay_data) {
|
||||
this.payResult('success');
|
||||
return;
|
||||
}
|
||||
const redirect_url = `${getRootUrl()}pages/pay/result?orderSN=${this.orderSN}&payment=${this.payment
|
||||
}&orderType=${this.orderType}`;
|
||||
location.href = data.pay_data + encodeURIComponent(redirect_url);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('预支付未完成:', e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,104 +201,145 @@ export default class SheepPay {
|
||||
// 微信小程序支付
|
||||
async wechatMiniProgramPay() {
|
||||
let that = this;
|
||||
let result = await this.prepay();
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
...result.data.pay_data,
|
||||
success: (res) => {
|
||||
try {
|
||||
let result = await this.prepay();
|
||||
if (result.code !== 1) return;
|
||||
if (!result.data?.pay_data) {
|
||||
that.payResult('success');
|
||||
},
|
||||
fail: (err) => {
|
||||
if (err.errMsg === 'requestPayment:fail cancel') {
|
||||
sheep.$helper.toast('支付已手动取消');
|
||||
} else {
|
||||
that.payResult('fail');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 余额支付
|
||||
async moneyPay() {
|
||||
const {
|
||||
code
|
||||
} = await this.prepay();
|
||||
code === 1 && this.payResult('success');
|
||||
}
|
||||
|
||||
// 货到付款
|
||||
async offlinePay() {
|
||||
const {
|
||||
code
|
||||
} = await this.prepay();
|
||||
code === 1 && this.payResult('success');
|
||||
}
|
||||
|
||||
// 支付宝复制链接支付
|
||||
async copyPayLink() {
|
||||
let that = this;
|
||||
let {
|
||||
code,
|
||||
data
|
||||
} = await this.prepay();
|
||||
if (code === 1) {
|
||||
// 引入showModal 点击确认 复制链接;
|
||||
uni.showModal({
|
||||
title: '支付宝支付',
|
||||
content: '复制链接到外部浏览器',
|
||||
confirmText: '复制链接',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
sheep.$helper.copyText(data.pay_data);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 支付宝支付
|
||||
async alipay() {
|
||||
let that = this;
|
||||
const {
|
||||
code,
|
||||
data
|
||||
} = await this.prepay();
|
||||
if (code === 1) {
|
||||
return;
|
||||
}
|
||||
uni.requestPayment({
|
||||
provider: 'alipay',
|
||||
orderInfo: data.pay_data, //支付宝订单数据
|
||||
provider: 'wxpay',
|
||||
...result.data.pay_data,
|
||||
success: (res) => {
|
||||
that.payResult('success');
|
||||
},
|
||||
fail: (err) => {
|
||||
if (err.errMsg === 'requestPayment:fail [paymentAlipay:62001]user cancel') {
|
||||
if (err.errMsg === 'requestPayment:fail cancel') {
|
||||
sheep.$helper.toast('支付已手动取消');
|
||||
} else {
|
||||
that.payResult('fail');
|
||||
}
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
console.log('预支付未完成:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// 余额支付
|
||||
async moneyPay() {
|
||||
try {
|
||||
const {
|
||||
code
|
||||
} = await this.prepay();
|
||||
code === 1 && this.payResult('success');
|
||||
} catch (e) {
|
||||
console.log('余额支付未完成:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// 货到付款
|
||||
async offlinePay() {
|
||||
try {
|
||||
const {
|
||||
code
|
||||
} = await this.prepay();
|
||||
code === 1 && this.payResult('success');
|
||||
} catch (e) {
|
||||
console.log('货到付款未完成:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// 支付宝复制链接支付
|
||||
async copyPayLink() {
|
||||
let that = this;
|
||||
try {
|
||||
let {
|
||||
code,
|
||||
data
|
||||
} = await this.prepay();
|
||||
if (code === 1) {
|
||||
if (!data?.pay_data) {
|
||||
that.payResult('success');
|
||||
return;
|
||||
}
|
||||
// 引入showModal 点击确认 复制链接;
|
||||
uni.showModal({
|
||||
title: '支付宝支付',
|
||||
content: '复制链接到外部浏览器',
|
||||
confirmText: '复制链接',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
sheep.$helper.copyText(data.pay_data);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('复制支付链接未完成:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// 支付宝支付
|
||||
async alipay() {
|
||||
let that = this;
|
||||
try {
|
||||
const {
|
||||
code,
|
||||
data
|
||||
} = await this.prepay();
|
||||
if (code === 1) {
|
||||
if (!data?.pay_data) {
|
||||
that.payResult('success');
|
||||
return;
|
||||
}
|
||||
uni.requestPayment({
|
||||
provider: 'alipay',
|
||||
orderInfo: data.pay_data, //支付宝订单数据
|
||||
success: (res) => {
|
||||
that.payResult('success');
|
||||
},
|
||||
fail: (err) => {
|
||||
if (err.errMsg === 'requestPayment:fail [paymentAlipay:62001]user cancel') {
|
||||
sheep.$helper.toast('支付已手动取消');
|
||||
} else {
|
||||
that.payResult('fail');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('支付宝预支付未完成:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// 微信支付
|
||||
async wechatAppPay() {
|
||||
let that = this;
|
||||
let {
|
||||
code,
|
||||
data
|
||||
} = await this.prepay();
|
||||
if (code === 1) {
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
orderInfo: data.pay_data, //微信订单数据(官方说是string。实测为object)
|
||||
success: (res) => {
|
||||
try {
|
||||
let {
|
||||
code,
|
||||
data
|
||||
} = await this.prepay();
|
||||
if (code === 1) {
|
||||
if (!data?.pay_data) {
|
||||
that.payResult('success');
|
||||
},
|
||||
fail: (err) => {
|
||||
err.errMsg !== 'requestPayment:fail cancel' && that.payResult('fail');
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
orderInfo: data.pay_data, //微信订单数据(官方说是string。实测为object)
|
||||
success: (res) => {
|
||||
that.payResult('success');
|
||||
},
|
||||
fail: (err) => {
|
||||
err.errMsg !== 'requestPayment:fail cancel' && that.payResult('fail');
|
||||
},
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('微信App预支付未完成:', e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ const defaultUserInfo = {
|
||||
madow: '', // 马豆数量
|
||||
madow_rate: '', // 马豆汇率
|
||||
madow_value: '', // 马豆约合
|
||||
show_madow_rate: 1, // 是否显示马豆市值
|
||||
voucher_available: '', // 可用兑换券
|
||||
active_30d: true, // 近 30 日是否有本人订单
|
||||
agent_form: false,
|
||||
|
||||
在新工单中引用
屏蔽一个用户