From ee396d1e7ab68f8a9d26af86b6786b0e1bf0c235 Mon Sep 17 00:00:00 2001 From: let5sne Date: Sat, 11 Jul 2026 01:13:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(mobile):=20=E9=87=8D=E5=81=9A=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E7=AB=AF=E9=A6=96=E9=A1=B5=E3=80=81=E9=97=AE=E7=AD=94?= =?UTF-8?q?=E5=92=8C=E8=AE=AD=E7=BB=83=E9=A1=B5=E8=A7=86=E8=A7=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 统一员工端 tabBar、共享卡片和三大核心页面的视觉基础,同时保持现有移动端业务流程不变。补充 H5 输入兼容、页面结构和训练回滚行为的回归测试。 --- ...bile-uni-employee-pages-visual-redesign.md | 450 +++++++++++++ ...bile-uni-employee-pages-visual-redesign.md | 241 +++++++ mobile-uni/src/manifest.json | 1 + mobile-uni/src/pages.json | 34 +- mobile-uni/src/pages/user/practice/index.vue | 408 ++++++++---- mobile-uni/src/pages/user/sop/index.vue | 594 ++++++++++++++++-- mobile-uni/src/pages/user/today/index.vue | 566 +++++++++++------ mobile-uni/src/static/brand-logo.png | Bin 0 -> 3154 bytes .../src/static/tabbar/LICENSE-lucide.txt | 16 + mobile-uni/src/static/tabbar/ask-active.png | Bin 0 -> 2264 bytes mobile-uni/src/static/tabbar/ask-normal.png | Bin 0 -> 3205 bytes .../src/static/tabbar/practice-active.png | Bin 0 -> 2041 bytes .../src/static/tabbar/practice-normal.png | Bin 0 -> 3098 bytes .../src/static/tabbar/profile-active.png | Bin 0 -> 1895 bytes .../src/static/tabbar/profile-normal.png | Bin 0 -> 2485 bytes mobile-uni/src/static/tabbar/today-active.png | Bin 0 -> 1358 bytes mobile-uni/src/static/tabbar/today-normal.png | Bin 0 -> 1701 bytes mobile-uni/src/styles/base.css | 201 ++++-- mobile-uni/tests/mobile-user-pages.test.mjs | 99 +++ 19 files changed, 2171 insertions(+), 439 deletions(-) create mode 100644 docs/superpowers/plans/2026-07-11-mobile-uni-employee-pages-visual-redesign.md create mode 100644 docs/superpowers/specs/2026-07-11-mobile-uni-employee-pages-visual-redesign.md create mode 100644 mobile-uni/src/static/brand-logo.png create mode 100644 mobile-uni/src/static/tabbar/LICENSE-lucide.txt create mode 100644 mobile-uni/src/static/tabbar/ask-active.png create mode 100644 mobile-uni/src/static/tabbar/ask-normal.png create mode 100644 mobile-uni/src/static/tabbar/practice-active.png create mode 100644 mobile-uni/src/static/tabbar/practice-normal.png create mode 100644 mobile-uni/src/static/tabbar/profile-active.png create mode 100644 mobile-uni/src/static/tabbar/profile-normal.png create mode 100644 mobile-uni/src/static/tabbar/today-active.png create mode 100644 mobile-uni/src/static/tabbar/today-normal.png create mode 100644 mobile-uni/tests/mobile-user-pages.test.mjs 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、案例和常用话术 + + + +