diff --git a/docs/superpowers/plans/2026-07-11-mobile-uni-employee-pages-visual-redesign.md b/docs/superpowers/plans/2026-07-11-mobile-uni-employee-pages-visual-redesign.md new file mode 100644 index 00000000..e679e68b --- /dev/null +++ b/docs/superpowers/plans/2026-07-11-mobile-uni-employee-pages-visual-redesign.md @@ -0,0 +1,450 @@ +# Mobile Uni Employee Pages Visual Redesign Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** 将员工端 `today / sop / practice` 三页及其强相关的 `tabBar / 共享卡片样式` 调整为接近设计基准稿的统一视觉,同时保持现有业务交互和接口行为不变。 + +**Architecture:** 采用“视觉优先、业务最小改动”的改法:先建立员工端共享视觉 token 与基础样式,再按首页、问师傅页、训练页的顺序逐页重排结构和样式。页面内部函数、接口调用与路由保留,主要改模板层级、类名、样式组织和少量静态资源引用。 + +**Tech Stack:** uni-app Vue3、Vite、TypeScript、CSS、Node 原生测试、H5 构建校验 + +--- + +### Task 1: 建立员工端共享视觉基座 + +**Files:** +- Modify: `mobile-uni/src/styles/base.css` +- Modify: `mobile-uni/src/pages.json` +- Test: `mobile-uni/tests/mobile-user-pages.test.mjs` + +- [x] **Step 1: 写一个失败测试,锁住 Vue3 manifest 与员工端视觉约束继续有效** + +```js +test('tabBar 继续保留员工端四个固定入口', async () => { + const source = await pageSource('../src/pages.json'); + + assert.match(source, /pages\/user\/today\/index/); + assert.match(source, /pages\/user\/practice\/index/); + assert.match(source, /pages\/user\/sop\/index/); + assert.match(source, /pages\/user\/profile\/index/); +}); +``` + +- [x] **Step 2: 运行测试,确认新增断言先失败或当前文件尚未覆盖该约束** + +Run: `node --test tests/mobile-user-pages.test.mjs` +Expected: 新增测试如果还没加入会缺失;加入后在修改前至少能作为后续回归校验入口存在。 + +- [x] **Step 3: 在 `base.css` 中整理员工端共享 token,不扩大到全站侵入式重置** + +```css +:root { + --employee-bg: #f4f6fb; + --employee-surface: #ffffff; + --employee-primary: #2f6bff; + --employee-primary-soft: #eaf1ff; + --employee-success: #34b368; + --employee-warning: #ff8a1f; + --employee-danger: #ff5b4d; + --employee-text: #182230; + --employee-muted: #6b7280; + --employee-card-radius: 24px; + --employee-card-shadow: 0 12px 32px rgba(47, 107, 255, 0.08); +} + +.employee-card { + border-radius: var(--employee-card-radius); + background: var(--employee-surface); + box-shadow: var(--employee-card-shadow); +} + +.employee-section-title { + color: var(--employee-text); + font-size: 20px; + font-weight: 900; +} +``` + +- [x] **Step 4: 调整 `pages.json` 的员工端 tabBar 视觉参数,保留四 tab 结构和路径** + +```json +"tabBar": { + "color": "#7b8494", + "selectedColor": "#2f6bff", + "backgroundColor": "#ffffff", + "borderStyle": "white", + "height": "66px", + "fontSize": "12px", + "iconWidth": "25px", + "spacing": "3px", + "list": [ + { "pagePath": "pages/user/today/index", "text": "今日" }, + { "pagePath": "pages/user/practice/index", "text": "练" }, + { "pagePath": "pages/user/sop/index", "text": "问" }, + { "pagePath": "pages/user/profile/index", "text": "我" } + ] +} +``` + +- [x] **Step 5: 更新回归测试,验证 tabBar 四入口与共享样式关键 token 存在** + +```js +test('共享视觉基座包含员工端主色和卡片圆角 token', async () => { + const source = await pageSource('../src/styles/base.css'); + + assert.match(source, /--employee-primary:/); + assert.match(source, /--employee-card-radius:/); +}); +``` + +- [x] **Step 6: 运行测试验证通过** + +Run: `node --test tests/mobile-user-pages.test.mjs` +Expected: PASS,且已有输入兼容与 manifest 测试继续通过。 + +- [ ] **Step 7: 提交这一阶段改动** + +```bash +git add mobile-uni/src/styles/base.css mobile-uni/src/pages.json mobile-uni/tests/mobile-user-pages.test.mjs +git commit -m "feat: add employee visual foundation" +``` + +### Task 2: 重做员工端首页视觉 + +**Files:** +- Modify: `mobile-uni/src/pages/user/today/index.vue` +- Modify: `mobile-uni/src/styles/base.css` +- Test: `mobile-uni/tests/mobile-user-pages.test.mjs` + +- [x] **Step 1: 为首页结构写失败测试,锁住设计稿要求的核心区块** + +```js +test('员工首页保留师傅区、语音条、今日安排、我的地图四段结构', async () => { + const source = await pageSource('../src/pages/user/today/index.vue'); + + assert.match(source, /mentor-hero/); + assert.match(source, /voice-panel/); + assert.match(source, /今日安排/); + assert.match(source, /我的地图/); +}); +``` + +- [x] **Step 2: 运行测试确认结构断言可作为改版护栏** + +Run: `node --test tests/mobile-user-pages.test.mjs` +Expected: 失败或在旧结构下不足以覆盖新样式目标,后续补全后通过。 + +- [x] **Step 3: 重排首页模板,保留原有交互函数但调整为设计稿节奏** + +```vue + + + {{ positionProfile.value }} + {{ positionProfile.heroTitle }} + 有问题,随时问老师傅 + + + + {{ mentorBubbleText }} + + + + + + + + +... +... +``` + +- [x] **Step 4: 用 scoped 样式还原首页视觉,控制人物占屏不超过首屏约五分之一** + +```css +.today-page { + background: radial-gradient(circle at top, #eef5ff 0%, #f7f9fc 38%, #f4f6fb 100%); +} + +.mentor-hero { + min-height: 220px; + padding: 28px 24px 0; +} + +.mentor-image { + right: 24px; + bottom: 0; + width: 108px; + height: 148px; +} + +.voice-panel { + margin-top: -28px; + grid-template-columns: 1.4fr 1fr; +} + +.map-tile { + border-radius: 22px; + min-height: 136px; +} +``` + +- [x] **Step 5: 更新测试,验证首页地图主标题继续显示真实 `tile.title`,避免回退成单字标题** + +```js +test('员工首页地图主标题继续显示真实工具名称', async () => { + const source = await pageSource('../src/pages/user/today/index.vue'); + + assert.match(source, /\{\{ tile\.title \}\}<\/text>/); +}); +``` + +- [x] **Step 6: 运行测试验证首页改版没有破坏护栏** + +Run: `node --test tests/mobile-user-pages.test.mjs` +Expected: PASS。 + +- [ ] **Step 7: 提交首页改版** + +```bash +git add mobile-uni/src/pages/user/today/index.vue mobile-uni/src/styles/base.css mobile-uni/tests/mobile-user-pages.test.mjs +git commit -m "feat: redesign employee home page" +``` + +### Task 3: 重做问师傅页视觉与总结卡展现 + +**Files:** +- Modify: `mobile-uni/src/pages/user/sop/index.vue` +- Modify: `mobile-uni/src/styles/base.css` +- Test: `mobile-uni/tests/mobile-user-pages.test.mjs` + +- [x] **Step 1: 为问师傅页写失败测试,锁住搜索主导与总结卡入口仍然存在** + +```js +test('问师傅页保留搜索框、答案区和总结卡入口', async () => { + const source = await pageSource('../src/pages/user/sop/index.vue'); + + assert.match(source, /query-panel/); + assert.match(source, /answer-panel/); + assert.match(source, /summary-panel/); +}); +``` + +- [x] **Step 2: 运行测试确认护栏建立成功** + +Run: `node --test tests/mobile-user-pages.test.mjs` +Expected: 断言可执行,作为后续视觉重排的结构保护。 + +- [x] **Step 3: 收紧问师傅页头部,改为“轻标题 + 强搜索框”的布局** + +```vue + + + 查SOP + 直接搜 SOP、案例和常用话术 + + + +