feat: 管理后台数据看板

新增 /admin/dashboard 页面,提供充值订单统计与分析:
- 汇总统计卡片(今日/累计充值金额、订单数、成功率、平均充值)
- 每日充值趋势折线图(recharts,支持 7/30/90 天切换)
- 充值排行榜(Top 10 用户)
- 支付方式分布(水平条形图)
- 与 /admin 订单管理页面互相导航

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
miwei
2026-03-04 17:06:27 +08:00
parent d7d91857c7
commit 3a9a32e2c2
9 changed files with 937 additions and 10 deletions

View File

@@ -162,6 +162,16 @@ function AdminContent() {
REFUNDED: '已退款',
};
const navParams = new URLSearchParams();
if (token) navParams.set('token', token);
if (isDark) navParams.set('theme', 'dark');
if (isEmbedded) navParams.set('ui_mode', 'embedded');
const btnBase = [
'inline-flex items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors',
isDark ? 'border-slate-600 text-slate-200 hover:bg-slate-800' : 'border-slate-300 text-slate-700 hover:bg-slate-100',
].join(' ');
return (
<PayPageLayout
isDark={isDark}
@@ -170,16 +180,14 @@ function AdminContent() {
title="订单管理"
subtitle="查看和管理所有充值订单"
actions={
<button
type="button"
onClick={fetchOrders}
className={[
'inline-flex items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors',
isDark ? 'border-slate-600 text-slate-200 hover:bg-slate-800' : 'border-slate-300 text-slate-700 hover:bg-slate-100',
].join(' ')}
>
</button>
<>
<a href={`/admin/dashboard?${navParams}`} className={btnBase}>
</a>
<button type="button" onClick={fetchOrders} className={btnBase}>
</button>
</>
}
>
{error && (