From 24293982bd9763ca39280f6f4d2ab27cf1da68bd Mon Sep 17 00:00:00 2001 From: OuYingJun1024 <1034284404@qq.com> Date: Mon, 15 Jun 2026 22:42:01 +0800 Subject: [PATCH] =?UTF-8?q?feat(ad-revenue):=20=E7=8A=B6=E6=80=81=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E8=A1=A5=E4=B8=8D=E5=8F=91=E5=8E=9F=E5=9B=A0=20+=20eC?= =?UTF-8?q?PM=20=E5=88=97=E6=A0=87=E6=B3=A8=E5=8D=95=E4=BD=8D(=E5=88=86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 发奖明细状态映射加 closed_early→「提前关闭」/ too_short→「未满10秒」,并全部转中文 - 展示/发奖明细 eCPM 列名改「eCPM(分)」(穿山甲原值单位为分,非元) Co-Authored-By: Claude Opus 4.8 (1M context) --- src/app/(main)/ad-revenue/page.tsx | 20 +++++++++++++------- src/lib/types.ts | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/app/(main)/ad-revenue/page.tsx b/src/app/(main)/ad-revenue/page.tsx index dcbe1da..e5d2e04 100644 --- a/src/app/(main)/ad-revenue/page.tsx +++ b/src/app/(main)/ad-revenue/page.tsx @@ -53,10 +53,13 @@ const APP_TAG: Record = { test: { color: 'default', label: '测试应用' }, }; -const STATUS_TAG: Record = { - granted: 'green', - capped: 'orange', - ecpm_missing: 'red', +// 发奖状态 → 颜色 + 中文(含「不发金币的原因」:提前关闭/未满10秒/缺eCPM/次数超限) +const STATUS_TAG: Record = { + granted: { color: 'green', label: '已发' }, + capped: { color: 'orange', label: '次数超限' }, + ecpm_missing: { color: 'red', label: '缺 eCPM' }, + too_short: { color: 'gold', label: '未满10秒' }, + closed_early: { color: 'default', label: '提前关闭' }, }; const fmtFactorRange = (a: number | null, b: number | null) => { @@ -91,7 +94,7 @@ const LT_FACTOR_ROWS = [ // 展开行 - 展示明细:每条广告展示一行(时间/eCPM/收益/adn/底层位) const IMPRESSION_COLUMNS: ColumnsType = [ { title: '时间', dataIndex: 'created_at', render: (v: string) => formatUtcTime(v), width: 165 }, - { title: 'eCPM', dataIndex: 'ecpm', width: 100 }, + { title: 'eCPM(分)', dataIndex: 'ecpm', width: 100 }, { title: '预估收益(元)', dataIndex: 'revenue_yuan', width: 120, render: (v: number) => v.toFixed(4) }, { title: 'adn', @@ -113,9 +116,12 @@ const DETAIL_COLUMNS: ColumnsType = [ title: '状态', dataIndex: 'status', width: 110, - render: (s: string) => {s}, + render: (s: string) => { + const t = STATUS_TAG[s] ?? { color: 'default', label: s }; + return {t.label}; + }, }, - { title: 'eCPM', dataIndex: 'ecpm', width: 90, render: (v: string | null) => v ?? '-' }, + { title: 'eCPM(分)', dataIndex: 'ecpm', width: 90, render: (v: string | null) => v ?? '-' }, { title: '因子1', dataIndex: 'ecpm_factor', width: 70, render: (v: number | null) => v ?? '-' }, { title: '份数', dataIndex: 'units', width: 60 }, { diff --git a/src/lib/types.ts b/src/lib/types.ts index 7a624f3..63e6bdd 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -202,7 +202,7 @@ export interface AdRevenueImpression { export interface AdRevenueRecord { record_id: number; created_at: string; - status: string; // granted / capped / ecpm_missing + status: string; // granted / capped / ecpm_missing / too_short / closed_early ecpm: string | null; ecpm_factor: number | null; // 因子1 units: number; // 份数