From ea483ce281978b6334eec7e3e18ab7575c94db20 Mon Sep 17 00:00:00 2001 From: linkeyu Date: Tue, 21 Jul 2026 10:14:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(admin):=20=E9=A2=86=E5=88=B8=E5=B9=BF?= =?UTF-8?q?=E5=91=8A=E6=94=B6=E7=9B=8A=E6=9C=AA=E5=A1=AB=E5=85=85=E6=97=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=98=8E=E7=A1=AE=E6=96=87=E6=A1=88=20(#52)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 修改内容 - 广告收益字段支持 null - null 显示未填充 - 真实零收益仍显示 ¥0.0000 ## 验证 - TypeScript 类型检查通过 - Next.js 生产构建通过 --------- Co-authored-by: linkeyu <798648091@qq.com> Reviewed-on: https://gitea.shaguabijia.com/WonderableAI/shaguabijia-admin-web/pulls/52 Co-authored-by: linkeyu Co-committed-by: linkeyu --- src/app/(main)/coupon-data/page.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/(main)/coupon-data/page.tsx b/src/app/(main)/coupon-data/page.tsx index 9ab3319..4267661 100644 --- a/src/app/(main)/coupon-data/page.tsx +++ b/src/app/(main)/coupon-data/page.tsx @@ -73,7 +73,7 @@ interface CouponDataRow { started_at: string; claimed_count: number | null; trace_url: string | null; - ad_revenue_yuan: number; // 本次领券看的信息流广告预估收益(元) + ad_revenue_yuan: number | null; // 本次领券看的信息流广告预估收益(元);未填充为 null } interface CouponDataReport { date_from: string; @@ -124,9 +124,9 @@ const fmtSec = (ms: number | null | undefined): string => const fmtPct = (v: number | null | undefined): string => v == null ? '-' : `${(v * 100).toFixed(1)}%`; -// 元(小数)→ "¥0.0050";空值显示 -,真实 0 显示 ¥0.0000,以区分“零收益”和“无数据”。 +// 元(小数)→ "¥0.0050";空值表示 eCPM 根本未填充,真实 0 仍显示 ¥0.0000。 const fmtYuan = (v: number | null | undefined): string => - v == null ? '-' : `¥${v.toFixed(4)}`; + v == null ? '未填充' : `¥${v.toFixed(4)}`; // 一组按券行的 success_rate 算术平均(每张券等权;空值券跳过);无有效券 → null(显示 -)。 // 汇总卡「分平台/合计点位成功率」据此由按券明细上卷,口径与下方按券表一致。 @@ -517,7 +517,7 @@ export default function CouponDataPage() { dataIndex: 'ad_revenue_yuan', width: 100, align: 'right', - render: (v: number) => fmtYuan(v), + render: (v: number | null) => fmtYuan(v), }, { title: '美团耗时',