From ef259f1f0c84539733f3505c4a26a6b08bd2734d Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Mon, 10 Aug 2026 15:36:43 +0800 Subject: [PATCH] feat(mobile-h5): apply scheme B empty state globally Restyle van-empty as a dashed mint soft card and add optional tip on home and comps demo so all empty states stay consistent. Co-authored-by: Cursor --- .../plans/2026-08-10-mobile-h5-empty-state.md | 267 ++++++++++++++++++ mobile-h5/components/van-empty/van-empty.vue | 102 +++++++ mobile-h5/pages/demo/comps.vue | 5 +- mobile-h5/pages/index/index.vue | 66 +---- 4 files changed, 382 insertions(+), 58 deletions(-) create mode 100644 docs/superpowers/plans/2026-08-10-mobile-h5-empty-state.md create mode 100644 mobile-h5/components/van-empty/van-empty.vue diff --git a/docs/superpowers/plans/2026-08-10-mobile-h5-empty-state.md b/docs/superpowers/plans/2026-08-10-mobile-h5-empty-state.md new file mode 100644 index 00000000..18881315 --- /dev/null +++ b/docs/superpowers/plans/2026-08-10-mobile-h5-empty-state.md @@ -0,0 +1,267 @@ +# mobile-h5 全局空态(方案 B)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:** 将 `van-empty` 统一为方案 B(薄荷绿虚线软卡 + 圆形 inbox 插画 + 主/副文案),全站空态一致。 + +**Architecture:** 只改 H5 shim 组件 `mobile-h5/components/van-empty/van-empty.vue`;页面经 easycom / 显式 import 自动吃到新样式。主页补可选 `tip`;demo comps 演示副文案。 + +**Tech Stack:** uni-app Vue(Options API)、scoped CSS、三墙 Token(`#0a9f6d` 等) + +**Spec:** `docs/superpowers/specs/2026-08-10-mobile-h5-empty-state-design.md` +**视觉参考:** `mobile-ui/zkxw-mobile-empty-state-demo.html` 方案 B + +--- + +## File map + +| 路径 | 职责 | +|------|------| +| `mobile-h5/components/van-empty/van-empty.vue` | 方案 B 结构 + 样式 + `tip` prop | +| `mobile-h5/pages/index/index.vue` | 空菜单空态补 `tip` | +| `mobile-h5/pages/demo/comps.vue` | 演示页补 `tip`(可选副文案) | +| `mobile-h5/pages/demo/list.vue` | 保持 `description="暂无数据"`,无 tip(验证无占位) | + +--- + +### Task 1: 重写 van-empty 为方案 B + +**Files:** +- Modify: `mobile-h5/components/van-empty/van-empty.vue` + +- [ ] **Step 1: 替换组件全文** + +将文件替换为: + +```vue + + + + + +``` + +说明:用 CSS 拼 inbox 轮廓,避免 uni-app H5 对 `` 不稳定;视觉对齐 Demo B 的绿色线框收件箱。 + +- [ ] **Step 2: 自检色值** + +确认文件中无 `#10b981`;主色仅为 `#0a9f6d`。 + +- [ ] **Step 3: Commit** + +```bash +git add mobile-h5/components/van-empty/van-empty.vue +git commit -m "feat(mobile-h5): restyle van-empty as dashed soft card (scheme B)" +``` + +--- + +### Task 2: 调用方补 tip(主页 + comps) + +**Files:** +- Modify: `mobile-h5/pages/index/index.vue` +- Modify: `mobile-h5/pages/demo/comps.vue` +- Verify only: `mobile-h5/pages/demo/list.vue`(不改,保持无 tip) + +- [ ] **Step 1: 主页空态加 tip** + +在 `mobile-h5/pages/index/index.vue` 将: + +```vue + +``` + +改为: + +```vue + +``` + +- [ ] **Step 2: comps 演示页加 tip** + +在 `mobile-h5/pages/demo/comps.vue` 将: + +```vue + +``` + +改为: + +```vue + +``` + +- [ ] **Step 3: 确认 list 页不传 tip** + +`mobile-h5/pages/demo/list.vue` 保持: + +```vue + +``` + +验收:无 tip 时不出现空白副文案行。 + +- [ ] **Step 4: Commit** + +```bash +git add mobile-h5/pages/index/index.vue mobile-h5/pages/demo/comps.vue +git commit -m "feat(mobile-h5): add empty-state tip on home and comps demo" +``` + +--- + +### Task 3: 视觉验收 + +**Files:** 无代码变更 + +- [ ] **Step 1: 本地打开 / 刷新 H5** + +主页(菜单为空)应看到:虚线软卡、圆形插画、主文案「暂无可用菜单权限」、副文案「请联系管理员开通功能入口」;无 ∅。 + +- [ ] **Step 2: 对照 Demo** + +对照 `mobile-ui/zkxw-mobile-empty-state-demo.html` 方案 B:结构与色调一致即可(inbox 为 CSS 近似)。 + +- [ ] **Step 3: 抽查 list / comps** + +- comps:有 tip +- list 清空数据后:仅主文案「暂无数据」,无 tip 占位 + +--- + +## Spec coverage checklist + +| Spec 要求 | Task | +|-----------|------| +| 方案 B 视觉(渐变虚线卡 + blob + 主/副文案) | Task 1 | +| `description` + `tip` API | Task 1 | +| 主页 tip | Task 2 | +| comps tip 演示 | Task 2 | +| list 无 tip 不占位 | Task 2 Step 3 / Task 3 | +| 三墙色、无 `#10b981` | Task 1 Step 2 | +| 不引入 E 变体 / 不引真实 Vant | 全计划未包含 | + +--- + +## Out of scope + +- 横向紧凑变体 E +- 真实 `@vant/weapp` 依赖 +- 改业务菜单数据源(菜单仍为空数组) diff --git a/mobile-h5/components/van-empty/van-empty.vue b/mobile-h5/components/van-empty/van-empty.vue new file mode 100644 index 00000000..f0fb86fc --- /dev/null +++ b/mobile-h5/components/van-empty/van-empty.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/mobile-h5/pages/demo/comps.vue b/mobile-h5/pages/demo/comps.vue index 2df26d55..bffe8fa4 100644 --- a/mobile-h5/pages/demo/comps.vue +++ b/mobile-h5/pages/demo/comps.vue @@ -48,7 +48,10 @@ color="#087f57" /> - + 加载中 diff --git a/mobile-h5/pages/index/index.vue b/mobile-h5/pages/index/index.vue index 20de060d..eb8f03b4 100644 --- a/mobile-h5/pages/index/index.vue +++ b/mobile-h5/pages/index/index.vue @@ -3,7 +3,7 @@ 中科兴皖 · 移动工作台 - 退出 + 退出登录 你好,{{ userName }} @@ -14,80 +14,35 @@ - - 菜单卡片按角色权限动态渲染;无权限的功能入口不会出现在宫格中。 - - 功能菜单 共 {{ menus.length }} 项 - + - -