feat(distribution): 补齐退款加价回退、本站自卖与开通默认规则

退款时压缩卖方加价,人工/自动批次仅完结单可入账,号主收入进主站钱包;仲裁后重算释放并支持作废未入账 DS。开通时四种模式按默认生效,对外口径合并为 35/40/25,不再单独展示通道费。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yml2213
2026-09-10 18:13:46 +08:00
co-authored by Cursor
parent e621722218
commit 768902f2f7
28 changed files with 627 additions and 263 deletions
@@ -16,6 +16,11 @@ export const DISTRIBUTION_MODES = [
label: '三方分账',
hint: '分站卖另一分站的货',
},
{
value: 'site_self_sell',
label: '本站自卖',
hint: '分站卖本站货,卖出站拿 75%',
},
] as const
const MODE_LABELS: Record<string, string> = Object.fromEntries(
@@ -46,10 +51,6 @@ export function formatRatioPercent(value?: number) {
return `${n.toFixed(n % 1 === 0 ? 0 : 1)}%`
}
export function formatPaymentFeeBps(bps?: number) {
return `${Number(bps || 0) / 100}%`
}
export function ruleSplitParts(rule: DistributionRule) {
switch (rule.mode) {
case 'two_party_distributor_receive':
@@ -67,6 +68,8 @@ export function ruleSplitParts(rule: DistributionRule) {
{ label: '收号站', value: formatRatioPercent(rule.distributor_a_ratio) },
{ label: '卖出站', value: formatRatioPercent(rule.distributor_b_ratio) },
]
case 'site_self_sell':
return [{ label: '本站卖出', value: formatRatioPercent(rule.distributor_sell_ratio) }]
default:
return []
}