feat: Phase 2 - 订阅管理前端页面(对接真实API) #84

Merged
xiaoxia merged 1 commits from feat/phase2-subscription-ui into develop 2026-06-28 21:03:35 +08:00
Owner

概述

订阅管理前端页面对接后端真实 API,移除所有 mock 数据。

变更文件

1. api/subscription.ts

  • 移除 USE_MOCK 开关及所有 mock 数据
  • 5 个 API 函数全部对接后端真实端点:
    • getCurrentSubscription → GET /subscription/current
    • getBillingRecords → GET /subscription/billing-records
    • changePlan → POST /subscription/change-plan
    • cancelSubscription → POST /subscription/cancel
    • toggleAutoRenew → POST /subscription/toggle-auto-renew

2. pages/subscription/Billing.tsx

  • 移除支付记录 Tab(后端无对应端点)
  • 新增自动续费 Switch 组件,对接 toggle-auto-renew 接口
  • 清理无用导入

3. pages/subscription/UpgradeSubscription.tsx

  • 修复 renewSubscription 导入错误(该函数已从 API 移除)
  • 续费操作统一使用 changePlan
  • 清理无用导入

依赖

  • 需要 PR#78(订阅后端 API)已合并到 develop
## 概述 订阅管理前端页面对接后端真实 API,移除所有 mock 数据。 ## 变更文件 ### 1. `api/subscription.ts` - 移除 `USE_MOCK` 开关及所有 mock 数据 - 5 个 API 函数全部对接后端真实端点: - `getCurrentSubscription` → GET `/subscription/current` - `getBillingRecords` → GET `/subscription/billing-records` - `changePlan` → POST `/subscription/change-plan` - `cancelSubscription` → POST `/subscription/cancel` - `toggleAutoRenew` → POST `/subscription/toggle-auto-renew` ### 2. `pages/subscription/Billing.tsx` - 移除支付记录 Tab(后端无对应端点) - 新增自动续费 Switch 组件,对接 `toggle-auto-renew` 接口 - 清理无用导入 ### 3. `pages/subscription/UpgradeSubscription.tsx` - 修复 `renewSubscription` 导入错误(该函数已从 API 移除) - 续费操作统一使用 `changePlan` - 清理无用导入 ## 依赖 - 需要 PR#78(订阅后端 API)已合并到 develop ✅
xiaoxia force-pushed feat/phase2-subscription-ui from cca631974d to c7027c07d1 2026-06-28 20:15:38 +08:00 Compare
xiaoxia merged commit c81b071a43 into develop 2026-06-28 21:03:35 +08:00
Sign in to join this conversation.