feat(ad-revenue): 状态标签补不发原因 + eCPM 列标注单位(分)

- 发奖明细状态映射加 closed_early→「提前关闭」/ too_short→「未满10秒」,并全部转中文
- 展示/发奖明细 eCPM 列名改「eCPM(分)」(穿山甲原值单位为分,非元)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
OuYingJun1024
2026-06-15 22:42:01 +08:00
parent c73cd8dabd
commit 24293982bd
2 changed files with 14 additions and 8 deletions
+13 -7
View File
@@ -53,10 +53,13 @@ const APP_TAG: Record<string, { color: string; label: string }> = {
test: { color: 'default', label: '测试应用' },
};
const STATUS_TAG: Record<string, string> = {
granted: 'green',
capped: 'orange',
ecpm_missing: 'red',
// 发奖状态 → 颜色 + 中文(含「不发金币的原因」:提前关闭/未满10秒/缺eCPM/次数超限)
const STATUS_TAG: Record<string, { color: string; label: string }> = {
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<AdRevenueImpression> = [
{ 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<AdRevenueRecord> = [
title: '状态',
dataIndex: 'status',
width: 110,
render: (s: string) => <Tag color={STATUS_TAG[s] ?? 'default'}>{s}</Tag>,
render: (s: string) => {
const t = STATUS_TAG[s] ?? { color: 'default', label: s };
return <Tag color={t.color}>{t.label}</Tag>;
},
},
{ 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 },
{
+1 -1
View File
@@ -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; // 份数