refactor: extract pay page components and migrate zpay → easypay
Components:
- Add PayPageLayout, OrderFilterBar, MobileOrderList, OrderTable, OrderSummaryCards
- Extract shared pay-utils (types, constants, helper functions)
- Simplify pay/page.tsx and orders/page.tsx
EasyPay migration:
- Remove src/lib/zpay/, api/zpay/notify, zpay test, zpay.md
- Simplify config.ts: single envSchema, no ZPAY_* fallback
- Rename DB field zpay_trade_no → payment_trade_no (migration added)
- Update OrderDetail label: ZPAY订单号 → 支付单号
- Update CLAUDE.md project structure
2026-03-01 15:55:43 +08:00
|
|
|
interface Summary {
|
|
|
|
|
total: number;
|
|
|
|
|
pending: number;
|
|
|
|
|
completed: number;
|
|
|
|
|
failed: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface OrderSummaryCardsProps {
|
|
|
|
|
isDark: boolean;
|
|
|
|
|
summary: Summary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function OrderSummaryCards({ isDark, summary }: OrderSummaryCardsProps) {
|
2026-03-01 17:58:08 +08:00
|
|
|
const cardClass = [
|
|
|
|
|
'rounded-xl border p-3',
|
|
|
|
|
isDark ? 'border-slate-700 bg-slate-800/70' : 'border-slate-200 bg-slate-50',
|
|
|
|
|
].join(' ');
|
refactor: extract pay page components and migrate zpay → easypay
Components:
- Add PayPageLayout, OrderFilterBar, MobileOrderList, OrderTable, OrderSummaryCards
- Extract shared pay-utils (types, constants, helper functions)
- Simplify pay/page.tsx and orders/page.tsx
EasyPay migration:
- Remove src/lib/zpay/, api/zpay/notify, zpay test, zpay.md
- Simplify config.ts: single envSchema, no ZPAY_* fallback
- Rename DB field zpay_trade_no → payment_trade_no (migration added)
- Update OrderDetail label: ZPAY订单号 → 支付单号
- Update CLAUDE.md project structure
2026-03-01 15:55:43 +08:00
|
|
|
const labelClass = ['text-xs', isDark ? 'text-slate-400' : 'text-slate-500'].join(' ');
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="mb-4 grid grid-cols-2 gap-3 sm:grid-cols-4">
|
|
|
|
|
<div className={cardClass}>
|
|
|
|
|
<div className={labelClass}>总订单</div>
|
|
|
|
|
<div className="mt-1 text-xl font-semibold">{summary.total}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className={cardClass}>
|
|
|
|
|
<div className={labelClass}>待支付</div>
|
|
|
|
|
<div className="mt-1 text-xl font-semibold">{summary.pending}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className={cardClass}>
|
|
|
|
|
<div className={labelClass}>已完成</div>
|
|
|
|
|
<div className="mt-1 text-xl font-semibold">{summary.completed}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className={cardClass}>
|
|
|
|
|
<div className={labelClass}>异常/关闭</div>
|
|
|
|
|
<div className="mt-1 text-xl font-semibold">{summary.failed}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|