From 8d1cde8636075f257043be7f596cf18cf38be24a Mon Sep 17 00:00:00 2001 From: Guoguo Date: Wed, 29 Apr 2026 05:33:12 -0700 Subject: [PATCH] fix: resolve 8 bugs and add admin features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Miniprogram: - Profile "我的设备": show unbind option when device bound, scan when not - Add device status indicator (已绑定/未绑定) to profile menu Admin console: - Login: add @confirm to inputs so Enter key submits the form - Record detail: wire up 详情 link with modal showing full record info - Dashboard: add subscription stats row (月卡/年卡/试用/收入) - Subscription: add 取消 action for active subscriptions - Format: fix -8h timezone display for UTC ISO date strings Server: - POST /api/v1/admin/subscriptions/cancel: cancel active subscriptions - Dashboard API: include sub_stats (plan counts + monthly revenue) - IP extraction: add X-Forwarded-For fallback for logging --- admin-console/src/pages/dashboard/index.vue | 34 ++++++++++++++++--- admin-console/src/pages/login/index.vue | 2 ++ admin-console/src/pages/record/index.vue | 18 +++++++++- .../src/pages/subscription/index.vue | 21 ++++++++++++ admin-console/src/utils/format.js | 12 +++++++ miniprogram/pages/profile/profile.js | 27 ++++++++++++++- miniprogram/pages/profile/profile.wxml | 2 ++ miniprogram/pages/profile/profile.wxss | 9 +++++ server/src/lib/request.js | 2 +- server/src/routes/admin.js | 25 +++++++++++++- 10 files changed, 144 insertions(+), 8 deletions(-) diff --git a/admin-console/src/pages/dashboard/index.vue b/admin-console/src/pages/dashboard/index.vue index aaafa12..f1d8606 100644 --- a/admin-console/src/pages/dashboard/index.vue +++ b/admin-console/src/pages/dashboard/index.vue @@ -23,6 +23,25 @@ + + + {{ subStats.monthly_count || 0 }} + 月卡会员 + + + {{ subStats.yearly_count || 0 }} + 年卡会员 + + + {{ subStats.trial_count || 0 }} + 试用中 + + + ¥{{ subStats.monthly_revenue || 0 }} + 本月收入 + + + @@ -91,6 +110,7 @@