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
|
|
|
import { FILTER_OPTIONS, type OrderStatusFilter } from '@/lib/pay-utils';
|
|
|
|
|
|
|
|
|
|
interface OrderFilterBarProps {
|
|
|
|
|
isDark: boolean;
|
|
|
|
|
activeFilter: OrderStatusFilter;
|
|
|
|
|
onChange: (filter: OrderStatusFilter) => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function OrderFilterBar({ isDark, activeFilter, onChange }: OrderFilterBarProps) {
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex flex-wrap gap-2">
|
|
|
|
|
{FILTER_OPTIONS.map((item) => (
|
|
|
|
|
<button
|
|
|
|
|
key={item.key}
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={() => onChange(item.key)}
|
|
|
|
|
className={[
|
|
|
|
|
'rounded-full border px-3 py-1.5 text-xs font-medium transition-colors',
|
|
|
|
|
activeFilter === item.key
|
2026-03-01 17:58:08 +08:00
|
|
|
? isDark
|
|
|
|
|
? 'border-slate-500 bg-slate-700 text-slate-100'
|
|
|
|
|
: 'border-slate-400 bg-slate-900 text-white'
|
|
|
|
|
: isDark
|
|
|
|
|
? 'border-slate-600 text-slate-300 hover:bg-slate-800'
|
|
|
|
|
: 'border-slate-300 text-slate-600 hover:bg-slate-100',
|
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
|
|
|
].join(' ')}
|
|
|
|
|
>
|
|
|
|
|
{item.label}
|
|
|
|
|
</button>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|