From 1c16f26ae09f1b5657f1f4fc5c3911021a3ea135 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Wed, 9 Sep 2026 19:47:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(distribution-admin):=20=E5=85=A8=E9=9D=A2?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A4=A7=E7=9B=98=E3=80=81=E5=AF=B9=E8=B4=A6?= =?UTF-8?q?=E5=8D=95=E3=80=81=E9=92=B1=E5=8C=85=E4=B8=8E=E5=89=8D=E5=8F=B0?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E7=9A=84=E5=88=97=E5=AE=BD=E6=8E=92=E7=89=88?= =?UTF-8?q?=E3=80=81=E4=B8=AD=E6=96=87=E5=8C=96=E4=B8=8E=E9=98=B2=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- distribution-admin/src/pages/Dashboard.tsx | 143 +++++++++++++++++-- distribution-admin/src/pages/Payments.tsx | 2 +- distribution-admin/src/pages/Settlements.tsx | 11 +- distribution-admin/src/pages/Storefront.tsx | 22 ++- distribution-admin/src/pages/Wallet.tsx | 31 +++- 5 files changed, 183 insertions(+), 26 deletions(-) diff --git a/distribution-admin/src/pages/Dashboard.tsx b/distribution-admin/src/pages/Dashboard.tsx index 34ef219..9311d01 100644 --- a/distribution-admin/src/pages/Dashboard.tsx +++ b/distribution-admin/src/pages/Dashboard.tsx @@ -34,6 +34,46 @@ import { } from '../api' import { useMember } from '../MemberContext' +const ORDER_STATUS_MAP: Record = { + pending_payment: { label: '待支付', color: 'orange' }, + pending_handoff: { label: '待上号交付', color: 'processing' }, + renting: { label: '在租中', color: 'cyan' }, + overdue: { label: '已逾期', color: 'volcano' }, + pending_checkout_confirm: { label: '待结单确认', color: 'blue' }, + pending_checkout_accept: { label: '待号主验收', color: 'blue' }, + checkout_disputing: { label: '结单争议中', color: 'magenta' }, + disputing: { label: '维权中', color: 'magenta' }, + abnormal: { label: '异常', color: 'error' }, + completed: { label: '已完成', color: 'success' }, + refunded: { label: '已退款', color: 'purple' }, + cancelled: { label: '已取消', color: 'default' }, +} + +const SETTLEMENT_STATUS_MAP: Record = { + settled: { label: '已结算', color: 'success' }, + pending: { label: '待结算', color: 'warning' }, + unsettled: { label: '未结算', color: 'default' }, + settling: { label: '结算中', color: 'processing' }, + disputed: { label: '争议冻结', color: 'magenta' }, + failed: { label: '结算异常', color: 'error' }, +} + +function formatGameName(gameName?: string): string { + if (!gameName) return '' + const lower = gameName.toLowerCase().trim() + if ( + lower === 'delta_force' || + lower === 'deltaforce' || + lower === 'delta' || + lower.includes('delta_force') || + lower.includes('delta') || + gameName.includes('三角洲') + ) { + return '三角洲' + } + return gameName +} + export default function Dashboard() { const member = useMember() const [sites, setSites] = useState([]) @@ -266,23 +306,92 @@ export default function Dashboard() { rowKey="order_id" dataSource={recentOrders} pagination={false} + scroll={{ x: 1050 }} columns={[ { - title: '订单号', - dataIndex: 'order_no', - width: 170, - render: (v: string) => {v}, + title: '订单与商品编号', + width: 260, + render: (_: unknown, row: DistributionOrder) => ( +
+
+ + 订单 + + + {row.order_no} + +
+ {row.listing_no ? ( +
+ + 商品 + + + {row.listing_no} + +
+ ) : null} +
+ ), }, { title: '租赁账号与游戏', - minWidth: 180, + width: 240, render: (_: unknown, row: DistributionOrder) => (
- + {row.title || (row.listing_no ? `商品 #${row.listing_no}` : `订单 #${row.order_id}`)} - {row.game_name && {row.game_name}} - {row.server_region && {row.server_region}} + + {row.game_name && {formatGameName(row.game_name)}} + {row.server_region && {row.server_region}} + {row.login_platform && {row.login_platform}} +
), }, @@ -290,16 +399,16 @@ export default function Dashboard() { title: '实付金额', width: 120, render: (_: unknown, row: DistributionOrder) => ( - + {formatMoney(row.net_paid_amount_cent || row.gross_paid_amount_cent || 0)} ), }, { title: '本站净收益', - width: 140, + width: 130, render: (_: unknown, row: DistributionOrder) => ( - + +{formatMoney(row.distributor_earning_cent || 0)} ), @@ -308,20 +417,26 @@ export default function Dashboard() { title: '订单状态', dataIndex: 'status', width: 110, - render: (v: string) => {v}, + render: (v: string) => { + const conf = ORDER_STATUS_MAP[v] || { label: v, color: 'default' } + return {conf.label} + }, }, { title: '结算状态', dataIndex: 'settlement_status', width: 110, - render: (v: string) => {v === 'settled' ? '已结算' : '待结算'}, + render: (v: string) => { + const conf = SETTLEMENT_STATUS_MAP[v] || { label: v, color: 'default' } + return {conf.label} + }, }, { title: '下单时间', dataIndex: 'created_at', width: 160, render: (v: string) => ( - + {v ? new Date(v).toLocaleString('zh-CN', { hour12: false }) : '-'} ), diff --git a/distribution-admin/src/pages/Payments.tsx b/distribution-admin/src/pages/Payments.tsx index beec2a5..0dc3618 100644 --- a/distribution-admin/src/pages/Payments.tsx +++ b/distribution-admin/src/pages/Payments.tsx @@ -110,7 +110,7 @@ export default function Payments() { columns={[ { title: '商户配置 ID', dataIndex: 'config_id' }, { title: '优先级', dataIndex: 'priority' }, - { title: '状态', dataIndex: 'status', render: (v: string) => {v} }, + { title: '状态', dataIndex: 'status', render: (v: string) => {v === 'active' ? '正常生效' : (v || '已停用')} }, { title: '操作', render: (_: unknown, row: PaymentChannel) => handleUnbind(row.id)}>解绑, diff --git a/distribution-admin/src/pages/Settlements.tsx b/distribution-admin/src/pages/Settlements.tsx index b270591..19387ad 100644 --- a/distribution-admin/src/pages/Settlements.tsx +++ b/distribution-admin/src/pages/Settlements.tsx @@ -47,10 +47,12 @@ const STATUS_LABELS: Record = { } const PARTY_ROLE_LABELS: Record = { - seller: '卖出提成分账 (40%)', - distributor_b: '卖出提成分账 (40%)', - receiver: '收号提成分账 (35%)', - distributor_a: '收号提成分账 (35%)', + seller: '渠道代销分润 (40%)', + distributor_sell: '渠道代销分润 (40%)', + distributor_b: '渠道代销分润 (40%)', + receiver: '号源出租分润 (35%)', + distributor_receive: '号源出租分润 (35%)', + distributor_a: '号源出租分润 (35%)', two_party_distributor: '分销商分润', platform: '平台服务费', } @@ -212,6 +214,7 @@ export default function Settlements() { loading={loading} dataSource={batches} pagination={false} + scroll={{ x: 1000 }} locale={{ emptyText: ( () const [loading, setLoading] = useState(true) @@ -247,7 +263,7 @@ export default function Storefront() { buttonStyle="solid" > 全部游戏 - 三角洲行动 + 三角洲 王者荣耀 @@ -345,7 +361,7 @@ export default function Storefront() { {/* 标签属性 */} - {item.game_name === 'delta_force' ? '三角洲行动' : item.game_name} + {formatGameName(item.game_name)} {item.server_region && ( @@ -446,7 +462,7 @@ export default function Storefront() { - {selectedListing.game_name === 'delta_force' ? '三角洲行动' : selectedListing.game_name} + {formatGameName(selectedListing.game_name)} {selectedListing.server_region || '全区通用'} {selectedListing.login_platform || 'PC端'} diff --git a/distribution-admin/src/pages/Wallet.tsx b/distribution-admin/src/pages/Wallet.tsx index d0d0a7d..2583af2 100644 --- a/distribution-admin/src/pages/Wallet.tsx +++ b/distribution-admin/src/pages/Wallet.tsx @@ -251,12 +251,29 @@ export default function Wallet() { showTotal: (tot) => `共 ${tot} 条提现记录`, onChange: (p) => void loadData(p), }} + scroll={{ x: 1100 }} columns={[ { title: '提现单号', dataIndex: 'withdraw_no', - width: 170, - render: (v: string) => {v}, + width: 200, + render: (v: string) => ( +
+ + {v} + +
+ ), }, { title: '提现金额', @@ -325,14 +342,20 @@ export default function Wallet() { title: '申请时间', dataIndex: 'created_at', width: 160, - render: (v: string) => {v}, + render: (v: string) => ( + + {v ? new Date(v).toLocaleString('zh-CN', { hour12: false }) : '-'} + + ), }, { title: '打款时间', dataIndex: 'paid_at', width: 160, render: (v: string | undefined) => ( - {v || '待打款'} + + {v ? new Date(v).toLocaleString('zh-CN', { hour12: false }) : '待打款'} + ), }, ]}