feat(finance): 优化师傅提现规则动态下发展示与免手续费配置

这个提交包含在:
2026-11-28 16:09:26 +08:00
父节点 f71a12f5fa
当前提交 9b8561d7ea
共有 9 个文件被更改,包括 496 次插入 和 56 次删除

查看文件

@@ -26,16 +26,14 @@
<view class="action-block">
<!-- #ifdef MP-WEIXIN -->
<button
class="btn-wx-primary clickable-hover"
class="btn-phone-primary clickable-hover"
:class="{ disabled: loading, 'btn-shake': needShake }"
:open-type="agreePolicy ? 'getPhoneNumber' : ''"
@getphonenumber="onGetPhoneNumber"
@tap="handleTapButton"
>
<view class="wx-icon-wrap">
<image class="wx-svg-icon" src="/static/icons/wechat.svg" mode="aspectFit" />
</view>
<text class="btn-text">{{ loading ? '安全授权中...' : '微信手机号一键登录' }}</text>
<image class="phone-svg-icon" src="/static/icons/login-phone-white.svg" mode="aspectFit" />
<text class="btn-text">{{ loading ? '安全登录中...' : '手机号快捷登录' }}</text>
</button>
<!-- #endif -->
@@ -286,12 +284,12 @@
return '隐私保护指引尚未生效,请稍后重试或联系客服';
}
if (msg.includes('no permission') || msg.includes('unauthorized')) {
return '当前暂不支持微信手机号快捷登录,请联系客服';
return '当前暂不支持手机号快捷登录,请联系客服';
}
if (msg.includes('quota') || msg.includes('limit')) {
return '手机号验证次数已达上限,请稍后再试';
}
return '获取微信手机号失败,请重试';
return '获取手机号失败,请重试';
}
function formatLoginError(err, fallback) {
@@ -546,7 +544,7 @@
}, 500);
} catch (err) {
loading.value = false;
toast(formatLoginError(err, '微信手机号登录失败,请重试'));
toast(formatLoginError(err, '手机号登录失败,请重试'));
}
}
@@ -759,30 +757,25 @@
}
.btn-account-primary::after { border: none; }
.btn-account-primary.disabled { opacity: 0.65; }
.btn-wx-primary {
.btn-phone-primary {
width: 100%;
height: 100rpx;
border-radius: 50rpx;
background: linear-gradient(135deg, #07C160 0%, #05A351 100%);
box-shadow: 0 12rpx 28rpx rgba(7, 193, 96, 0.28);
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
box-shadow: 0 12rpx 28rpx rgba(240, 113, 13, 0.28);
display: flex;
align-items: center;
justify-content: center;
border: none;
}
.btn-wx-primary::after { border: none; }
.btn-wx-primary.disabled { opacity: 0.65; }
.wx-icon-wrap {
width: 50rpx;
height: 50rpx;
border-radius: 50%;
background: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
margin-right: 18rpx;
.btn-phone-primary::after { border: none; }
.btn-phone-primary.disabled { opacity: 0.65; }
.phone-svg-icon {
width: 38rpx;
height: 38rpx;
margin-right: 14rpx;
flex-shrink: 0;
}
.wx-svg-icon { width: 34rpx; height: 34rpx; }
.btn-text {
font-size: 32rpx;
font-weight: 600;

查看文件

@@ -68,10 +68,39 @@
</view>
</view>
<!-- 结算规则提示(完全由后台配置中心动态下发) -->
<view class="tips-bar" v-if="ruleTipText">
<image class="tips-ico" src="/static/icons/info-orange.svg" mode="aspectFit" />
<text class="tips-txt">{{ ruleTipText }}</text>
<!-- 提现规则紧凑宫格卡片(完全由后台配置中心动态下发) -->
<view class="rule-card" v-if="withdrawCfg">
<view class="rule-card-head">
<view class="rule-head-left">
<image class="rule-head-ico" src="/static/icons/withdraw-rule.svg" mode="aspectFit" />
<text class="rule-head-title">提现规则</text>
</view>
<view class="rule-head-right">
<text class="rule-status-pill" :class="{ paused: !withdrawEnabled }">
{{ withdrawEnabled ? '正常开放' : '暂停提现' }}
</text>
</view>
</view>
<view class="rule-pause-bar" v-if="!withdrawEnabled && withdrawCloseTip">
<text class="rule-pause-txt">{{ withdrawCloseTip }}</text>
</view>
<view class="rule-grid" v-if="ruleGridItems.length > 0">
<view class="rule-tile" v-for="item in ruleGridItems" :key="item.key">
<text class="tile-lab">{{ item.label }}</text>
<text class="tile-val">{{ item.value }}</text>
<text class="tile-sub" v-if="item.sub">{{ item.sub }}</text>
</view>
</view>
<view class="rule-footer-bar" v-if="ruleFooterSummary" @tap="showRuleDetailDrawer = true">
<text class="rule-footer-txt">{{ ruleFooterSummary }}</text>
<view class="rule-more-btn">
<text class="rule-more-txt">细则</text>
<image class="rule-more-ico" src="/static/icons/arrow-right-orange.svg" mode="aspectFit" />
</view>
</view>
</view>
<!-- 收支账单与提现明细 -->
@@ -247,11 +276,18 @@
<text class="meta-item">单笔 ¥{{ formatMoney(minWithdraw) }} - ¥{{ formatMoney(singleLimit) }}{{ hasDailyAmountLimit ? ` · 今日剩余额度 ¥${formatMoney(todayRemain)}` : '' }}{{ hasDailyCountLimit ? ` · 剩余 ${remainDailyCount} 次` : '' }}</text>
<text class="meta-item warn" v-if="withdrawErrorHint">{{ withdrawErrorHint }}</text>
<text class="meta-item estimate" v-else-if="parsedWithdraw >= minWithdraw">
{{ Number(withdrawFee) > 0 ? `通道手续费 ¥${withdrawFee} · ` : '免收手续费 · ' }}预计到账 ¥{{ withdrawArrive }}
{{ Number(withdrawFee) > 0 ? `提现手续费 ¥${withdrawFee} · ` : '免提现手续费 · ' }}预计到账 ¥{{ withdrawArrive }}
</text>
</view>
</view>
<view class="drawer-rule-box" v-if="withdrawCfg && drawerWithdrawRules.length > 0">
<view class="drawer-rule-item" v-for="item in drawerWithdrawRules" :key="item.key">
<text class="drawer-rule-tag">{{ item.label }}</text>
<text class="drawer-rule-desc">{{ item.value }}</text>
</view>
</view>
<view
class="drawer-submit clickable-hover"
:class="{ disabled: !canSubmitWithdraw }"
@@ -319,6 +355,27 @@
</view>
</view>
<!-- 提现完整规则详情半屏抽屉 -->
<view class="drawer-mask" v-if="showRuleDetailDrawer" @tap="showRuleDetailDrawer = false">
<view class="drawer-panel rule-detail-panel" @tap.stop>
<view class="drawer-head">
<text class="drawer-title">提现规则说明</text>
<view class="drawer-close" @tap="showRuleDetailDrawer = false">
<image class="close-ico" src="/static/icons/close.svg" mode="aspectFit" />
</view>
</view>
<view class="rule-detail-list">
<view class="rule-detail-item" v-for="item in displayWithdrawRules" :key="item.key">
<text class="rd-lab">{{ item.label }}</text>
<text class="rd-val">{{ item.value }}</text>
</view>
</view>
<view class="drawer-submit clickable-hover" @tap="showRuleDetailDrawer = false">我知道了</view>
</view>
</view>
<!-- 账单流水详情半屏抽屉 -->
<view class="drawer-mask" v-if="activeLog" @tap="activeLog = null">
<view class="drawer-panel" @tap.stop>
@@ -386,6 +443,7 @@
const filterType = ref('all');
const showWithdrawDrawer = ref(false);
const showRuleDetailDrawer = ref(false);
const withdrawAmount = ref('');
const selectedChannel = ref('wechat');
const bankAccount = ref('');
@@ -416,6 +474,95 @@
const arrivalDescText = computed(() => withdrawCfg.value?.arrival_desc || '微信零钱(确认收款即到账)');
const ruleTipText = computed(() => withdrawCfg.value?.rule_tip || '');
function fmtTrimMoney(v) {
const n = Number(v || 0);
if (!Number.isFinite(n)) return '0';
return n.toFixed(2).replace(/\.?0+$/, '');
}
function formatWeekdaysLabel(days) {
const arr = Array.isArray(days) ? [...new Set(days.map(Number).filter(n => n >= 1 && n <= 7))].sort((a, b) => a - b) : [];
const joined = arr.join(',');
if (!joined || joined === '1,2,3,4,5,6,7') return '每日';
if (joined === '1,2,3,4,5') return '周一至周五';
if (joined === '6,7') return '周六、周日';
const map = { 1: '周一', 2: '周二', 3: '周三', 4: '周四', 5: '周五', 6: '周六', 7: '周日' };
return arr.map(d => map[d]).filter(Boolean).join('、') || '每日';
}
const ruleGridItems = computed(() => {
const cfg = withdrawCfg.value;
if (!cfg) return [];
if (Array.isArray(cfg.rule_grid) && cfg.rule_grid.length > 0) {
return cfg.rule_grid;
}
const weekdayLabel = formatWeekdaysLabel(cfg.allow_weekdays);
const dailyLimitSub = hasDailyAmountLimit.value
? `日限 ¥${fmtTrimMoney(cfg.daily_amount)} · 剩 ¥${fmtTrimMoney(todayRemain.value)}`
: '单日不限累计额度';
const countMain = hasDailyCountLimit.value ? `每日最多 ${Number(cfg.daily_count)} 次` : '每日不限次数';
const countSub = hasDailyCountLimit.value ? `今日剩余 ${remainDailyCount.value} 次` : '不限申请笔数';
const arrivalMain = cfg.transfer_mode === 'wx_mch_transfer'
? (cfg.audit_mode === 'auto_small' && Number(cfg.auto_max_amount) > 0 ? '确认收款实时到账' : '审核后实时到账')
: '财务审核打款';
const arrivalSub = cfg.transfer_mode === 'wx_mch_transfer'
? (cfg.audit_mode === 'auto_small' && Number(cfg.auto_max_amount) > 0
? `≤¥${fmtTrimMoney(cfg.auto_max_amount)}免审 · 24h内确认`
: '转账后24h内确认收款')
: '财务打款至收款账户';
return [
{ key: 'amount', label: '可提现额度', value: `¥${fmtTrimMoney(minWithdraw.value)} ~ ¥${fmtTrimMoney(singleLimit.value)}`, sub: dailyLimitSub },
{ key: 'count', label: '每日提现次数', value: countMain, sub: countSub },
{ key: 'time', label: '提现时间', value: `${cfg.time_start || '00:00'} - ${cfg.time_end || '23:59'}`, sub: `${weekdayLabel}开放申请` },
{ key: 'arrival', label: '到账时间', value: arrivalMain, sub: arrivalSub }
];
});
const ruleFooterSummary = computed(() => {
const cfg = withdrawCfg.value;
if (!cfg) return '';
const parts = [];
if (cfg.fee_text) parts.push(cfg.fee_text);
if (cfg.require_realname) {
parts.push('需完成实名认证');
} else if (cfg.realname_text) {
parts.push(cfg.realname_text);
}
return parts.join(' · ');
});
const displayWithdrawRules = computed(() => {
const cfg = withdrawCfg.value;
if (!cfg) return [];
if (Array.isArray(cfg.rules) && cfg.rules.length > 0) {
return cfg.rules;
}
const list = [];
if (cfg.amount_rule_text) {
list.push({ key: 'amount', label: '可提现额度', value: cfg.amount_rule_text });
}
if (cfg.daily_count_text) {
list.push({ key: 'count', label: '每日提现次数', value: cfg.daily_count_text });
}
if (cfg.open_time_text) {
list.push({ key: 'time', label: '提现时间', value: cfg.open_time_text });
}
if (cfg.arrival_time_text || cfg.arrival_desc) {
list.push({ key: 'arrival', label: '到账时间', value: cfg.arrival_time_text || cfg.arrival_desc });
}
if (cfg.fee_text) {
list.push({ key: 'fee', label: '手续费说明', value: cfg.fee_text });
}
if (cfg.realname_text) {
list.push({ key: 'auth', label: '认证要求', value: cfg.realname_text });
}
return list;
});
const drawerWithdrawRules = computed(() => {
return displayWithdrawRules.value.filter(item => ['count', 'time', 'arrival', 'fee'].includes(item.key));
});
const minWithdraw = computed(() => Number(withdrawCfg.value?.min_amount ?? withdrawLimits.value.min_amount ?? 0.1));
const singleLimit = computed(() => Number(withdrawCfg.value?.max_amount ?? withdrawLimits.value.single_limit ?? 200));
const hasDailyAmountLimit = computed(() => Number(withdrawCfg.value?.daily_amount ?? withdrawLimits.value.daily_user_limit ?? 0) > 0);
@@ -839,26 +986,157 @@
opacity: 0.55;
}
/* 规则提示条 */
.tips-bar {
/* 提现规则紧凑宫格卡片 */
.rule-card {
margin: 20rpx $yjyf-space-md 0;
padding: 18rpx 22rpx;
background: $yjyf-primary-bg;
border-radius: $yjyf-radius-sm;
padding: 22rpx $yjyf-space-md;
background: $yjyf-bg-card;
border-radius: $yjyf-radius-md;
box-shadow: $yjyf-shadow-card;
}
.rule-card-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
}
.rule-head-left {
display: flex;
align-items: center;
gap: 10rpx;
}
.rule-head-ico {
width: 30rpx;
height: 30rpx;
flex-shrink: 0;
}
.rule-head-title {
font-size: $yjyf-font-body;
font-weight: 700;
color: $yjyf-text-main;
}
.rule-head-right {
display: flex;
align-items: center;
}
.tips-ico {
width: 28rpx;
height: 28rpx;
margin-right: 12rpx;
.rule-status-pill {
height: 38rpx;
padding: 0 14rpx;
border-radius: $yjyf-radius-pill;
background: rgba($yjyf-success, 0.12);
color: $yjyf-success;
font-size: $yjyf-font-micro;
font-weight: 600;
display: inline-flex;
align-items: center;
}
.rule-status-pill.paused {
background: rgba($yjyf-danger, 0.1);
color: $yjyf-danger;
}
.rule-pause-bar {
margin-bottom: 16rpx;
padding: 14rpx 18rpx;
border-radius: $yjyf-radius-sm;
background: rgba($yjyf-danger, 0.08);
}
.rule-pause-txt {
font-size: $yjyf-font-sub;
color: $yjyf-danger;
line-height: 1.45;
}
.rule-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 14rpx;
}
.rule-tile {
padding: 18rpx 20rpx;
border-radius: $yjyf-radius-sm;
background: $yjyf-bg-page;
display: flex;
flex-direction: column;
min-width: 0;
}
.tile-lab {
font-size: $yjyf-font-micro;
color: $yjyf-text-secondary;
line-height: 1.3;
}
.tile-val {
margin-top: 8rpx;
font-size: $yjyf-font-body;
font-weight: 700;
color: $yjyf-text-main;
line-height: 1.3;
font-variant-numeric: tabular-nums;
}
.tile-sub {
margin-top: 6rpx;
font-size: $yjyf-font-micro;
color: $yjyf-text-regular;
line-height: 1.35;
font-variant-numeric: tabular-nums;
}
.rule-footer-bar {
margin-top: 16rpx;
padding: 14rpx 18rpx;
border-radius: $yjyf-radius-sm;
background: $yjyf-primary-bg;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16rpx;
}
.rule-footer-txt {
flex: 1;
min-width: 0;
font-size: $yjyf-font-micro;
color: $yjyf-text-regular;
line-height: 1.4;
}
.rule-more-btn {
display: inline-flex;
align-items: center;
gap: 4rpx;
flex-shrink: 0;
}
.tips-txt {
flex: 1;
.rule-more-txt {
font-size: $yjyf-font-micro;
font-weight: 600;
color: $yjyf-primary;
line-height: 1.45;
}
.rule-more-ico {
width: 20rpx;
height: 20rpx;
}
.rule-detail-panel {
max-height: 82vh;
overflow-y: auto;
}
.rule-detail-list {
display: flex;
flex-direction: column;
gap: 16rpx;
}
.rule-detail-item {
padding: 18rpx 22rpx;
border-radius: $yjyf-radius-sm;
background: $yjyf-bg-page;
display: flex;
flex-direction: column;
gap: 6rpx;
}
.rd-lab {
font-size: $yjyf-font-micro;
color: $yjyf-text-secondary;
}
.rd-val {
font-size: $yjyf-font-sub;
color: $yjyf-text-main;
font-weight: 500;
line-height: 1.5;
font-variant-numeric: tabular-nums;
}
/* 账单卡片 */
@@ -1274,7 +1552,36 @@
.balance-value { color: $yjyf-text-main; font-weight: 600; font-variant-numeric: tabular-nums; }
.withdraw-panel .meta-item { line-height: 1.5; }
.withdraw-panel .estimate { color: $yjyf-text-regular; }
.withdraw-panel .drawer-submit { margin-top: 36rpx; box-shadow: $yjyf-shadow-button; }
.drawer-rule-box {
margin-top: 24rpx;
padding: 18rpx 22rpx;
border-radius: $yjyf-radius-md;
background: $yjyf-bg-page;
display: flex;
flex-direction: column;
gap: 10rpx;
}
.drawer-rule-item {
display: flex;
align-items: baseline;
gap: 16rpx;
}
.drawer-rule-tag {
width: 136rpx;
flex-shrink: 0;
font-size: $yjyf-font-micro;
color: $yjyf-text-secondary;
line-height: 1.45;
}
.drawer-rule-desc {
flex: 1;
min-width: 0;
font-size: $yjyf-font-micro;
color: $yjyf-text-regular;
line-height: 1.45;
font-variant-numeric: tabular-nums;
}
.withdraw-panel .drawer-submit { margin-top: 32rpx; box-shadow: $yjyf-shadow-button; }
.withdraw-panel .drawer-submit.disabled { box-shadow: none; }
.detail-hero {

查看文件

@@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="6" y="2" width="12" height="20" rx="2.5" ry="2.5"/>
<line x1="10" y1="5.5" x2="14" y2="5.5"/>
<circle cx="12" cy="18" r="0.9" fill="#FFFFFF" stroke="none"/>
</svg>

之后

宽度:  |  高度:  |  大小: 356 B

查看文件

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none">
<rect x="4" y="3" width="16" height="18" rx="3" fill="#FFF7F0" stroke="#F0710D" stroke-width="1.8"/>
<path d="M8 8.5H16" stroke="#F0710D" stroke-width="1.8" stroke-linecap="round"/>
<path d="M8 12.5H16" stroke="#F0710D" stroke-width="1.8" stroke-linecap="round"/>
<path d="M8 16.5H12.5" stroke="#F0710D" stroke-width="1.8" stroke-linecap="round"/>
</svg>

之后

宽度:  |  高度:  |  大小: 459 B