From 2f35520670c6f6982d0dcbaad68b73d79441221e Mon Sep 17 00:00:00 2001
From: Alex-larget <33240357+Alex-larget@users.noreply.github.com>
Date: Tue, 17 Mar 2026 13:17:49 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9A=E5=90=88=E5=B9=B6=E7=9A=84?=
=?UTF-8?q?=E7=A8=B3=E5=AE=9A=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../agent/产品经理/evolution/2026-03-17.md | 8 +
.../agent/后端工程师/evolution/2026-03-17.md | 7 +
.cursor/agent/团队/evolution/2026-03-17.md | 16 +
.cursor/agent/开发助理/项目索引/助理橙子.md | 3 +-
.cursor/agent/开发助理/项目索引/后端.md | 1 +
.cursor/agent/开发助理/项目索引/管理端.md | 14 +-
.../管理端开发工程师/evolution/2026-03-17.md | 15 +
.../agent/软件测试/evolution/2026-03-17.md | 8 +
...3-17_新版管理端迁移到稳定版实施方案确认.md | 106 ++
.cursor/meeting/README.md | 1 +
.cursor/rules/soul-project-boundary.mdc | 3 +-
miniprogram/app.json | 1 -
miniprogram/pages/agreement/agreement.wxml | 2 +-
miniprogram/pages/chapters/chapters.js | 24 +-
miniprogram/pages/chapters/chapters.wxml | 2 +-
miniprogram/pages/index/index.js | 28 +-
miniprogram/pages/index/index.wxml | 4 +-
miniprogram/pages/my/my.js | 19 +-
miniprogram/pages/my/my.wxml | 13 +-
miniprogram/pages/privacy/privacy.wxml | 2 +-
soul-admin/dist/assets/index-BC7lp6bO.js | 914 ++++++++++++++++++
soul-admin/dist/assets/index-BHi-SnBy.css | 1 -
soul-admin/dist/assets/index-BcWuvM_a.css | 1 +
soul-admin/dist/assets/index-C2K6IQif.js | 779 ---------------
soul-admin/dist/index.html | 4 +-
soul-admin/src/App.tsx | 2 +
.../modules/user/UserDetailModal.tsx | 93 +-
soul-admin/src/layouts/AdminLayout.tsx | 17 +-
soul-admin/src/pages/api-docs/ApiDocsPage.tsx | 443 +++++++++
.../pages/distribution/DistributionPage.tsx | 148 ++-
.../src/pages/settings/SettingsPage.tsx | 130 ++-
soul-admin/tsconfig.tsbuildinfo | 2 +-
soul-api/internal/handler/balance.go | 47 +
soul-api/internal/handler/book.go | 52 +-
soul-api/internal/handler/db.go | 18 +-
soul-api/internal/handler/gift_pay.go | 74 ++
soul-api/internal/router/router.go | 7 +
开发文档/10、项目管理/运营与变更.md | 23 +
开发文档/1、需求/以界面定需求.md | 5 +-
开发文档/新版管理端迁移到稳定版-需求评估.md | 153 +++
开发文档/稳定版-源码质量分析报告.md | 175 ++++
开发文档/稳定版-管理端与小程序对接分析.md | 123 +++
开发文档/管理端两版界面差异-新需求参考.md | 36 +
开发文档/管理端迁移分析-基于小程序功能.md | 89 ++
44 files changed, 2754 insertions(+), 859 deletions(-)
create mode 100644 .cursor/agent/产品经理/evolution/2026-03-17.md
create mode 100644 .cursor/agent/管理端开发工程师/evolution/2026-03-17.md
create mode 100644 .cursor/agent/软件测试/evolution/2026-03-17.md
create mode 100644 .cursor/meeting/2026-03-17_新版管理端迁移到稳定版实施方案确认.md
create mode 100644 soul-admin/dist/assets/index-BC7lp6bO.js
delete mode 100644 soul-admin/dist/assets/index-BHi-SnBy.css
create mode 100644 soul-admin/dist/assets/index-BcWuvM_a.css
delete mode 100644 soul-admin/dist/assets/index-C2K6IQif.js
create mode 100644 soul-admin/src/pages/api-docs/ApiDocsPage.tsx
create mode 100644 开发文档/新版管理端迁移到稳定版-需求评估.md
create mode 100644 开发文档/稳定版-源码质量分析报告.md
create mode 100644 开发文档/稳定版-管理端与小程序对接分析.md
create mode 100644 开发文档/管理端两版界面差异-新需求参考.md
create mode 100644 开发文档/管理端迁移分析-基于小程序功能.md
diff --git a/.cursor/agent/产品经理/evolution/2026-03-17.md b/.cursor/agent/产品经理/evolution/2026-03-17.md
new file mode 100644
index 00000000..f7b8d01b
--- /dev/null
+++ b/.cursor/agent/产品经理/evolution/2026-03-17.md
@@ -0,0 +1,8 @@
+# 产品经理 经验记录 - 2026-03-17
+
+## 新版管理端迁移到稳定版(会议:实施方案确认)
+
+- **需求基准**:以稳定版小程序为准,管理端支撑余额、代付、VIP、规则引擎等
+- **内容管理**:以稳定版为主,不采纳新版
+- **新版独有**:API 文档、OSS、编辑禁用、鉴权 → 全部吸纳(用户决议「新版有的就迁移」)
+- **待确认**:RFM、用户旅程、神射手是否继续使用
diff --git a/.cursor/agent/后端工程师/evolution/2026-03-17.md b/.cursor/agent/后端工程师/evolution/2026-03-17.md
index 03cbe02e..0f661268 100644
--- a/.cursor/agent/后端工程师/evolution/2026-03-17.md
+++ b/.cursor/agent/后端工程师/evolution/2026-03-17.md
@@ -26,3 +26,10 @@
- 供小程序区分发起人/好友,展示不同 UI
- 字段:`initiatorUserId`(发起人 user_id)
+
+---
+
+## 新版管理端迁移 - 后端任务(会议:2026-03-17)
+
+- **router 补齐**:迁移前注册 5 个路由:`db.GET("/users/rfm")`、`db.GET("/users/journey-stats")`、`admin.GET("/shensheshou/query")`、`admin.POST("/shensheshou/enrich")`、`admin.POST("/shensheshou/ingest")`
+- **待确认**:/api/admin/settings 是否已支持 ossConfig,若不支持需补充
diff --git a/.cursor/agent/团队/evolution/2026-03-17.md b/.cursor/agent/团队/evolution/2026-03-17.md
index 4f47f556..51d21ad1 100644
--- a/.cursor/agent/团队/evolution/2026-03-17.md
+++ b/.cursor/agent/团队/evolution/2026-03-17.md
@@ -19,3 +19,19 @@
- 小程序:代付详情页双态 UI、读页跳转
- 后端:PayNotify beneficiaryUserID、detail initiatorUserId
+
+---
+
+## 新版管理端迁移到稳定版(会议:2026-03-17)
+
+### 决议
+
+- **内容管理**:以稳定版为主,不采纳新版
+- **新版独有**:API 文档 Tab、api-docs 独立页、OSS 配置、编辑时手机号禁用、鉴权逻辑 → **全部吸纳**
+- **后端**:迁移前补 router(users/rfm、journey-stats、shensheshou 共 5 个)
+
+### 影响角色
+
+- 管理端开发工程师:主导迁移
+- 后端开发:router 补齐、ossConfig 确认
+- 测试人员:迁移后验收
diff --git a/.cursor/agent/开发助理/项目索引/助理橙子.md b/.cursor/agent/开发助理/项目索引/助理橙子.md
index 657a7496..794624fe 100644
--- a/.cursor/agent/开发助理/项目索引/助理橙子.md
+++ b/.cursor/agent/开发助理/项目索引/助理橙子.md
@@ -22,9 +22,10 @@
| 2026-03-17 | 吸收需求:代付美团式流程、PayNotify 权益归属、目录 loading、最新新增 5 条折叠 → 开发文档与 agent | 已完成 |
| 2026-03-17 | 乘风吸收经验与交互:迁移完成度与待办清单、运营与变更第十二部分 | 已完成 |
| 2026-03-17 | 吸收新需求:代付统一到代付页(gift=1&ref redirectTo)→ 需求汇总、找朋友代付流程、运营与变更 | 已完成 |
+| 2026-03-17 | 会议收尾:新版管理端迁移到稳定版实施方案确认;纪要、各角色经验入库、项目索引更新 | 已完成 |
> **格式说明**:每次开发后在此追加一行,日期格式 YYYY-MM-DD,状态用:已完成 / 进行中 / 待续 / 搁置
---
-**最后更新**:2026-03-17(吸收代付与体验优化需求)
+**最后更新**:2026-03-17(会议收尾:新版管理端迁移实施方案)
diff --git a/.cursor/agent/开发助理/项目索引/后端.md b/.cursor/agent/开发助理/项目索引/后端.md
index eb6e4df1..c2ad1d0f 100644
--- a/.cursor/agent/开发助理/项目索引/后端.md
+++ b/.cursor/agent/开发助理/项目索引/后端.md
@@ -32,6 +32,7 @@ soul-api(Go + Gin + GORM + MySQL)提供三组路由:`/api/miniprogram/*`
| 2026-03-16 | ParseAutoLinkContent 添加 data-label;存客宝 create planType=1 sceneId=9 status=1 | 已完成 |
| 2026-03-16 | 会议:new-soul 新需求与当前项目差异分析;content_upload.py 与 chapters 一致性待核对 | 待续 |
| 2026-03-17 | 代付 PayNotify 权益归属修复:beneficiaryUserID(代付=发起人);gift-pay detail 返回 initiatorUserId | 已完成 |
+| 2026-03-17 | 会议:新版管理端迁移;router 补齐 users/rfm、journey-stats、shensheshou 共 5 个;确认 ossConfig | 进行中 |
> **格式说明**:每次开发后在此追加一行,日期格式 YYYY-MM-DD,状态用:已完成 / 进行中 / 待续 / 搁置
diff --git a/.cursor/agent/开发助理/项目索引/管理端.md b/.cursor/agent/开发助理/项目索引/管理端.md
index 7587c47b..16c08668 100644
--- a/.cursor/agent/开发助理/项目索引/管理端.md
+++ b/.cursor/agent/开发助理/项目索引/管理端.md
@@ -8,6 +8,13 @@
管理端(React + Vite + Tailwind)主要功能:用户管理、订单管理、提现审核、VIP 管理、内容/章节管理、配置项管理、数据统计。调用 `/api/admin/*` 与 `/api/db/*` 接口,JWT Bearer 鉴权。
+### 项目路径定义
+
+| 版本 | 路径 | 说明 |
+|------|------|------|
+| **稳定版(主用)** | `soul-admin/` | 根目录,线上部署 |
+| **新版(参考)** | `new-soul/soul-admin/` | 迁移时对照,含 ApiDocsPage 完整版、OSS region 等 |
+
---
## 开发进度
@@ -28,9 +35,14 @@
| 2026-03-16 | 乘风发起例行开发进度同步 | 已完成 |
| 2026-03-16 | 链接人与事:table 布局、planId/apiKey 列、复制图标、删除 Dialog 弹窗 | 已完成 |
| 2026-03-16 | 会议:new-soul 新需求与当前项目差异分析;派对AI 不新增管理端需求 | 已完成 |
+| 2026-03-17 | 会议:新版管理端迁移到稳定版实施方案确认;新版独有全部吸纳,内容管理以稳定版为主 | 已完成 |
+| 2026-03-17 | 吸收新版管理端定义(new-soul/soul-admin);迁移 ApiDocsPage 完整版、OSS region、鉴权失败 clearAdminToken | 已完成 |
+| 2026-03-17 | 修复 DistributionPage Order.description;用户余额人工调整(后端 adjust API + 用户详情入口);代付列表页(后端 gift-pay-requests + 推广中心 Tab) | 已完成 |
> **格式说明**:每次开发后在此追加一行,日期格式 YYYY-MM-DD,状态用:已完成 / 进行中 / 待续 / 搁置
---
-**最后更新**:2026-03-16
+**最后更新**:2026-03-17
+
+> 注:soul-admin 构建仍有 DistributionPage Order.description 类型错误(与本次迁移无关),待修复。
diff --git a/.cursor/agent/管理端开发工程师/evolution/2026-03-17.md b/.cursor/agent/管理端开发工程师/evolution/2026-03-17.md
new file mode 100644
index 00000000..f60ce696
--- /dev/null
+++ b/.cursor/agent/管理端开发工程师/evolution/2026-03-17.md
@@ -0,0 +1,15 @@
+# 管理端开发工程师 经验记录 - 2026-03-17
+
+## 新版管理端迁移到稳定版(会议:实施方案确认)
+
+### 迁移策略
+
+- **内容管理**:以稳定版为主,不采纳新版,ContentPage 及关联组件不覆盖
+- **新版独有全部吸纳**:API 文档 Tab、api-docs 独立页、OSS 配置、编辑时手机号禁用、鉴权逻辑
+- **必须保留**:用户详情余额、订单支付方式/代付、RechargeAlert、LinkedMp、用户规则、超级个体
+
+### 实施任务
+
+1. 从 new-soul/soul-admin 迁移:ApiDocsPage、OSS 配置、api-docs 路由、编辑时手机号禁用、鉴权逻辑
+2. 以稳定版为基准合并,内容管理不覆盖
+3. 按模块分批:Layout/Dashboard/设置 → 用户/订单/推广/提现/找伙伴
diff --git a/.cursor/agent/软件测试/evolution/2026-03-17.md b/.cursor/agent/软件测试/evolution/2026-03-17.md
new file mode 100644
index 00000000..5b7d2b45
--- /dev/null
+++ b/.cursor/agent/软件测试/evolution/2026-03-17.md
@@ -0,0 +1,8 @@
+# 软件测试 经验记录 - 2026-03-17
+
+## 新版管理端迁移验收(会议:实施方案确认)
+
+- **验收清单**:按《新版管理端迁移到稳定版-需求评估》§七
+- **回归范围**:提现、分销、找伙伴、导师、设置等
+- **风险**:合并时避免误覆盖稳定版独有逻辑,建议 diff 逐模块核对
+- **三端联调**:管理端 ↔ soul-api 重点验证;用户规则、订单、余额展示
diff --git a/.cursor/meeting/2026-03-17_新版管理端迁移到稳定版实施方案确认.md b/.cursor/meeting/2026-03-17_新版管理端迁移到稳定版实施方案确认.md
new file mode 100644
index 00000000..a840f8f0
--- /dev/null
+++ b/.cursor/meeting/2026-03-17_新版管理端迁移到稳定版实施方案确认.md
@@ -0,0 +1,106 @@
+# 会议纪要 - 2026-03-17 | 新版管理端迁移到稳定版实施方案确认
+
+> 本文件由**助理橙子**在会议结束后自动生成。
+
+---
+
+## 基本信息
+
+- **时间**:2026-03-17
+- **议题**:新版管理端迁移到稳定版 - 确认实施方案
+- **触发方式**:乘风调动开发人员开会,并确认实施方案
+- **参与角色**:产品经理、后端开发、管理端开发工程师、小程序开发工程师、测试人员
+
+---
+
+## 各角色发言
+
+### 【产品经理】
+
+需求基准以稳定版小程序为准;内容管理以稳定版为主;验收标准见《需求评估》§七;RFM、journey、神射手是否保留需运营确认。
+
+### 【后端开发】
+
+以稳定版为主,后端无需新增接口;若保留 RFM/journey/神射手需补 5 个 router;OSS 需确认 /api/admin/settings 是否支持 ossConfig;建议先补 router 再迁移。
+
+### 【管理端开发工程师】
+
+内容管理以稳定版为准不覆盖;必须保留用户详情余额、订单支付方式/代付、RechargeAlert、LinkedMp 等;可吸纳编辑禁用、鉴权、API 文档、OSS;按模块分批合并。
+
+### 【小程序开发工程师】
+
+本次主要影响管理端,小程序无需改动;迁移后做三端联调验证用户规则、订单、余额。
+
+### 【测试人员】
+
+按《需求评估》§七验收;回归提现、分销、找伙伴等;合并时避免误覆盖稳定版独有逻辑。
+
+---
+
+## 讨论过程
+
+- 乘风确认:后端 router 补齐建议迁移前完成
+- 产品经理:OSS 按实际部署需求,用户决议「新版有的就迁移」→ OSS 纳入
+- 管理端:同意 OSS 纳入,新版独有能力全部吸纳
+
+---
+
+## 会议决议
+
+1. **新版有的就迁移**:API 文档 Tab、api-docs 独立页、OSS 配置、编辑时手机号禁用、鉴权逻辑优化,全部吸纳到稳定版
+2. **内容管理**:以稳定版为主,不采纳新版
+3. **后端 router**:迁移前补齐 users/rfm、users/journey-stats、shensheshou 共 5 个路由(若运营使用)
+4. **实施顺序**:Phase 0 后端补 router → Phase 1 基础模块 → Phase 2 业务模块 → Phase 3 内容保持 → Phase 4 验收
+
+---
+
+## 待办事项(乘风指派)
+
+| 责任角色 | 任务 | 优先级 | 截止建议 |
+|---------|------|--------|---------|
+| 后端开发 | soul-api router 注册 users/rfm、users/journey-stats、shensheshou 共 5 个路由 | 高 | 迁移前 |
+| 后端开发 | 确认 /api/admin/settings 是否支持 ossConfig,若不支持则补充 | 中 | 迁移前 |
+| 管理端开发工程师 | 从 new-soul/soul-admin 迁移:ApiDocsPage、OSS 配置、api-docs 路由、编辑时手机号禁用、鉴权逻辑 | 高 | - |
+| 管理端开发工程师 | 以稳定版为基准合并,内容管理不覆盖,其他模块选择性合并 | 高 | - |
+| 测试人员 | 迁移完成后按《需求评估》§七执行验收,三端联调 | 中 | 迁移后 |
+
+---
+
+## 问题与作答区
+
+| # | 问题 | 责任角色 | 作答 |
+|---|------|---------|------|
+| 1 | RFM、用户旅程、神射手是否继续使用? | 产品/运营 | (待补充) |
+| 2 | /api/admin/settings 是否已支持 ossConfig? | 后端开发 | (待补充) |
+
+---
+
+## 各角色经验与业务理解更新
+
+### 产品经理
+
+- 新版管理端迁移以稳定版为基准,内容管理以稳定版为主;新版独有能力(API 文档、OSS、编辑禁用、鉴权)全部吸纳
+
+### 后端开发
+
+- 迁移前需补 router:users/rfm、users/journey-stats、shensheshou 共 5 个;需确认 settings 的 ossConfig 支持
+
+### 管理端开发工程师
+
+- 迁移策略:内容管理不覆盖;其他模块以稳定版为主;吸纳新版 ApiDocsPage、OSS、编辑禁用、鉴权;按模块分批合并
+
+### 小程序开发工程师
+
+- 管理端迁移不影响小程序;迁移后做三端联调验证
+
+### 测试人员
+
+- 验收按《需求评估》§七;合并时需 diff 核对避免误覆盖
+
+### 团队共享
+
+- 新版管理端迁移到稳定版:内容管理以稳定版为主,新版独有能力全部吸纳;详见 agent/团队/evolution/2026-03-17.md
+
+---
+
+*会议纪要由助理橙子生成 | 各角色经验已同步至 `agent/{角色}/evolution/2026-03-17.md`*
diff --git a/.cursor/meeting/README.md b/.cursor/meeting/README.md
index 43e7b188..ff56a14e 100644
--- a/.cursor/meeting/README.md
+++ b/.cursor/meeting/README.md
@@ -75,3 +75,4 @@ YYYY-MM-DD_会议主题.md
| 2026-03-11 | 开发团队对齐业务逻辑与以界面定需求·会议收尾 | 产品、后端、管理端、小程序、团队 | [2026-03-11_开发团队对齐业务逻辑与以界面定需求会议收尾.md](2026-03-11_开发团队对齐业务逻辑与以界面定需求会议收尾.md) |
| 2026-03-16 | 链接人与事与存客宝对接优化 | 管理端、后端、团队 | [2026-03-16_链接人与事与存客宝对接优化.md](2026-03-16_链接人与事与存客宝对接优化.md) |
| 2026-03-16 | new-soul 新需求与当前项目差异分析 | 产品、后端、管理端、小程序、测试 | [2026-03-16_new-soul新需求与当前项目差异分析.md](2026-03-16_new-soul新需求与当前项目差异分析.md) |
+| 2026-03-17 | 新版管理端迁移到稳定版实施方案确认 | 产品、后端、管理端、小程序、测试 | [2026-03-17_新版管理端迁移到稳定版实施方案确认.md](2026-03-17_新版管理端迁移到稳定版实施方案确认.md) |
diff --git a/.cursor/rules/soul-project-boundary.mdc b/.cursor/rules/soul-project-boundary.mdc
index 849c25f2..1643b7b7 100644
--- a/.cursor/rules/soul-project-boundary.mdc
+++ b/.cursor/rules/soul-project-boundary.mdc
@@ -15,9 +15,10 @@ alwaysApply: true
| 子项目 | 目录 | 用途 | 后端对接 |
|--------|------|------|----------|
| 小程序 | miniprogram/ | 微信原生小程序 C 端 | soul-api |
-| 管理端 | soul-admin/ | React 管理后台 | soul-api |
+| 管理端 | soul-admin/ | React 管理后台(稳定版,主用) | soul-api |
| API 后端 | soul-api/ | Go + Gin + GORM 接口服务 | - |
| 预览/参考 | next-project/ | 仅预览,非线上 | 不依赖 |
+| **新版管理端** | **new-soul/soul-admin/** | 新版参考实现,迁移时对照 | soul-api |
## 核心原则
diff --git a/miniprogram/app.json b/miniprogram/app.json
index dcbbf6c6..dcb27c14 100644
--- a/miniprogram/app.json
+++ b/miniprogram/app.json
@@ -6,7 +6,6 @@
"pages/my/my",
"pages/read/read",
"pages/link-preview/link-preview",
- "pages/about/about",
"pages/agreement/agreement",
"pages/privacy/privacy",
"pages/referral/referral",
diff --git a/miniprogram/pages/agreement/agreement.wxml b/miniprogram/pages/agreement/agreement.wxml
index 4060b50c..a1987185 100644
--- a/miniprogram/pages/agreement/agreement.wxml
+++ b/miniprogram/pages/agreement/agreement.wxml
@@ -31,7 +31,7 @@
我们可能适时修订本协议,修订后将在小程序内公示。若您继续使用服务,即视为接受修订后的协议。
七、联系我们
- 如有疑问,请通过小程序内「关于作者」或 Soul 派对房与我们联系。
+ 如有疑问,请通过 Soul 派对房与我们联系。
diff --git a/miniprogram/pages/chapters/chapters.js b/miniprogram/pages/chapters/chapters.js
index 16a10a8f..f27a71eb 100644
--- a/miniprogram/pages/chapters/chapters.js
+++ b/miniprogram/pages/chapters/chapters.js
@@ -44,7 +44,10 @@ Page({
dailyChapters: [],
// book/parts 加载中
- partsLoading: true
+ partsLoading: true,
+
+ // 功能配置(搜索开关)
+ searchEnabled: true
},
onLoad() {
@@ -57,6 +60,24 @@ Page({
this.loadVipStatus()
this.loadParts()
this.loadDailyChapters()
+ this.loadFeatureConfig()
+ },
+
+ async loadFeatureConfig() {
+ try {
+ if (app.globalData.features && typeof app.globalData.features.searchEnabled === 'boolean') {
+ this.setData({ searchEnabled: app.globalData.features.searchEnabled })
+ return
+ }
+ const res = await app.request({ url: '/api/miniprogram/config', silent: true })
+ const features = (res && res.features) || {}
+ const searchEnabled = features.searchEnabled !== false
+ if (!app.globalData.features) app.globalData.features = {}
+ app.globalData.features.searchEnabled = searchEnabled
+ this.setData({ searchEnabled })
+ } catch (e) {
+ this.setData({ searchEnabled: true })
+ }
},
// 懒加载:仅拉取篇章列表 + totalSections + fixedSections
@@ -280,6 +301,7 @@ Page({
// 跳转到搜索页
goToSearch() {
+ if (!this.data.searchEnabled) return
trackClick('chapters', 'nav_click', '搜索')
wx.navigateTo({ url: '/pages/search/search' })
},
diff --git a/miniprogram/pages/chapters/chapters.wxml b/miniprogram/pages/chapters/chapters.wxml
index 2daf930f..152f40ee 100644
--- a/miniprogram/pages/chapters/chapters.wxml
+++ b/miniprogram/pages/chapters/chapters.wxml
@@ -5,7 +5,7 @@
-
+
🔍
diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js
index 5e20ddb7..0084fb5d 100644
--- a/miniprogram/pages/index/index.js
+++ b/miniprogram/pages/index/index.js
@@ -65,7 +65,10 @@ Page({
featuredExpanded: false,
latestExpanded: false,
featuredSectionsFull: [], // 展开时用 book/hot 加载的完整列表
- featuredExpandedLoading: false
+ featuredExpandedLoading: false,
+
+ // 功能配置(搜索开关)
+ searchEnabled: true
},
onLoad(options) {
@@ -84,6 +87,7 @@ Page({
}
wx.showShareMenu({ withShareTimeline: true })
+ this.loadFeatureConfig()
this.initData()
},
@@ -308,8 +312,26 @@ Page({
wx.switchTab({ url: '/pages/chapters/chapters' })
},
+ async loadFeatureConfig() {
+ try {
+ if (app.globalData.features && typeof app.globalData.features.searchEnabled === 'boolean') {
+ this.setData({ searchEnabled: app.globalData.features.searchEnabled })
+ return
+ }
+ const res = await app.request({ url: '/api/miniprogram/config', silent: true })
+ const features = (res && res.features) || {}
+ const searchEnabled = features.searchEnabled !== false
+ if (!app.globalData.features) app.globalData.features = {}
+ app.globalData.features.searchEnabled = searchEnabled
+ this.setData({ searchEnabled })
+ } catch (e) {
+ this.setData({ searchEnabled: true })
+ }
+ },
+
// 跳转到搜索页
goToSearch() {
+ if (!this.data.searchEnabled) return
wx.navigateTo({ url: '/pages/search/search' })
},
@@ -330,10 +352,6 @@ Page({
wx.navigateTo({ url: '/pages/vip/vip' })
},
- goToAbout() {
- wx.navigateTo({ url: '/pages/about/about' })
- },
-
async onLinkKaruo() {
const app = getApp()
if (!app.globalData.isLoggedIn || !app.globalData.userInfo) {
diff --git a/miniprogram/pages/index/index.wxml b/miniprogram/pages/index/index.wxml
index 50b9f5a4..6b0434ff 100644
--- a/miniprogram/pages/index/index.wxml
+++ b/miniprogram/pages/index/index.wxml
@@ -24,8 +24,8 @@
-
-
+
+
🔍
diff --git a/miniprogram/pages/my/my.js b/miniprogram/pages/my/my.js
index 0f2f1c72..62399fc6 100644
--- a/miniprogram/pages/my/my.js
+++ b/miniprogram/pages/my/my.js
@@ -38,6 +38,8 @@ Page({
// 功能配置
matchEnabled: false,
+ referralEnabled: true,
+ searchEnabled: true,
// VIP状态
isVip: false,
@@ -113,10 +115,14 @@ Page({
try {
const res = await app.request('/api/miniprogram/config')
const features = (res && res.features) || (res && res.data && res.data.features) || {}
- this.setData({ matchEnabled: features.matchEnabled === true })
+ const matchEnabled = features.matchEnabled === true
+ const referralEnabled = features.referralEnabled !== false
+ const searchEnabled = features.searchEnabled !== false
+ app.globalData.features = { matchEnabled, referralEnabled, searchEnabled }
+ this.setData({ matchEnabled, referralEnabled, searchEnabled })
} catch (error) {
console.log('加载功能配置失败:', error)
- this.setData({ matchEnabled: false })
+ this.setData({ matchEnabled: false, referralEnabled: true, searchEnabled: true })
}
},
@@ -759,7 +765,7 @@ Page({
handleMenuTap(e) {
const id = e.currentTarget.dataset.id
- if (!this.data.isLoggedIn && id !== 'about') {
+ if (!this.data.isLoggedIn) {
this.showLogin()
return
}
@@ -770,7 +776,6 @@ Page({
referral: '/pages/referral/referral',
withdrawRecords: '/pages/withdraw-records/withdraw-records',
wallet: '/pages/wallet/wallet',
- about: '/pages/about/about',
settings: '/pages/settings/settings'
}
@@ -792,11 +797,6 @@ Page({
wx.switchTab({ url: '/pages/chapters/chapters' })
},
- // 跳转到关于页
- goToAbout() {
- wx.navigateTo({ url: '/pages/about/about' })
- },
-
// 跳转到匹配
goToMatch() {
wx.switchTab({ url: '/pages/match/match' })
@@ -808,6 +808,7 @@ Page({
this.showLogin()
return
}
+ if (!this.data.referralEnabled) return
wx.navigateTo({ url: '/pages/referral/referral' })
},
diff --git a/miniprogram/pages/my/my.wxml b/miniprogram/pages/my/my.wxml
index 3d2c2177..f504c31e 100644
--- a/miniprogram/pages/my/my.wxml
+++ b/miniprogram/pages/my/my.wxml
@@ -55,11 +55,11 @@
{{readCountText}}
已读章节
-
+
{{referralCount}}
推荐好友
-
+
{{earnings === '-' ? '--' : earnings}}
我的收益
@@ -148,7 +148,7 @@
-
+