From 5da7d17c5541b28a34a4f6b3fb75b81b352a96e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com>
Date: Thu, 23 Jul 2026 18:27:13 +0800
Subject: [PATCH] =?UTF-8?q?feat(user):=20=E5=90=88=E5=B9=B6=E5=B9=B6?=
=?UTF-8?q?=E5=88=87=E6=8D=A2=E2=80=9C=E7=94=B3=E8=AF=B7=E5=BC=80=E5=8F=91?=
=?UTF-8?q?=E8=80=85=E2=80=9D=E8=8F=9C=E5=8D=95=E9=A1=B9=E7=8A=B6=E6=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在用户菜单中根据 isDeveloper 字段切换显示“申请成为开发者”或“进入开发者中心”
- 已通过审核用户直接显示“进入开发者中心”且高亮显示
- 去除冗余的独立“开发者中心”菜单条目,简化菜单结构
- 调整平台管理页和门店中心入口权限为仅超级管理员可访问
- 优化登录与权限校验流程,防止权限不足时页面闪烁或无访问权限空白
- 更新相关文档,完善审核通过后店员记录添加流程
---
.idea/workspace.xml | 30 +++++++++++++-----------------
.workbuddy/memory/2026-07-23.md | 9 ++++++++-
src/pages/user/user.tsx | 8 ++++----
3 files changed, 25 insertions(+), 22 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index d3f9854..cb04ece 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,11 +4,7 @@
-
-
-
-
-
+
@@ -120,15 +116,7 @@
-
-
-
-
- 1775965478226
-
-
-
- 1775965478226
+
@@ -514,7 +502,15 @@
1784800763746
-
+
+
+ 1784802336157
+
+
+
+ 1784802336157
+
+
@@ -534,7 +530,6 @@
-
@@ -559,7 +554,8 @@
-
+
+
\ No newline at end of file
diff --git a/.workbuddy/memory/2026-07-23.md b/.workbuddy/memory/2026-07-23.md
index 10e9f67..e083c40 100644
--- a/.workbuddy/memory/2026-07-23.md
+++ b/.workbuddy/memory/2026-07-23.md
@@ -58,4 +58,11 @@
- `src/pages/admin/index/index.tsx`:页面访问门槛 `isAdmin` → `isSuperAdmin===1`(含空态文案);`loading` 拆为 `userLoading`(来自 useUser,防闪烁) + `dataLoading`(角标数据);首屏 `if (userLoading || dataLoading) spinner`。
- `src/pages/store/center/index.tsx`:移除 `getMyClerk()` 店员门槛,改为 `isSuperAdmin===1` 才进;非超管弹「仅超级管理员可访问」并 navigateBack;头部加 `header` 兜底(超管非店员时显示「门店中心」+ 管理员昵称/手机号);渲染守卫 `userLoading → 请先登录 → 无访问权限`,去掉原 `if(!storeInfo) return null`(否则非店员超管整页空白)。
-**验证**:`npm run build:weapp` 在沙箱被 OOM/锁文件杀掉(exit 137,无报错),属环境问题,非代码错误;改动均为项目既有写法(useUser / Badge / 渐变头部)。
\ No newline at end of file
+**验证**:`npm run build:weapp` 在沙箱被 OOM/锁文件杀掉(exit 137,无报错),属环境问题,非代码错误;改动均为项目既有写法(useUser / Badge / 渐变头部)。
+
+## 「申请成为开发者」菜单项随 isDeveloper 切换
+
+**需求**:我的页面菜单里「申请成为开发者(推荐)」条目,若用户已审核通过成为开发者,该处文案/链接改为「进入开发者中心」(跳 `/pages/developer/index/index`)。
+
+**改动**(`src/pages/user/user.tsx` 菜单 `menuItems`):
+- 把原第 105 行固定「申请成为开发者」+ 第 107 行独立「开发者中心」(仅 isDeveloper 显示) 合并为条件式:`(user as any)?.isDeveloper ? { 进入开发者中心 → /pages/developer/index/index } : { 申请成为开发者 → /pages/user/vip-upgrade/index }`,两者均 `highlight: true`(醒目推荐样式)。去掉了冗余的独立「开发者中心」条目。
\ No newline at end of file
diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx
index 61f39bb..f828383 100644
--- a/src/pages/user/user.tsx
+++ b/src/pages/user/user.tsx
@@ -101,10 +101,10 @@ const UserPage: React.FC = () => {
})
const menuItems = [
- // 申请成为开发者 - 醒目样式
- { icon: '🔰', label: '申请成为开发者', url: '/pages/user/vip-upgrade/index', highlight: true, requireAuth: true },
- // 开发者中心:仅 isDeveloper 用户显示
- ...((user as any)?.isDeveloper ? [{ icon: '🛠️', label: '开发者中心', url: '/pages/developer/index/index', requireAuth: true }] : []),
+ // 申请成为开发者 / 进入开发者中心:已通过审核则直接进开发者中心
+ ...((user as any)?.isDeveloper
+ ? [{ icon: '🛠️', label: '进入开发者中心', url: '/pages/developer/index/index', highlight: true, requireAuth: true }]
+ : [{ icon: '🔰', label: '申请成为开发者', url: '/pages/user/vip-upgrade/index', highlight: true, requireAuth: true }]),
// 平台管理:仅 isSuperAdmin=1 用户显示
...((user as any)?.isSuperAdmin === 1 ? [{ icon: '🛡️', label: '平台管理', url: '/pages/admin/index/index', requireAuth: true }] : []),
// 门店中心:仅 isSuperAdmin=1 用户显示