feat(withdraw): 落地方案B一体化商城余额提现与手续费内扣模式,完善多端打款退款与对账闭环
这个提交包含在:
@@ -60,7 +60,7 @@
|
||||
class="bento-cell ss-flex-1 ss-flex-col ss-col-center metric-item"
|
||||
@tap="sheep.$router.go('/pages/commission/madow')"
|
||||
>
|
||||
<view class="item-title">dmepa数量</view>
|
||||
<view class="item-title">dmepa数量(枚)</view>
|
||||
<view class="item-detail text-primary">
|
||||
{{
|
||||
state.showMoney
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<view class="madow-hero ss-flex ss-col-bottom ss-row-between">
|
||||
<view class="hero-left ss-flex ss-col-bottom">
|
||||
<text class="hero-num">{{ formatInt(state.info.madow) }}</text>
|
||||
<text class="hero-unit">dmepa</text>
|
||||
<text class="hero-unit">枚</text>
|
||||
</view>
|
||||
<button
|
||||
v-if="state.info.can_withdraw_madow !== false && state.info.can_withdraw_madow !== 0 && state.info.can_withdraw_madow !== '0'"
|
||||
@@ -26,7 +26,7 @@
|
||||
@tap="onWithdrawMadow"
|
||||
>
|
||||
<text class="cicon-moneybag ss-m-r-6"></text>
|
||||
<text>提现</text>
|
||||
<text>兑换</text>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<view class="section-header ss-flex ss-row-between ss-col-center">
|
||||
<view class="section-title-wrap ss-flex ss-col-center">
|
||||
<view class="title-bar"></view>
|
||||
<text class="section-title">每日贡献明细</text>
|
||||
<text class="section-title">每日获得明细</text>
|
||||
</view>
|
||||
<text class="section-subtitle">按日核算入账</text>
|
||||
</view>
|
||||
@@ -81,14 +81,14 @@
|
||||
<text class="cicon-gift"></text>
|
||||
</view>
|
||||
<view class="log-main-info">
|
||||
<text class="log-title">每日贡献dmepa</text>
|
||||
<text class="log-title">每日获得dmepa</text>
|
||||
<text class="log-date">{{ item.settle_date || item.date || item.createtime || '' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="log-amount">
|
||||
<text class="amount-plus">+</text>
|
||||
<text class="amount-num">{{ formatInt(item.madow || item.amount) }}</text>
|
||||
<text class="amount-unit">dmepa</text>
|
||||
<text class="amount-unit">枚</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<!-- 兑换券核心大字数 -->
|
||||
<view class="voucher-hero ss-flex ss-col-bottom ss-row-between">
|
||||
<view class="hero-left ss-flex ss-col-bottom">
|
||||
<view class="hero-left ss-flex">
|
||||
<text class="hero-num">{{ formatVoucher(state.info.voucher_available) }}</text>
|
||||
<text class="hero-unit">个</text>
|
||||
</view>
|
||||
@@ -43,21 +43,21 @@
|
||||
<view class="card-footer ss-flex ss-row-between ss-col-center">
|
||||
<view class="footer-metric">
|
||||
<text class="metric-label">累计获得</text>
|
||||
<view class="metric-val-wrap ss-flex ss-col-bottom">
|
||||
<view class="metric-val-wrap ss-flex">
|
||||
<text class="metric-val">{{ formatVoucher(state.info.voucher_total) }}</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">
|
||||
<view class="metric-val-wrap ss-flex">
|
||||
<text class="metric-val">{{ formatVoucher(state.info.voucher_released) }}</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">
|
||||
<view class="metric-val-wrap ss-flex">
|
||||
<text class="metric-val">{{ formatVoucher(state.info.voucher_used) }}</text>
|
||||
<text class="metric-unit">个</text>
|
||||
</view>
|
||||
@@ -72,7 +72,7 @@
|
||||
<view class="title-bar"></view>
|
||||
<text class="section-title">订单释放计划</text>
|
||||
</view>
|
||||
<text class="section-subtitle">按日释放明细</text>
|
||||
<text class="section-subtitle">按日释放明细<text v-if="state.plans.length > 0"> · 共 {{ state.plans.length }} 笔</text></text>
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
@@ -91,28 +91,50 @@
|
||||
:key="item.id || index"
|
||||
@tap="onOpenPlan(item)"
|
||||
>
|
||||
<view class="log-top ss-flex ss-row-between ss-col-center">
|
||||
<view class="log-title-box ss-flex ss-col-center">
|
||||
<view class="coin-icon ss-flex ss-row-center ss-col-center">
|
||||
<text class="cicon-voucher"></text>
|
||||
<!-- 卡片顶栏:订单号 + 复制 + 独立状态标签(彻底解耦宽度,杜绝折行) -->
|
||||
<view class="card-head ss-flex ss-row-between ss-col-center">
|
||||
<view class="order-box ss-flex ss-col-center">
|
||||
<view class="ticket-badge ss-flex ss-row-center ss-col-center">
|
||||
<text class="cicon-ticket"></text>
|
||||
</view>
|
||||
<view class="log-main-info">
|
||||
<text class="log-title">订单 #{{ item.order_sn || item.order_id || '--' }}</text>
|
||||
<text class="log-date">起算日期: {{ item.start_date || item.createtime || '--' }}</text>
|
||||
<text class="order-sn">订单 #{{ item.order_sn || item.order_id || '--' }}</text>
|
||||
<view
|
||||
v-if="item.order_sn || item.order_id"
|
||||
class="copy-btn ss-flex ss-row-center ss-col-center"
|
||||
@tap.stop="onCopy(item.order_sn || item.order_id)"
|
||||
>
|
||||
<text class="cicon-file-copy-o"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="log-amount ss-flex ss-col-center">
|
||||
<text class="amount-num">{{ formatVoucher(item.total_amount || item.total || item.voucher_total) }} 个</text>
|
||||
<text class="amount-status ss-m-l-12" :class="item.status === 2 ? 'finished' : 'releasing'">
|
||||
{{ item.status_text || (item.status === 2 ? '已完成' : '释放中') }}
|
||||
</text>
|
||||
<view class="status-badge" :class="item.status === 2 ? 'finished' : 'releasing'">
|
||||
<text class="badge-dot"></text>
|
||||
<text class="badge-text">{{ item.status_text || (item.status === 2 ? '已完成' : '释放中') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 卡片主体核心区:获赠总额 & 起算日期 -->
|
||||
<view class="card-core ss-flex ss-row-between ss-col-center">
|
||||
<view class="core-metric-left">
|
||||
<text class="metric-subtitle">获赠兑换券</text>
|
||||
<view class="metric-number-box ss-flex ss-col-bottom">
|
||||
<text class="metric-big-num">{{ formatVoucher(item.total_amount || item.total || item.voucher_total) }}</text>
|
||||
<text class="metric-unit-text">个</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="core-metric-right ss-flex-col ss-col-bottom">
|
||||
<text class="date-subtitle">起算日期</text>
|
||||
<text class="date-val-text">{{ item.start_date || item.createtime || '--' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 释放天数进度条 -->
|
||||
<view class="plan-progress-box ss-m-t-20">
|
||||
<view class="progress-info ss-flex ss-row-between ss-col-center ss-m-b-8">
|
||||
<text class="progress-txt">第 {{ planDay(item) }} / {{ planTotal(item) }} 天</text>
|
||||
<view class="plan-progress-box">
|
||||
<view class="progress-info ss-flex ss-row-between ss-col-center">
|
||||
<view class="progress-txt-box ss-flex ss-col-center">
|
||||
<text class="progress-lbl">释放进度</text>
|
||||
<text class="progress-day-highlight">第 {{ planDay(item) }}</text>
|
||||
<text class="progress-day-total"> / {{ planTotal(item) }} 天</text>
|
||||
</view>
|
||||
<text class="progress-percent">{{ planProgress(item) }}</text>
|
||||
</view>
|
||||
<view class="progress-bar">
|
||||
@@ -120,22 +142,39 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 详细指标标签 -->
|
||||
<view class="log-tags ss-flex ss-col-center ss-m-t-16">
|
||||
<view class="tag-item">
|
||||
<text class="tag-txt">已释放 {{ formatVoucher(item.released_amount || item.released) }} 个</text>
|
||||
<!-- 3列结构化指标卡(已释放 / 每日释放 / 待释放) -->
|
||||
<view class="metrics-grid ss-flex ss-row-between ss-col-center">
|
||||
<view class="grid-col ss-flex-col ss-col-center">
|
||||
<text class="grid-lbl">已释放</text>
|
||||
<view class="grid-val-wrap ss-flex ss-col-bottom ss-row-center">
|
||||
<text class="grid-num highlight">{{ formatVoucher(item.released_amount || item.released) }}</text>
|
||||
<text class="grid-unit">个</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tag-item" v-if="item.daily_amount">
|
||||
<text class="tag-txt">每日释放 {{ formatVoucher(item.daily_amount) }} 个</text>
|
||||
<view class="grid-divider"></view>
|
||||
<view class="grid-col ss-flex-col ss-col-center">
|
||||
<text class="grid-lbl">每日释放</text>
|
||||
<view class="grid-val-wrap ss-flex ss-col-bottom ss-row-center">
|
||||
<text class="grid-num">{{ formatVoucher(item.daily_amount || (item.total_amount ? (item.total_amount / (planTotal(item) || 365)).toFixed(2) : 0)) }}</text>
|
||||
<text class="grid-unit">个</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tag-item" v-if="calcRemain(item) !== null">
|
||||
<text class="tag-txt">待释放 {{ formatVoucher(calcRemain(item)) }} 个</text>
|
||||
<view class="grid-divider"></view>
|
||||
<view class="grid-col ss-flex-col ss-col-center">
|
||||
<text class="grid-lbl">待释放</text>
|
||||
<view class="grid-val-wrap ss-flex ss-col-bottom ss-row-center">
|
||||
<text class="grid-num">{{ formatVoucher(calcRemain(item)) }}</text>
|
||||
<text class="grid-unit">个</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 交互提示条 -->
|
||||
<view class="plan-card-action ss-flex ss-row-between ss-col-center ss-m-t-16">
|
||||
<text class="action-tip">按日线性释放</text>
|
||||
<!-- 卡片底部引导条 -->
|
||||
<view class="card-action-bar ss-flex ss-row-between ss-col-center">
|
||||
<view class="action-hint ss-flex ss-col-center">
|
||||
<text class="hint-dot"></text>
|
||||
<text class="action-tip">按日线性释放 · 每日自动入账</text>
|
||||
</view>
|
||||
<view class="action-right ss-flex ss-col-center">
|
||||
<text class="action-text">查看释放明细</text>
|
||||
<text class="cicon-forward action-arrow ss-m-l-4"></text>
|
||||
@@ -164,28 +203,38 @@
|
||||
<view class="logs-plan-summary" v-if="state.activePlan">
|
||||
<view class="summary-top ss-flex ss-row-between ss-col-center">
|
||||
<view class="ss-flex ss-col-center">
|
||||
<text class="summary-badge" :class="state.activePlan.status === 2 ? 'finished' : 'releasing'">
|
||||
{{ state.activePlan.status_text || (state.activePlan.status === 2 ? '已完成' : '释放中') }}
|
||||
</text>
|
||||
<text class="summary-day">第 {{ planDay(state.activePlan) }} / {{ planTotal(state.activePlan) }} 天</text>
|
||||
<view class="status-badge" :class="state.activePlan.status === 2 ? 'finished' : 'releasing'">
|
||||
<text class="badge-dot"></text>
|
||||
<text class="badge-text">{{ state.activePlan.status_text || (state.activePlan.status === 2 ? '已完成' : '释放中') }}</text>
|
||||
</view>
|
||||
<text class="summary-day ss-m-l-12">第 {{ planDay(state.activePlan) }} / {{ planTotal(state.activePlan) }} 天</text>
|
||||
</view>
|
||||
<text class="summary-percent">{{ planProgress(state.activePlan) }}</text>
|
||||
</view>
|
||||
<view class="summary-progress-bar ss-m-t-12">
|
||||
<view class="summary-progress-bar ss-m-t-16">
|
||||
<view class="summary-progress-inner" :style="{ width: planProgress(state.activePlan) }"></view>
|
||||
</view>
|
||||
<view class="summary-metrics ss-flex ss-row-between ss-col-center ss-m-t-16">
|
||||
<view class="metric-col">
|
||||
<view class="summary-metrics-grid ss-flex ss-row-between ss-col-center ss-m-t-20">
|
||||
<view class="metric-col ss-flex-col ss-col-center">
|
||||
<text class="m-lbl">已释放</text>
|
||||
<text class="m-val highlight">{{ formatVoucher(state.activePlan.released_amount) }} 个</text>
|
||||
<view class="m-val-wrap ss-flex ss-col-bottom">
|
||||
<text class="m-val highlight">{{ formatVoucher(state.activePlan.released_amount) }}</text>
|
||||
<text class="m-unit">个</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="metric-col">
|
||||
<view class="metric-col ss-flex-col ss-col-center">
|
||||
<text class="m-lbl">每日释放</text>
|
||||
<text class="m-val">{{ formatVoucher(state.activePlan.daily_amount) }} 个</text>
|
||||
<view class="m-val-wrap ss-flex ss-col-bottom">
|
||||
<text class="m-val">{{ formatVoucher(state.activePlan.daily_amount) }}</text>
|
||||
<text class="m-unit">个</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="metric-col">
|
||||
<view class="metric-col ss-flex-col ss-col-center">
|
||||
<text class="m-lbl">待释放</text>
|
||||
<text class="m-val">{{ formatVoucher(calcRemain(state.activePlan)) }} 个</text>
|
||||
<view class="m-val-wrap ss-flex ss-col-bottom">
|
||||
<text class="m-val">{{ formatVoucher(calcRemain(state.activePlan)) }}</text>
|
||||
<text class="m-unit">个</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -324,6 +373,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
function onCopy(sn) {
|
||||
if (!sn || sn === '--') return;
|
||||
sheep.$helper.copyText(String(sn));
|
||||
}
|
||||
|
||||
function onCloseLogs() {
|
||||
state.showLogs = false;
|
||||
}
|
||||
@@ -481,19 +535,22 @@
|
||||
z-index: 2;
|
||||
|
||||
.hero-left {
|
||||
align-items: baseline;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
|
||||
.hero-symbol {
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
color: #ffffff;
|
||||
margin-right: 6rpx;
|
||||
margin-bottom: 6rpx;
|
||||
}
|
||||
|
||||
.hero-num {
|
||||
font-size: 64rpx;
|
||||
font-weight: 700;
|
||||
color: #ffffff;
|
||||
line-height: 1.1;
|
||||
line-height: 1;
|
||||
font-family: OPPOSANS, DIN, -apple-system, sans-serif;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
@@ -502,8 +559,8 @@
|
||||
font-size: 26rpx;
|
||||
color: #f4d397;
|
||||
font-weight: 600;
|
||||
margin-left: 12rpx;
|
||||
margin-bottom: 6rpx;
|
||||
margin-left: 10rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -572,16 +629,18 @@
|
||||
}
|
||||
|
||||
.metric-val-wrap {
|
||||
align-items: baseline;
|
||||
white-space: nowrap;
|
||||
|
||||
.currency-symbol {
|
||||
font-size: 24rpx;
|
||||
color: #f4d397;
|
||||
font-weight: 600;
|
||||
margin-right: 2rpx;
|
||||
margin-bottom: 2rpx;
|
||||
}
|
||||
|
||||
.metric-val {
|
||||
font-size: 30rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: #f4d397;
|
||||
font-family: OPPOSANS, DIN, -apple-system, sans-serif;
|
||||
@@ -591,8 +650,8 @@
|
||||
font-size: 22rpx;
|
||||
color: #f4d397;
|
||||
font-weight: 500;
|
||||
margin-left: 4rpx;
|
||||
margin-bottom: 2rpx;
|
||||
margin-left: 6rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -630,98 +689,200 @@
|
||||
padding: 60rpx 0;
|
||||
}
|
||||
|
||||
/* 通用状态胶囊标签 */
|
||||
.status-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
height: 40rpx;
|
||||
padding: 0 16rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
|
||||
.badge-dot {
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
&.releasing {
|
||||
color: #b58028;
|
||||
background: #fdf7ed;
|
||||
border: 1rpx solid rgba(181, 128, 40, 0.22);
|
||||
|
||||
.badge-dot {
|
||||
background-color: #e6a23c;
|
||||
box-shadow: 0 0 6rpx rgba(230, 162, 60, 0.6);
|
||||
}
|
||||
}
|
||||
|
||||
&.finished {
|
||||
color: #0d9488;
|
||||
background: #f0fdf4;
|
||||
border: 1rpx solid rgba(13, 148, 136, 0.22);
|
||||
|
||||
.badge-dot {
|
||||
background-color: #10b981;
|
||||
box-shadow: 0 0 6rpx rgba(16, 185, 129, 0.6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 计划卡片列表 */
|
||||
.list-container {
|
||||
padding: 0 30rpx 20rpx;
|
||||
padding: 0 30rpx 24rpx;
|
||||
|
||||
.log-card {
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
padding: 26rpx 28rpx;
|
||||
border-radius: 24rpx;
|
||||
padding: 28rpx 28rpx 22rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(35, 42, 60, 0.04);
|
||||
border: 1rpx solid #f0f1f5;
|
||||
box-shadow: 0 6rpx 20rpx rgba(35, 42, 60, 0.04);
|
||||
border: 1rpx solid #edf0f5;
|
||||
|
||||
.log-top {
|
||||
.log-title-box {
|
||||
.coin-icon {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
border-radius: 50%;
|
||||
/* 卡片顶栏:订单号 + 复制 + 状态 */
|
||||
.card-head {
|
||||
.order-box {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-right: 16rpx;
|
||||
|
||||
.ticket-badge {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 10rpx;
|
||||
background: linear-gradient(135deg, #fef4e2 0%, #fae6c3 100%);
|
||||
margin-right: 18rpx;
|
||||
flex-shrink: 0;
|
||||
|
||||
.cicon-voucher {
|
||||
font-size: 32rpx;
|
||||
color: #bf8d3b;
|
||||
.cicon-ticket {
|
||||
font-size: 22rpx;
|
||||
color: #b58028;
|
||||
}
|
||||
}
|
||||
|
||||
.log-main-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.order-sn {
|
||||
font-size: 24rpx;
|
||||
color: #4b5563;
|
||||
font-weight: 500;
|
||||
margin-left: 12rpx;
|
||||
max-width: 380rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.log-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #23272e;
|
||||
margin-bottom: 6rpx;
|
||||
.copy-btn {
|
||||
padding: 4rpx 8rpx;
|
||||
margin-left: 8rpx;
|
||||
color: #9ca3af;
|
||||
font-size: 24rpx;
|
||||
cursor: pointer;
|
||||
transition: color 0.15s ease;
|
||||
|
||||
&:active {
|
||||
color: #b58028;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 核心区:获赠总额 & 起算日期 */
|
||||
.card-core {
|
||||
margin-top: 22rpx;
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 1rpx dashed #f0f2f6;
|
||||
|
||||
.core-metric-left {
|
||||
.metric-subtitle {
|
||||
font-size: 22rpx;
|
||||
color: #8c93a0;
|
||||
font-weight: 400;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
|
||||
.metric-number-box {
|
||||
align-items: baseline;
|
||||
white-space: nowrap;
|
||||
|
||||
.metric-big-num {
|
||||
font-size: 42rpx;
|
||||
font-weight: 700;
|
||||
color: #1e2229;
|
||||
font-family: OPPOSANS, DIN, -apple-system, sans-serif;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.log-date {
|
||||
font-size: 22rpx;
|
||||
color: #9ea4af;
|
||||
.metric-unit-text {
|
||||
font-size: 24rpx;
|
||||
color: #8c93a0;
|
||||
font-weight: 500;
|
||||
margin-left: 8rpx;
|
||||
margin-bottom: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.log-amount {
|
||||
.amount-num {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #23272e;
|
||||
font-family: OPPOSANS, DIN, -apple-system, sans-serif;
|
||||
.core-metric-right {
|
||||
.date-subtitle {
|
||||
font-size: 22rpx;
|
||||
color: #8c93a0;
|
||||
font-weight: 400;
|
||||
margin-bottom: 6rpx;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.amount-status {
|
||||
font-size: 20rpx;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 6rpx;
|
||||
|
||||
&.releasing {
|
||||
color: #b58028;
|
||||
background-color: #fef5e7;
|
||||
}
|
||||
|
||||
&.finished {
|
||||
color: #10b981;
|
||||
background-color: #e6f9f0;
|
||||
}
|
||||
.date-val-text {
|
||||
font-size: 24rpx;
|
||||
color: #4b5563;
|
||||
font-weight: 500;
|
||||
font-family: OPPOSANS, DIN, -apple-system, sans-serif;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 进度条 */
|
||||
.plan-progress-box {
|
||||
margin-top: 20rpx;
|
||||
|
||||
.progress-info {
|
||||
.progress-txt {
|
||||
font-size: 22rpx;
|
||||
color: #6b7280;
|
||||
.progress-txt-box {
|
||||
.progress-lbl {
|
||||
font-size: 22rpx;
|
||||
color: #6b7280;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.progress-day-highlight {
|
||||
font-size: 24rpx;
|
||||
color: #b58028;
|
||||
font-weight: 700;
|
||||
font-family: OPPOSANS, DIN, -apple-system, sans-serif;
|
||||
}
|
||||
|
||||
.progress-day-total {
|
||||
font-size: 22rpx;
|
||||
color: #8c93a0;
|
||||
}
|
||||
}
|
||||
|
||||
.progress-percent {
|
||||
font-size: 22rpx;
|
||||
font-size: 24rpx;
|
||||
color: #b58028;
|
||||
font-weight: 600;
|
||||
font-family: OPPOSANS;
|
||||
font-weight: 700;
|
||||
font-family: OPPOSANS, DIN, -apple-system, sans-serif;
|
||||
}
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 12rpx;
|
||||
background: #f1f3f6;
|
||||
background: #eef1f6;
|
||||
border-radius: 6rpx;
|
||||
overflow: hidden;
|
||||
margin-top: 10rpx;
|
||||
|
||||
.progress-inner {
|
||||
height: 100%;
|
||||
@@ -732,31 +893,74 @@
|
||||
}
|
||||
}
|
||||
|
||||
.log-tags {
|
||||
flex-wrap: wrap;
|
||||
gap: 12rpx;
|
||||
/* 3列结构化面板 */
|
||||
.metrics-grid {
|
||||
margin-top: 22rpx;
|
||||
background: #f9fafc;
|
||||
border-radius: 16rpx;
|
||||
padding: 18rpx 0;
|
||||
border: 1rpx solid #f1f3f7;
|
||||
|
||||
.tag-item {
|
||||
background-color: #f7f8fb;
|
||||
border-radius: 8rpx;
|
||||
padding: 6rpx 14rpx;
|
||||
.grid-col {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
|
||||
.tag-txt {
|
||||
font-size: 22rpx;
|
||||
color: #6b7280;
|
||||
.grid-lbl {
|
||||
font-size: 20rpx;
|
||||
color: #8c93a0;
|
||||
margin-bottom: 6rpx;
|
||||
}
|
||||
|
||||
.grid-val-wrap {
|
||||
align-items: baseline;
|
||||
white-space: nowrap;
|
||||
|
||||
.grid-num {
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
color: #23272e;
|
||||
font-family: OPPOSANS, DIN, -apple-system, sans-serif;
|
||||
|
||||
&.highlight {
|
||||
color: #b58028;
|
||||
}
|
||||
}
|
||||
|
||||
.grid-unit {
|
||||
font-size: 20rpx;
|
||||
color: #8c93a0;
|
||||
margin-left: 4rpx;
|
||||
margin-bottom: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.grid-divider {
|
||||
width: 1rpx;
|
||||
height: 32rpx;
|
||||
background-color: #e5e7eb;
|
||||
}
|
||||
}
|
||||
|
||||
/* 交互引导条 */
|
||||
.plan-card-action {
|
||||
.card-action-bar {
|
||||
padding-top: 18rpx;
|
||||
margin-top: 18rpx;
|
||||
border-top: 1rpx dashed #edf0f5;
|
||||
|
||||
.action-tip {
|
||||
font-size: 22rpx;
|
||||
color: #9ca3af;
|
||||
.action-hint {
|
||||
.hint-dot {
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #d1d5db;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.action-tip {
|
||||
font-size: 22rpx;
|
||||
color: #9ca3af;
|
||||
}
|
||||
}
|
||||
|
||||
.action-right {
|
||||
@@ -815,23 +1019,6 @@
|
||||
padding: 22rpx 24rpx;
|
||||
|
||||
.summary-top {
|
||||
.summary-badge {
|
||||
font-size: 20rpx;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 6rpx;
|
||||
margin-right: 12rpx;
|
||||
|
||||
&.releasing {
|
||||
color: #b58028;
|
||||
background-color: #fef5e7;
|
||||
}
|
||||
|
||||
&.finished {
|
||||
color: #10b981;
|
||||
background-color: #e6f9f0;
|
||||
}
|
||||
}
|
||||
|
||||
.summary-day {
|
||||
font-size: 24rpx;
|
||||
color: #374151;
|
||||
@@ -860,10 +1047,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
.summary-metrics {
|
||||
.summary-metrics-grid {
|
||||
background: #ffffff;
|
||||
border-radius: 12rpx;
|
||||
padding: 16rpx 0;
|
||||
border: 1rpx solid #f0f2f7;
|
||||
|
||||
.metric-col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
|
||||
.m-lbl {
|
||||
font-size: 20rpx;
|
||||
@@ -871,13 +1063,25 @@
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
|
||||
.m-val {
|
||||
font-size: 24rpx;
|
||||
color: #374151;
|
||||
font-weight: 600;
|
||||
.m-val-wrap {
|
||||
align-items: baseline;
|
||||
white-space: nowrap;
|
||||
|
||||
&.highlight {
|
||||
color: #b58028;
|
||||
.m-val {
|
||||
font-size: 24rpx;
|
||||
color: #374151;
|
||||
font-weight: 600;
|
||||
font-family: OPPOSANS, DIN, -apple-system, sans-serif;
|
||||
|
||||
&.highlight {
|
||||
color: #b58028;
|
||||
}
|
||||
}
|
||||
|
||||
.m-unit {
|
||||
font-size: 20rpx;
|
||||
color: #9ca3af;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
<view class="title ss-m-l-20 ss-m-r-20">详情</view>
|
||||
</view>
|
||||
<view class="card-content">
|
||||
<mp-html :content="content"></mp-html>
|
||||
<mp-html v-if="content" :content="content" :domain="sheep.$url.cdn()"></mp-html>
|
||||
<view v-else class="empty-content ss-p-b-40 ss-text-center ss-font-26 ss-m-t-20 text-gray">
|
||||
暂无商品图文详情
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -118,7 +118,7 @@ onPageScroll(() => { });
|
||||
const state = reactive({
|
||||
goodsId: 0,
|
||||
skeletonLoading: true,
|
||||
goodsInfo: {},
|
||||
goodsInfo: null,
|
||||
showSelectSku: false,
|
||||
goodsSwiper: [],
|
||||
selectedSkuPrice: {},
|
||||
@@ -138,7 +138,7 @@ const currentGoodsInfo = computed(() => {
|
||||
sales: state.selectedSkuPrice.sales,
|
||||
};
|
||||
}
|
||||
return state.goodsInfo;
|
||||
return state.goodsInfo || {};
|
||||
});
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ function onBuy(e) {
|
||||
}
|
||||
//营销活动
|
||||
function onActivity() {
|
||||
state.activityInfo = state.goodsInfo.promos;
|
||||
state.activityInfo = state.goodsInfo?.promos || [];
|
||||
state.showActivityModel = true;
|
||||
}
|
||||
|
||||
@@ -203,39 +203,47 @@ const shareInfo = computed(() => {
|
||||
type: 'goods', // 商品海报
|
||||
title: state.goodsInfo.title, // 商品标题
|
||||
image: sheep.$url.cdn(state.goodsInfo.image), // 商品主图
|
||||
price: state.goodsInfo.price[0], // 商品价格
|
||||
price: state.goodsInfo.price?.[0], // 商品价格
|
||||
original_price: state.goodsInfo.original_price, // 商品原价
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
async function getGoodsDetail() {
|
||||
const { code, data } = await sheep.$api.goods.detail(state.goodsId)
|
||||
if (code === 1) {
|
||||
try {
|
||||
const { code, data } = await sheep.$api.goods.detail(state.goodsId);
|
||||
if (code === 1 && data) {
|
||||
state.goodsInfo = data;
|
||||
state.goodsSwiper = formatGoodsSwiper(state.goodsInfo.images || []);
|
||||
} else {
|
||||
// 未找到商品或已下架
|
||||
state.goodsInfo = null;
|
||||
}
|
||||
} catch (err) {
|
||||
state.goodsInfo = null;
|
||||
} finally {
|
||||
state.skeletonLoading = false;
|
||||
state.goodsInfo = data;
|
||||
state.goodsSwiper = formatGoodsSwiper(state.goodsInfo.images);
|
||||
} else {
|
||||
// 未找到商品
|
||||
state.goodsInfo = {};
|
||||
}
|
||||
}
|
||||
|
||||
onLoad(async (options) => {
|
||||
// 兼容 options.id 或 options.goods_id 参数
|
||||
const id = options?.id || options?.goods_id;
|
||||
// 非法参数
|
||||
if (!options.id) {
|
||||
state.goodsInfo = {}
|
||||
toast('商品不存在')
|
||||
$router.back()
|
||||
return
|
||||
if (!id) {
|
||||
state.skeletonLoading = false;
|
||||
state.goodsInfo = null;
|
||||
sheep.$helper.toast('商品不存在');
|
||||
sheep.$router.back();
|
||||
return;
|
||||
}
|
||||
state.goodsId = options.id;
|
||||
state.goodsId = id;
|
||||
// 加载商品信息
|
||||
getGoodsDetail();
|
||||
|
||||
const { code, data } = await sheep.$api.coupon.listByGoods(state.goodsId);
|
||||
if (code === 1) {
|
||||
state.couponInfo = data;
|
||||
state.couponInfo = data || [];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -17,13 +17,20 @@
|
||||
预估总市值:¥{{ state.madowInfo.madow_value || '0.00' }} (1 dmepa ≈ ¥{{ state.madowInfo.madow_rate || '0' }})
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
<view class="" v-else-if="state.walletType === 'commission'">
|
||||
<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>
|
||||
<view class="" v-else>
|
||||
<view class="num-title">可提现金额(元)</view>
|
||||
<view class="wallet-num">{{ userInfo.money || '0.00' }}</view>
|
||||
<view class="ss-m-t-10" style="font-size: 22rpx; color: rgba(255,255,255,0.85);" v-if="Number(userInfo.commission || 0) > 0">
|
||||
历史存量佣金:¥{{ userInfo.commission || '0.00' }}
|
||||
</view>
|
||||
</view>
|
||||
<button class="ss-reset-button log-btn" @tap="sheep.$router.go('/pages/pay/withdraw-log')"
|
||||
>提现记录</button
|
||||
>
|
||||
@@ -39,6 +46,20 @@
|
||||
>
|
||||
全部提现
|
||||
</text>
|
||||
<text
|
||||
v-else-if="state.walletType === 'commission' && Number(userInfo.commission || 0) > 0"
|
||||
style="font-size: 24rpx; color: #b78328; font-weight: 500;"
|
||||
@tap="onWithdrawAllCommission"
|
||||
>
|
||||
全部提现
|
||||
</text>
|
||||
<text
|
||||
v-else-if="state.walletType !== 'madow' && Number(userInfo.money || 0) > 0"
|
||||
style="font-size: 24rpx; color: #b78328; font-weight: 500;"
|
||||
@tap="onWithdrawAllMoney"
|
||||
>
|
||||
全部提现
|
||||
</text>
|
||||
</view>
|
||||
<view class="input-box ss-flex ss-col-center border-bottom">
|
||||
<view class="unit">¥</view>
|
||||
@@ -54,9 +75,15 @@
|
||||
v-if="state.walletType === 'madow' && Number(state.amount) > 0"
|
||||
style="padding: 12rpx 0 16rpx; font-size: 22rpx; color: #999;"
|
||||
>
|
||||
预计扣除约 {{ estimatedDeductMadow }} dmepa(实时汇率 1 dmepa ≈ ¥{{ state.madowInfo.madow_rate || '0' }})
|
||||
预计扣除约 {{ estimatedDeductMadow }} 枚(实时汇率 1 dmepa ≈ ¥{{ state.madowInfo.madow_rate || '0' }})
|
||||
</view>
|
||||
<view class="bank-box ss-flex ss-col-center ss-row-between ss-m-b-30" :style="state.walletType === 'madow' && Number(state.amount) > 0 ? 'margin-top: 10rpx;' : ''">
|
||||
<view
|
||||
v-else-if="state.walletType !== 'madow' && Number(state.amount) > 0"
|
||||
style="padding: 12rpx 0 16rpx; font-size: 22rpx; color: #ff6000;"
|
||||
>
|
||||
预计到账:¥{{ estimatedArrivalMoney }}(手续费内扣 ¥{{ estimatedChargeFee }})
|
||||
</view>
|
||||
<view class="bank-box ss-flex ss-col-center ss-row-between ss-m-b-30" :style="Number(state.amount) > 0 ? 'margin-top: 10rpx;' : ''">
|
||||
<view class="name">提现至</view>
|
||||
<view class="bank-list ss-flex ss-col-center" @tap="onAccountSelect(true)">
|
||||
<view v-if="!state.accountInfo.type" class="empty-text">请选择提现方式</view>
|
||||
@@ -88,7 +115,7 @@
|
||||
<view class="draw-notice">
|
||||
<view class="title ss-m-b-20">提现说明</view>
|
||||
<view class="tip-banner ss-m-b-20" v-if="state.walletType !== 'madow'" style="background: #fff8f2; color: #ff6000; font-size: 22rpx; padding: 16rpx 20rpx; border-radius: 12rpx; line-height: 1.5;">
|
||||
💡 提示:商城收益分成已全额直接入账商城余额,可用于下单直接抵扣。历史存量佣金可转入商城余额消费。
|
||||
💡 提示:商城收益分成已全额直接入账商城余额,支持随时申请提现至银行卡/微信/支付宝,也可用于下单直接抵扣。历史存量佣金可转入商城余额消费。
|
||||
</view>
|
||||
<view class="tip-banner ss-m-b-20" v-else style="background: #fdfbf7; color: #b78328; font-size: 22rpx; padding: 16rpx 20rpx; border-radius: 12rpx; line-height: 1.5;">
|
||||
💡 提示:dmepa 按大盘实时汇率折算为现金扣除持仓,提现渠道限定为银行卡转账。审核驳回后对应 dmepa 将全额原路退回。
|
||||
@@ -146,7 +173,7 @@
|
||||
}
|
||||
|
||||
if (rules.charge_rate_format > 0) {
|
||||
list.push(`每次收取提现手续费 ${rules.charge_rate_format}%;`);
|
||||
list.push(`每次收取提现手续费 ${rules.charge_rate_format}%(从提现金额中扣除);`);
|
||||
}
|
||||
list.push(
|
||||
`提现申请后将${rules.auto_arrival ? '自动' : '审核后'}到账, 到账结果请查收对应渠道服务通知;`,
|
||||
@@ -159,7 +186,7 @@
|
||||
const userStore = sheep.$store('user');
|
||||
const userInfo = computed(() => userStore.userInfo);
|
||||
const state = reactive({
|
||||
walletType: '',
|
||||
walletType: 'money',
|
||||
amount: '',
|
||||
type: '',
|
||||
accountInfo: {},
|
||||
@@ -191,12 +218,37 @@
|
||||
return deduct.toFixed(4);
|
||||
});
|
||||
|
||||
const estimatedChargeFee = computed(() => {
|
||||
if (!state.amount || Number(state.amount) <= 0 || !state.rules.charge_rate) return '0.00';
|
||||
const charge = Number(state.amount) * Number(state.rules.charge_rate);
|
||||
return charge.toFixed(2);
|
||||
});
|
||||
|
||||
const estimatedArrivalMoney = computed(() => {
|
||||
if (!state.amount || Number(state.amount) <= 0) return '0.00';
|
||||
const charge = Number(state.amount) * Number(state.rules.charge_rate || 0);
|
||||
const arrival = Math.max(0, Number(state.amount) - charge);
|
||||
return arrival.toFixed(2);
|
||||
});
|
||||
|
||||
function onWithdrawAllMadow() {
|
||||
if (state.madowInfo.madow_value) {
|
||||
state.amount = String(state.madowInfo.madow_value);
|
||||
}
|
||||
}
|
||||
|
||||
function onWithdrawAllMoney() {
|
||||
if (userInfo.value?.money) {
|
||||
state.amount = String(userInfo.value.money);
|
||||
}
|
||||
}
|
||||
|
||||
function onWithdrawAllCommission() {
|
||||
if (userInfo.value?.commission) {
|
||||
state.amount = String(userInfo.value.commission);
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchUserBankAccount() {
|
||||
try {
|
||||
let res = await sheep.$api.user.account.info({
|
||||
@@ -255,6 +307,7 @@
|
||||
|
||||
let payload = {
|
||||
money: state.amount,
|
||||
wallet_type: state.walletType,
|
||||
...state.accountInfo,
|
||||
};
|
||||
|
||||
@@ -275,8 +328,20 @@
|
||||
sheep.$helper.toast('提现金额超出持有dmepa可用市值');
|
||||
return;
|
||||
}
|
||||
} else if (state.walletType === 'commission') {
|
||||
payload.wallet_type = 'commission';
|
||||
if (Number(payload.money) > Number(userInfo.value?.commission || 0) || Number(payload.money) <= 0) {
|
||||
sheep.$helper.toast('请输入正确的提现金额');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!payload.type) {
|
||||
sheep.$helper.toast('请选择提现方式');
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (payload.money > userInfo.commission || payload.money <= 0) {
|
||||
payload.wallet_type = 'money';
|
||||
if (Number(payload.money) > Number(userInfo.value?.money || 0) || Number(payload.money) <= 0) {
|
||||
sheep.$helper.toast('请输入正确的提现金额');
|
||||
return;
|
||||
}
|
||||
@@ -302,17 +367,17 @@
|
||||
sheep.$platform.useProvider('wechat').bind();
|
||||
}
|
||||
if (code === 1) {
|
||||
// 刷新用户佣金余额
|
||||
// 刷新用户佣金与商城余额
|
||||
userStore.getInfo();
|
||||
if (state.walletType === 'madow') {
|
||||
getMadowInfo();
|
||||
sheep.$helper.toast('提现申请已提交,等待审核打款');
|
||||
setTimeout(() => {
|
||||
sheep.$router.go('/pages/pay/withdraw-log');
|
||||
}, 1500);
|
||||
}
|
||||
sheep.$helper.toast('提现申请已提交,等待审核打款');
|
||||
setTimeout(() => {
|
||||
sheep.$router.go('/pages/pay/withdraw-log');
|
||||
}, 1500);
|
||||
|
||||
if (payload.type === 'wechat') {
|
||||
if (payload.type === 'wechat' && data?.transfer_data) {
|
||||
sheep.$platform.useProvider('wechat').transfer(data.transfer_data);
|
||||
}
|
||||
}
|
||||
@@ -361,6 +426,10 @@
|
||||
state.accountInfo.type = 'bank';
|
||||
await getMadowInfo();
|
||||
fetchUserBankAccount();
|
||||
} else if (options?.type === 'commission') {
|
||||
state.walletType = 'commission';
|
||||
} else {
|
||||
state.walletType = 'money';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
<view class="title-box ss-flex ss-row-between ss-m-b-20">
|
||||
<view class="ss-flex ss-col-center">
|
||||
<text class="title ss-line-1"
|
||||
>{{ item.event_text }}{{ item.memo ? '-' + item.memo : '' }}</text
|
||||
>{{ formatLogTitle(item) }}</text
|
||||
>
|
||||
<text
|
||||
v-if="item.type === 'money'"
|
||||
@@ -181,6 +181,22 @@
|
||||
today: '',
|
||||
});
|
||||
|
||||
function formatLogTitle(item) {
|
||||
if (!item) return '';
|
||||
const event = item.event || '';
|
||||
const eventText = item.event_text || '';
|
||||
const memo = item.memo || '';
|
||||
|
||||
if (event === 'admin_recharge' || eventText === '后台-余额充值' || eventText === '后台-积分充值' || eventText === '合约调用') {
|
||||
if (!memo || memo === '后台管理调整余额' || memo === '后台管理调整积分' || memo === '合约调用') {
|
||||
return '合约调用';
|
||||
}
|
||||
return `合约调用-${memo}`;
|
||||
}
|
||||
|
||||
return `${eventText}${memo ? '-' + memo : ''}`;
|
||||
}
|
||||
|
||||
const tabMaps = [
|
||||
{
|
||||
name: '全部',
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<text :class="item.amount >= 0 ? 'cicon-wallet' : 'cicon-order'"></text>
|
||||
</view>
|
||||
<view class="log-main-info">
|
||||
<text class="log-title">{{ item.event_text }}{{ item.memo ? ' · ' + item.memo : '' }}</text>
|
||||
<text class="log-title">{{ formatLogTitle(item) }}</text>
|
||||
<text class="log-date">{{ item.createtime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -172,6 +172,22 @@
|
||||
today: '',
|
||||
});
|
||||
|
||||
function formatLogTitle(item) {
|
||||
if (!item) return '';
|
||||
const event = item.event || '';
|
||||
const eventText = item.event_text || '';
|
||||
const memo = item.memo || '';
|
||||
|
||||
if (event === 'admin_recharge' || eventText === '后台-余额充值' || eventText === '合约调用') {
|
||||
if (!memo || memo === '后台管理调整余额' || memo === '后台管理调整积分' || memo === '合约调用') {
|
||||
return '合约调用';
|
||||
}
|
||||
return `合约调用 · ${memo}`;
|
||||
}
|
||||
|
||||
return `${eventText}${memo ? ' · ' + memo : ''}`;
|
||||
}
|
||||
|
||||
const tabMaps = [
|
||||
{
|
||||
name: '全部',
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
:key="item.id"
|
||||
>
|
||||
<view class="ss-flex-col">
|
||||
<view class="name">{{ item.event_text }}{{ item.memo ? '-' + item.memo : '' }}</view>
|
||||
<view class="name">{{ formatLogTitle(item) }}</view>
|
||||
<view class="time">{{ item.createtime }}</view>
|
||||
</view>
|
||||
<view class="add" v-if="item.amount > 0">+{{ parseInt(item.amount) }}</view>
|
||||
@@ -102,6 +102,22 @@
|
||||
today:'',
|
||||
});
|
||||
|
||||
function formatLogTitle(item) {
|
||||
if (!item) return '';
|
||||
const event = item.event || '';
|
||||
const eventText = item.event_text || '';
|
||||
const memo = item.memo || '';
|
||||
|
||||
if (event === 'admin_recharge' || eventText === '后台-积分充值' || eventText === '后台-余额充值' || eventText === '合约调用') {
|
||||
if (!memo || memo === '后台管理调整余额' || memo === '后台管理调整积分' || memo === '合约调用') {
|
||||
return '合约调用';
|
||||
}
|
||||
return `合约调用-${memo}`;
|
||||
}
|
||||
|
||||
return `${eventText}${memo ? '-' + memo : ''}`;
|
||||
}
|
||||
|
||||
const tabMaps = [
|
||||
{
|
||||
name: '全部',
|
||||
|
||||
@@ -95,8 +95,9 @@ export default class SheepPay {
|
||||
if (this.options && Number(this.options.money) > 0) {
|
||||
data.money = Number(this.options.money);
|
||||
}
|
||||
if (uni.getStorageSync('openid')) {
|
||||
data.openid = uni.getStorageSync('openid');
|
||||
const localOpenid = uni.getStorageSync('openid');
|
||||
if (localOpenid) {
|
||||
data.openid = localOpenid;
|
||||
}
|
||||
sheep.$api.pay.prepay(data).then((res) => {
|
||||
if (res && res.code === 1) {
|
||||
@@ -105,10 +106,18 @@ export default class SheepPay {
|
||||
if (res && res.data === -1 && res.msg === 'miss_openid') {
|
||||
uni.showModal({
|
||||
title: '微信支付',
|
||||
content: '请先绑定微信再使用微信支付',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
sheep.$platform.useProvider('wechat').bind();
|
||||
content: '未检测到微信授权绑定,请先绑定微信后再进行支付',
|
||||
confirmText: '前往绑定',
|
||||
success: async (modalRes) => {
|
||||
if (modalRes.confirm) {
|
||||
try {
|
||||
const bindResult = await sheep.$platform.useProvider('wechat').bind();
|
||||
if (bindResult) {
|
||||
sheep.$helper.toast('微信绑定成功');
|
||||
}
|
||||
} catch (bindErr) {
|
||||
console.log('绑定微信取消或失败', bindErr);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -203,27 +212,57 @@ export default class SheepPay {
|
||||
let that = this;
|
||||
try {
|
||||
let result = await this.prepay();
|
||||
if (result.code !== 1) return;
|
||||
if (result.code !== 1) {
|
||||
const errMsg = result?.msg || '预支付发起失败,请重试';
|
||||
sheep.$helper.toast(errMsg);
|
||||
return;
|
||||
}
|
||||
if (!result.data?.pay_data) {
|
||||
that.payResult('success');
|
||||
return;
|
||||
}
|
||||
uni.requestPayment({
|
||||
const payData = result.data.pay_data;
|
||||
// 严格按微信小程序原生参数规范整理,确保 timeStamp 为 string,过滤多余字段
|
||||
const paymentParams = {
|
||||
provider: 'wxpay',
|
||||
...result.data.pay_data,
|
||||
timeStamp: String(payData.timeStamp || ''),
|
||||
nonceStr: String(payData.nonceStr || ''),
|
||||
package: String(payData.package || ''),
|
||||
signType: payData.signType || 'RSA',
|
||||
paySign: String(payData.paySign || ''),
|
||||
success: (res) => {
|
||||
that.payResult('success');
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('微信支付调用失败:', err);
|
||||
if (err.errMsg === 'requestPayment:fail cancel') {
|
||||
sheep.$helper.toast('支付已手动取消');
|
||||
} else {
|
||||
that.payResult('fail');
|
||||
// 提示具体错误原因,方便用户与管理员定位
|
||||
const errHint = err.errMsg ? err.errMsg.replace('requestPayment:fail', '').trim() : '';
|
||||
if (errHint) {
|
||||
uni.showModal({
|
||||
title: '支付拉取失败',
|
||||
content: '微信支付未成功调起:' + errHint,
|
||||
showCancel: false,
|
||||
confirmText: '我知道了',
|
||||
success: () => {
|
||||
that.payResult('fail');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
that.payResult('fail');
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
uni.requestPayment(paymentParams);
|
||||
} catch (e) {
|
||||
console.log('预支付未完成:', e);
|
||||
if (e?.msg !== 'miss_openid') {
|
||||
console.error('预支付未完成异常:', e);
|
||||
const hint = e?.msg || (typeof e === 'string' ? e : '支付请求失败,请稍后重试');
|
||||
sheep.$helper.toast(hint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ function load() {
|
||||
// 微信小程序静默授权登陆
|
||||
const login = async () => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const { code } = await third.wechat.login(
|
||||
const res = await third.wechat.login(
|
||||
{
|
||||
platform: 'miniProgram',
|
||||
|
||||
@@ -36,11 +36,14 @@ const login = async () => {
|
||||
},
|
||||
);
|
||||
|
||||
if (code > 0) {
|
||||
resolve(code);
|
||||
if (res?.code > 0) {
|
||||
if (res.data?.openid) {
|
||||
uni.setStorageSync('openid', res.data.openid);
|
||||
}
|
||||
resolve(res.code);
|
||||
}
|
||||
|
||||
if (code === -1) {
|
||||
if (res?.code === -1) {
|
||||
getSessionId(false);
|
||||
}
|
||||
resolve(false);
|
||||
@@ -80,6 +83,9 @@ const mobileLogin = async (e) => {
|
||||
);
|
||||
|
||||
if (res?.code === 1) {
|
||||
if (res.data?.openid) {
|
||||
uni.setStorageSync('openid', res.data.openid);
|
||||
}
|
||||
resolve(true);
|
||||
return;
|
||||
}
|
||||
@@ -104,6 +110,9 @@ const mobileLogin = async (e) => {
|
||||
},
|
||||
);
|
||||
if (retryRes?.code === 1) {
|
||||
if (retryRes.data?.openid) {
|
||||
uni.setStorageSync('openid', retryRes.data.openid);
|
||||
}
|
||||
resolve(true);
|
||||
return;
|
||||
}
|
||||
@@ -195,6 +204,9 @@ const getSessionId = async (auto_login = null) => {
|
||||
});
|
||||
if (code === 1) {
|
||||
uni.setStorageSync('sessionId', data.session_id);
|
||||
if (data.openid) {
|
||||
uni.setStorageSync('openid', data.openid);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
在新工单中引用
屏蔽一个用户