feat: 运营后台「领券数据」页

- 侧边栏在「用户反馈」后、「广告配置」前加「领券数据」菜单(/coupon-data)。
- 两段式:汇总卡(领券发起数 / 完成数 / 平均耗时 + 耗时 P5/P50/P95/P99)+ 自研零依赖 SVG 趋势图
  (发起 / 完成数双柱 + 平均耗时线,按天 / 按小时)+ 逐条领券明细表。
- 「发起平台」=发起来源(傻瓜比价 / 美团 / 淘宝 / 京东);trace 列有 trace_url 给可点链接;
  手机号列可点 → 复用通用 UserRecordsDrawer 看该用户全部领券(为其加了可选 rewardSuffix prop)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
zzhyyyyy
2026-06-30 22:00:05 +08:00
parent 7f5dde5c2f
commit f82c7ad8f8
3 changed files with 682 additions and 1 deletions
+3 -1
View File
@@ -21,6 +21,7 @@ interface Props<T> {
countLabel: string; // 顶部计数卡标题,如「提交总计」/「上报总计」
rewardLabel: string; // 顶部奖励卡标题,如「提交奖励总计」/「上报奖励总计」
rewardOf: (item: T) => number; // 单条已发奖励金币(未采纳/未通过返回 0)
rewardSuffix?: string; // 第二个汇总卡单位,默认「金币」;领券场景可传「张」(领到券张数)等
}
export default function UserRecordsDrawer<T extends { id: number }>({
@@ -34,6 +35,7 @@ export default function UserRecordsDrawer<T extends { id: number }>({
countLabel,
rewardLabel,
rewardOf,
rewardSuffix = '金币',
}: Props<T>) {
const [items, setItems] = useState<T[]>([]);
const [total, setTotal] = useState(0);
@@ -91,7 +93,7 @@ export default function UserRecordsDrawer<T extends { id: number }>({
<>
<Space size={48} style={{ marginBottom: 20 }}>
<Statistic title={countLabel} value={total} />
<Statistic title={rewardLabel} value={rewardTotal} suffix="金币" />
<Statistic title={rewardLabel} value={rewardTotal} suffix={rewardSuffix} />
</Space>
{items.length === 0 ? (
<Empty description={`该用户暂无${recordLabel}`} style={{ marginTop: 24 }} />