erio
886389939e
style: format all files with Prettier
2026-03-14 03:45:37 +08:00
erio
3b5a3ba5df
fix: 暗色主题全面优化 - 滚动条、颜色适配、dark:伪类修复
...
- 添加全局暗色滚动条样式 (globals.css)
- 修复 channels/subscriptions 页面 dark: 伪类无效的bug (改用 isDark)
- 修复 RefundDialog 暗色下退款金额、disabled 按钮颜色
- 修复 admin OrderTable 暗色下缺少背景色
- 统一所有 admin 页面 text-gray-500 为 slate 色系
- 修复 UserSubscriptions 续费按钮暗色适配
- 修复日期标签文字缺少暗色颜色类
- MainTabs 暗色容器改用 slate-900 提升对比度
- OpenAI 默认模型区域暗色边框透明度提升
- 更新 README 文档
2026-03-14 03:19:39 +08:00
erio
9096271307
fix: 禁止所有模态框点击外部关闭,防止数据丢失
...
移除 channels 编辑/同步、TopUpModal、OrderDetail、RefundDialog
四处模态框 backdrop 上的 onClick 关闭行为及 stopPropagation,
用户只能通过显式关闭按钮或取消按钮关闭弹窗。
同时新增支付宝直连和微信支付直连接入文档。
2026-03-13 19:51:20 +08:00
erio
9f621713c3
style: 统一代码格式 (prettier)
2026-03-10 18:20:36 +08:00
erio
2492031e13
feat: 全站多语言支持 (i18n),lang=en 显示英文,其余默认中文
...
新增 src/lib/locale.ts 作为统一多语言入口,覆盖前台支付链路、
管理后台、API/服务层错误文案,共 35 个文件。URL 参数 lang 全链路透传,
包括 Stripe return_url、页面跳转、layout html lang 属性等。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-09 18:33:57 +08:00
erio
d43b04cb5c
fix: 前端暗色模式补全、Unicode 可读化、UI 优化 12 项
...
- PaymentQRCode 13 处 Unicode 转义替换为可读中文
- RefundDialog 完整暗色模式 + Escape 键关闭
- PayResult 页面添加暗色模式支持
- OrderStatus 使用 dark prop 调整样式
- PaymentForm 选中态暗色对比度修复
- OrderDetail 英文标签改中文 + Escape 键
- Pay 页面错误提示暗色适配
- 倒计时最后 60 秒脉动提醒
- 全局 CSS 添加中文字体栈
- MobileOrderList HTML 实体替换
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-07 04:16:01 +08:00
erio
254ead1908
refactor: 常量化订单状态 + 支付渠道/提供商分离显示 + H5自动跳转
...
- 新增 src/lib/constants.ts,集中管理 ORDER_STATUS / PAYMENT_TYPE / PAYMENT_PREFIX 等常量
- 后端 service/status/timeout/limits 全量替换魔法字符串为 ORDER_STATUS.*
- PaymentTypeMeta 新增 provider 字段,分离 sublabel(选择器展示)与 provider(提供商名称)
- getPaymentDisplayInfo() 返回 { channel, provider } 用于用户端/管理端展示
- 支持通过 PAYMENT_SUBLABEL_* 环境变量覆盖默认 sublabel
- PaymentQRCode: H5 支付自动跳转(含易支付微信 weixin:// scheme 兜底)
- 订单列表/详情页:显示可读的渠道名+提供商,不再暴露内部标识符
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-06 17:34:42 +08:00
erio
3829d0e52e
refactor: 将支付类型硬编码抽取到 pay-utils 统一管理
...
- PaymentTypeMeta 新增 iconSrc、chartBar、buttonClass 字段
- 新增工具函数: getPaymentMeta、getPaymentIconSrc、
getPaymentChannelLabel、isStripeType、isRedirectPayment 等
- PaymentQRCode: 用 meta/工具函数替换散落的颜色和类型判断
- PaymentForm: 提交按钮颜色改用 meta.buttonClass
- PaymentMethodChart: 删除重复的 TYPE_CONFIG,改用 getPaymentMeta
- stripe-popup: 按钮颜色改用 meta.buttonClass
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-06 16:46:36 +08:00
erio
f53aa9e14c
feat: 支持官方支付宝与易支付支付宝同时展示
...
- PaymentType 改为 string 类型,支持复合 key(如 alipay_direct)
- 官方支付宝注册为 alipay_direct,易支付保持 alipay/wxpay
- 前端按 PAYMENT_TYPE_META 展示标签区分(官方直连/易支付)
- 管理后台显示统一改为 getPaymentTypeLabel 通用映射
- 修复 admin/OrderTable 中 wechat 拼写错误
2026-03-06 15:33:22 +08:00
erio
0a35ba9002
style: 全量 prettier 格式化
2026-03-05 23:10:44 +08:00
miwei
f1e3fd35ef
fix: 数据看板时区统一为 Asia/Shanghai + 订单列表支付方式显示修复
...
- dashboard API 日期计算和 SQL GROUP BY 统一使用东八区,避免 UTC 服务器上"今日"统计偏移
- OrderTable 支付方式显示支持 stripe/wechat/alipay 三种,修复 stripe 误显为微信支付
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-05 10:13:57 +08:00
miwei
3a9a32e2c2
feat: 管理后台数据看板
...
新增 /admin/dashboard 页面,提供充值订单统计与分析:
- 汇总统计卡片(今日/累计充值金额、订单数、成功率、平均充值)
- 每日充值趋势折线图(recharts,支持 7/30/90 天切换)
- 充值排行榜(Top 10 用户)
- 支付方式分布(水平条形图)
- 与 /admin 订单管理页面互相导航
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-04 17:06:27 +08:00
erio
42da18484c
feat: 管理后台订单列表展示用户备注,用户信息摊平显示
...
- 新增 userNotes 字段,创建订单时从 Sub2API 读取用户 notes 保存
- 管理后台订单列表将用户名、邮箱、备注拆分为独立列,节约行高
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-03 04:37:39 +08:00
erio
880f0211f3
feat: 管理后台统一 PayPageLayout 布局,支持 dark mode
...
管理后台使用与充值页面相同的 PayPageLayout 组件,OrderTable 和
OrderDetail 组件新增 dark prop,所有样式支持暗色模式切换。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-03 03:31:20 +08:00
erio
c9462f4f14
feat: 管理后台订单列表显示来源域名(srcHost)
...
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-03 00:19:01 +08:00
erio
d952942627
feat: 订单来源追踪,保存 src_host / src_url 到订单记录
...
iframe 嵌入充值页面时 URL 自动附带来源参数,写入数据库用于追踪分析。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-02 20:40:16 +08:00
erio
d9ab65ecf2
feat: integrate Stripe payment with bugfixes and active timeout cancellation
...
- Add Stripe payment provider with Checkout Session flow
- Payment provider abstraction layer (EasyPay + Stripe unified interface)
- Stripe webhook with proper raw body handling and signature verification
- Frontend: Stripe button with URL validation, anti-duplicate click, noopener
- Active timeout cancellation: query platform before expiring, recover paid orders
- Singleton Stripe client, idempotency keys, Math.round for amounts
- Handle async_payment events, return null for unknown webhook events
- Set Checkout Session expires_at aligned with order timeout
- Add cancelPayment to provider interface (Stripe: sessions.expire, EasyPay: no-op)
- Enable stripe in frontend payment type list
2026-03-01 17:58:08 +08:00
erio
2f45044073
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
erio
d5719bf213
feat: migrate payment provider to easy-pay, add order history and refund support
...
- Replace zpay with easy-pay payment provider (new lib/easy-pay/ module)
- Add order history page for users (pay/orders)
- Add GET /api/orders/my endpoint to list user's own orders
- Add GET /api/users/[id] endpoint for sub2api user lookup
- Add order status tracking module (lib/order/status.ts)
- Update config to support easy-pay credentials (merchant ID, key, gateway)
- Update PaymentForm and PaymentQRCode components for easy-pay flow
- Update pay page and admin page with new order management UI
- Update order service to support easy-pay, cancellation, and refund
2026-03-01 03:04:24 +08:00