家谱APP首页样式设计完成,落地80%
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
# 真实接口核心流程 Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** 让家谱 App 的认证、当前家谱上下文、创建首代和世系浏览形成可验证的 Mock/远端双模式核心闭环。
|
||||
|
||||
**Architecture:** `utils/config.js` 显式决定数据模式;`utils/api.js` 是唯一远端响应解包和错误转换位置;`utils/session.js` 与新增的上下文模块持久化 token 和当前家谱 ID。页面只调用 `appApi` 并从路由读取对象 ID。
|
||||
|
||||
**Tech Stack:** uni-app Vue 3、HBuilderX、uni.request、PowerShell 合同测试。
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- 不将测试账号、密码或 token 写入源码、测试或文档。
|
||||
- 远端模式失败必须显示错误,不能自动返回 Mock 数据。
|
||||
- 所有新增页面必须登记在 `pages.json` 并纳入编译审计。
|
||||
|
||||
---
|
||||
|
||||
### Task 1: API 会话与响应契约
|
||||
|
||||
**Files:**
|
||||
- Modify: `utils/config.js`, `utils/session.js`, `utils/api.js`
|
||||
- Create: `utils/genealogy-context.js`, `tests/core-flow-contract.ps1`
|
||||
|
||||
- [x] 写失败测试,要求存在显式模式、登录方法、`data` 解包、token 与当前家谱 ID 持久化。
|
||||
- [x] 运行 PowerShell 合同测试并确认因方法缺失失败。
|
||||
- [x] 实现最小 API 适配层和上下文模块。
|
||||
- [x] 重跑合同测试,确认通过。
|
||||
|
||||
### Task 2: 认证与我的家谱
|
||||
|
||||
**Files:**
|
||||
- Modify: `pages/auth/login.vue`, `pages/genealogy/index.vue`, `components/GenealogyCard.vue`
|
||||
- Test: `tests/core-flow-contract.ps1`
|
||||
|
||||
- [x] 写失败测试,要求登录页调用 API、保存 token,家谱卡片和列表使用真实 ID。
|
||||
- [x] 运行测试确认失败。
|
||||
- [x] 实现密码登录、错误状态与列表加载状态。
|
||||
- [ ] 重跑测试并在 Mock 模式下手动走通登录至列表。
|
||||
|
||||
### Task 3: 当前家谱与首代录入
|
||||
|
||||
**Files:**
|
||||
- Modify: `pages.json`, `pages/genealogy/create.vue`, `pages/genealogy/detail.vue`, `pages/tree/index.vue`, `pages/member/detail.vue`
|
||||
- Create: `pages/lineage/first-person.vue`
|
||||
- Test: `tests/core-flow-contract.ps1`
|
||||
|
||||
- [x] 写失败测试,要求新页面、路由参数和 API 方法存在,且不得写死 `1001`/`3`。
|
||||
- [x] 运行测试确认失败。
|
||||
- [x] 实现创建家谱后录入首代、按路由 ID 加载详情/树/成员。
|
||||
- [x] 重跑合同测试与 HBuilderX Sass/语言诊断。
|
||||
|
||||
### Task 4: 加入审核与通知的上下文修复
|
||||
|
||||
**Files:**
|
||||
- Modify: `pages/genealogy/search.vue`, `pages/genealogy/applications.vue`, `pages/notification/index.vue`, `utils/api.js`
|
||||
- Test: `tests/core-flow-contract.ps1`
|
||||
|
||||
- [x] 写失败测试,要求申请和审核使用当前家谱 ID,通知读取操作有对应 API 方法。
|
||||
- [x] 运行测试确认失败。
|
||||
- [x] 实现上下文传递与明确的本地状态更新。
|
||||
- [x] 重跑所有项目测试及 HBuilderX 实际样式/模块请求验证。
|
||||
@@ -0,0 +1,230 @@
|
||||
# G01 信息层级与谱印校正 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:** 让“我的家谱”内容区按已确认的 v5 参考稿呈现谱印、元信息、快捷入口、列表和新建按钮的视觉层级。
|
||||
|
||||
**Architecture:** 视觉资产只放在 `static/assets/icons/`,页面和卡片组件只引用资产与渲染动态数据。`pages/genealogy/index.vue` 负责当前家谱、快捷入口和新建按钮;`components/GenealogyCard.vue` 负责每条列表的谱印、两层元信息和右侧操作列。
|
||||
|
||||
**Tech Stack:** uni-app Vue 3、SCSS、项目本地 RGBA PNG、PowerShell 契约审计。
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- 视觉基准:`docs/design/screens/G01-我的家谱-紧凑版设计稿-v5-Tabbar安全区.png`。
|
||||
- Android only;继续使用 rpx、flex、小屏 `max-width: 340px` 规则,不使用 `clip-path` 或 CSS 绘图。
|
||||
- 所有新增可见图标、谱印框、云纹均为项目内透明 PNG;动态姓名/数字使用 Vue 文本,不嵌死在图片中。
|
||||
- 不改接口、路由、页头、背景、Tabbar 或其他页面;仅为现有展示用 `data/mock.js` 家谱条目补充 `updatedAt` 日期字段。
|
||||
- 工作目录不是 Git 仓库,本轮不初始化仓库、不创建提交。
|
||||
|
||||
---
|
||||
|
||||
### Task 1: 谱印与元信息 PNG 资产
|
||||
|
||||
**Files:**
|
||||
- Create: `static/assets/icons/common/location-v1.png`
|
||||
- Create: `static/assets/icons/common/member-meta-v1.png`
|
||||
- Create: `static/assets/icons/common/admin-v1.png`
|
||||
- Create: `static/assets/icons/genealogy/seal-current-frame-v1.png`
|
||||
- Create: `static/assets/icons/genealogy/seal-row-frame-v1.png`
|
||||
- Create: `static/assets/icons/action/create-cloud-v1.png`
|
||||
- Modify: `tests/g01-visual-contract.ps1`
|
||||
|
||||
**Interfaces:**
|
||||
- Produces 96×96 RGBA metadata icons, separate transparent current/list seal-frame PNGs, and a transparent cloud ornament consumed by Tasks 2–3.
|
||||
- Each asset corner alpha must be 0; the current seal frame must have taller visible bounds than the row seal frame.
|
||||
|
||||
- [x] **Step 1: Write the failing asset contract**
|
||||
|
||||
Add the six paths to `$requiredAssets`, then add these assertions to `tests/g01-visual-contract.ps1`:
|
||||
|
||||
```powershell
|
||||
foreach ($asset in @('location-v1.png', 'member-meta-v1.png', 'admin-v1.png', 'seal-current-frame-v1.png', 'seal-row-frame-v1.png', 'create-cloud-v1.png')) {
|
||||
if ($page -notmatch [regex]::Escape($asset) -and $card -notmatch [regex]::Escape($asset)) {
|
||||
throw "G-01 does not consume $asset"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- [x] **Step 2: Run the contract and verify it fails**
|
||||
|
||||
Run: `powershell -ExecutionPolicy Bypass -File tests\g01-visual-contract.ps1`
|
||||
Expected: `FAIL` because the asset files and component references do not exist.
|
||||
|
||||
- [x] **Step 3: Generate and inspect the assets**
|
||||
|
||||
Generate one asset at a time on a flat chroma-key background, remove the chroma key to alpha, and inspect the selected PNG before adding it. Use this visual language: antique-gold single/double outline, Chinese genealogy motif, no text, no shadow, transparent canvas. For the seal frames, generate only the red-and-gold frame; do not include surname or “家谱” text.
|
||||
|
||||
- [x] **Step 4: Verify transparent corners**
|
||||
|
||||
Run a PowerShell `System.Drawing.Bitmap` alpha audit that checks the four canvas corners of every new PNG are 0.
|
||||
|
||||
Expected: all six assets report `PASS ... transparent corners`.
|
||||
|
||||
### Task 2: 当前家谱题签、快捷入口与新建按钮
|
||||
|
||||
**Files:**
|
||||
- Modify: `pages/genealogy/index.vue`
|
||||
- Modify: `tests/g01-visual-contract.ps1`
|
||||
|
||||
**Interfaces:**
|
||||
- Consumes the Task 1 metadata icons, `seal-current-frame-v1.png`, and `create-cloud-v1.png`.
|
||||
- Keeps `currentGenealogy` as the data owner; does not add API calls.
|
||||
|
||||
- [x] **Step 1: Write the failing page-layout contract**
|
||||
|
||||
Require the current title block to render three `.current-meta-item` entries and the current seal to include a `.current-seal-frame` image. Require the shortcut display size and create cloud image:
|
||||
|
||||
```powershell
|
||||
foreach ($token in @('current-meta-item', 'current-seal-frame', 'location-v1.png', 'member-meta-v1.png', 'admin-v1.png', 'create-cloud-v1.png')) {
|
||||
if ($page -notmatch $token) { throw "G-01 current panel is missing $token" }
|
||||
}
|
||||
if ($page -notmatch 'width:\s*82rpx') { throw 'G-01 shortcut icons remain below the reference visual size.' }
|
||||
```
|
||||
|
||||
- [x] **Step 2: Run the contract and verify it fails**
|
||||
|
||||
Run: `powershell -ExecutionPolicy Bypass -File tests\g01-visual-contract.ps1`
|
||||
Expected: `FAIL` because current content is still a pure text metadata row and has no seal/cloud image references.
|
||||
|
||||
- [x] **Step 3: Implement the minimum current-panel markup**
|
||||
|
||||
Replace the pure red `current-seal` block with an image layer and dynamic text overlay:
|
||||
|
||||
```vue
|
||||
<view class="current-seal">
|
||||
<image class="current-seal-frame" src="/static/assets/icons/genealogy/seal-current-frame-v1.png" mode="scaleToFill" />
|
||||
<text class="current-seal-title">家谱</text>
|
||||
</view>
|
||||
```
|
||||
|
||||
Render three icon/text metadata groups using the created `location-v1.png`, `member-meta-v1.png`, and `admin-v1.png`; retain `currentGenealogy.location` and `currentGenealogy.memberCount` as the text values.
|
||||
|
||||
- [x] **Step 4: Implement the spacing-only CSS changes**
|
||||
|
||||
Set shortcut image box to `82rpx`; increase label size and give the shortcut grid the reference-like vertical space. Use flex wrapping for current metadata and keep the existing `@media screen and (max-width: 340px)` behavior so no item overlaps.
|
||||
|
||||
- [x] **Step 5: Implement the create-button ornament**
|
||||
|
||||
Place two instances of `create-cloud-v1.png` inside `.create-action`; mirror only the right PNG with `transform: scaleX(-1)`. Keep the existing add PNG and navigation handler.
|
||||
|
||||
- [x] **Step 6: Run the contract and verify it passes**
|
||||
|
||||
Run: `powershell -ExecutionPolicy Bypass -File tests\g01-visual-contract.ps1`
|
||||
Expected: `PASS G-01 visual contract`.
|
||||
|
||||
### Task 3: 家谱列表谱印与信息层级
|
||||
|
||||
**Files:**
|
||||
- Modify: `components/GenealogyCard.vue`
|
||||
- Modify: `data/mock.js`
|
||||
- Modify: `tests/g01-visual-contract.ps1`
|
||||
|
||||
**Interfaces:**
|
||||
- Consumes `genealogy` (`surname`, `name`, `location`, `memberCount`, `updatedAt`), `role`, and the Task 1 row seal asset.
|
||||
- Emits the unchanged `select` event.
|
||||
|
||||
- [x] **Step 1: Write the failing card-layout contract**
|
||||
|
||||
Require `seal-row-frame-v1.png` and an explicit `.card-detail-row`:
|
||||
|
||||
```powershell
|
||||
foreach ($token in @('seal-row-frame-v1.png', 'card-detail-row', 'card-updated')) {
|
||||
if ($card -notmatch $token) { throw "G-01 list card is missing $token" }
|
||||
}
|
||||
if ($card -match 'background:\s*#b93b2e') { throw 'G-01 list seal is still a plain CSS red block.' }
|
||||
```
|
||||
|
||||
- [x] **Step 2: Run the contract and verify it fails**
|
||||
|
||||
Run: `powershell -ExecutionPolicy Bypass -File tests\g01-visual-contract.ps1`
|
||||
Expected: `FAIL` because the current list card has no frame asset or two-level detail markup.
|
||||
|
||||
- [x] **Step 3: Implement the minimal list-card markup**
|
||||
|
||||
Use a `.surname-seal` image frame with text overlay, then split metadata into title/detail/update rows:
|
||||
|
||||
```vue
|
||||
<view class="card-detail-row">
|
||||
<text class="card-meta">{{ genealogy.location }} · {{ genealogy.memberCount }} 位成员</text>
|
||||
<view class="card-updated"><text>更新于 {{ genealogy.updatedAt }}</text></view>
|
||||
</view>
|
||||
```
|
||||
|
||||
On narrow screens, hide `.card-updated`; preserve the role and chevron column.
|
||||
|
||||
- [x] **Step 3a: Add the visual fixture dates**
|
||||
|
||||
Add `updatedAt: '2024-05-12'` to genealogy `1001` and `updatedAt: '2024-04-28'` to genealogy `1002` in `data/mock.js`. These fields are display-only fixtures and do not change the API contract.
|
||||
|
||||
- [x] **Step 4: Implement CSS sizing and small-screen fallback**
|
||||
|
||||
Increase card name/title prominence, keep row-frame as the only paper frame, set right-side role/chevron to a centered fixed column, and make `.card-updated` disappear at `max-width: 340px` before text can collide.
|
||||
|
||||
- [x] **Step 5: Run the contract and verify it passes**
|
||||
|
||||
Run: `powershell -ExecutionPolicy Bypass -File tests\g01-visual-contract.ps1`
|
||||
Expected: `PASS G-01 visual contract`.
|
||||
|
||||
### Task 4: Documentation and full verification
|
||||
|
||||
**Files:**
|
||||
- Modify: `docs/design/G01_我的家谱_设计记录.md`
|
||||
- Modify: `docs/规划.md`
|
||||
|
||||
**Interfaces:**
|
||||
- Records only completed implementation and verification; leaves G01 unchecked until an HBuilderX comparison screenshot is accepted.
|
||||
|
||||
- [x] **Step 1: Record the completed implementation scope**
|
||||
|
||||
Append the new asset paths, the explicit visual reference, and the small-screen fallback to the G01 design record. Mark the implementation subtask complete in `docs/规划.md`; do not mark the full G01 design complete.
|
||||
|
||||
- [x] **Step 2: Run focused verification**
|
||||
|
||||
Run:
|
||||
|
||||
```powershell
|
||||
powershell -ExecutionPolicy Bypass -File tests\g01-visual-contract.ps1
|
||||
powershell -ExecutionPolicy Bypass -File tests\compile-audit.ps1
|
||||
powershell -ExecutionPolicy Bypass -File tests\uni-scss-injection.ps1
|
||||
```
|
||||
|
||||
Expected: three `PASS` lines and no warnings.
|
||||
|
||||
- [ ] **Step 3: Capture visual evidence in HBuilderX**
|
||||
|
||||
At the same phone viewport as the supplied comparison, capture G01 and compare it side-by-side with the v5 reference. Confirm the current title/meta row, all three seals, four shortcut icon sizes, list row hierarchy, and cloud button ornament. If a mismatch remains, record it rather than marking G01 complete.
|
||||
|
||||
## Plan self-review
|
||||
|
||||
- Spec coverage: Tasks 1–3 implement every asset, layout, small-screen, and visual hierarchy requirement; Task 4 records and verifies it.
|
||||
- No placeholders: all new paths, CSS tokens, component classes, commands, and expected outputs are named.
|
||||
- Consistency: page uses current panel assets; card uses row seal and metadata assets; both are enforced by one G01 visual contract.
|
||||
|
||||
### Task 5: 参考稿字段与列表基线校正
|
||||
|
||||
**Files:**
|
||||
- Modify: `data/mock.js`
|
||||
- Modify: `pages/genealogy/index.vue`
|
||||
- Modify: `components/GenealogyCard.vue`
|
||||
- Modify: `tests/g01-visual-contract.ps1`
|
||||
|
||||
**Interfaces:**
|
||||
- Produces reference-matched visual fixture fields without changing any remote API contract.
|
||||
- Keeps the existing navigation and card `select` event unchanged.
|
||||
|
||||
- [x] **Step 1: Write the failing visual-fixture contract**
|
||||
|
||||
Require the four reference names/locations/counts, `.current-info-divider`, a row-direction `.card-side`, and no `calendar-v1.png` use in the list component.
|
||||
|
||||
- [x] **Step 2: Run the contract and verify it fails**
|
||||
|
||||
Run: `powershell -ExecutionPolicy Bypass -File tests\g01-visual-contract.ps1`
|
||||
Expected: `FAIL` because the old demonstration fields, missing current divider, vertical role/arrow, and calendar icon are still present.
|
||||
|
||||
- [x] **Step 3: Apply the smallest source correction**
|
||||
|
||||
Replace only G01 mock fixture fields with the strings in the approved reference. Add the current-panel divider; render fixed vertical “家谱” list seal text; remove the list calendar icon; align `.card-role` and `.card-chevron` horizontally.
|
||||
|
||||
- [x] **Step 4: Run focused verification**
|
||||
|
||||
Run the G01 visual contract, PNG alpha audit, compile audit, SCSS injection audit, and Vue 3 entry audit. Keep Task 4 visual capture unchecked until the user accepts a new HBuilderX screenshot.
|
||||
@@ -0,0 +1,221 @@
|
||||
# G-01 Visual Shell Implementation Plan
|
||||
|
||||
> For agentic workers: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox syntax for tracking.
|
||||
|
||||
**Goal:** Rebuild the Android “我的家谱” G-01 page as the approved 家祠卷轴 design with verified local PNG assets and stable mock presentation data.
|
||||
|
||||
**Architecture:** pages/genealogy/index.vue owns local visual states only. It composes a heritage header, paper-slip list items, and safe bottom navigation; it does not make remote API calls during this visual-construction phase.
|
||||
|
||||
**Tech Stack:** uni-app, Vue 3 script setup, SCSS/rpx, local RGBA PNG/JPG assets, PowerShell checks.
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- Android only; verify 360 × 800 and 320 × 568 without overlap.
|
||||
- No API, authentication, packaging, dependency, or unrelated-flow changes.
|
||||
- Every functional icon is a local RGBA PNG under static/assets/icons/.
|
||||
- Header uses the confirmed original brand/jiapu-seal-logo.png in the left safe area; title is centered; notification dot renders only for unread messages.
|
||||
- Tabbar is fixed at the bottom, has 64dp content plus Android navigation inset, and keeps the icon and label clear of the lower edge.
|
||||
- Do not mark G-01 design complete until assets, normal/empty/loading states, and small-screen checks have evidence.
|
||||
|
||||
## File Responsibilities
|
||||
|
||||
| File | Responsibility |
|
||||
| --- | --- |
|
||||
| static/assets/icons/genealogy/*-v2.png | Four compact antique-gold G-01 shortcut icons. |
|
||||
| static/assets/icons/action/add-v2.png | The compact 新建家谱 icon. |
|
||||
| static/assets/icons/common/chevron-right-v2.png | Compact right-arrow asset for the paper-slip list row. |
|
||||
| static/assets/icons/tab/*-v4.png | Default and active 24dp tab icon pairs. |
|
||||
| components/PageHeader.vue | Heritage header, original Logo, notification PNG and optional dot. |
|
||||
| components/AppTabbar.vue | Fixed Android-safe three-tab navigation. |
|
||||
| components/GenealogyCard.vue | Compact paper-slip genealogy list row. |
|
||||
| pages/genealogy/index.vue | G-01 content, local state and route actions. |
|
||||
| tests/g01-visual-contract.ps1 | Asset and static page-contract checks. |
|
||||
|
||||
## Task 1: Produce and register G-01 visual assets
|
||||
|
||||
**Files:**
|
||||
- Create: static/assets/icons/genealogy/tree-v2.png
|
||||
- Create: static/assets/icons/genealogy/members-v2.png
|
||||
- Create: static/assets/icons/genealogy/generation-poem-v2.png
|
||||
- Create: static/assets/icons/genealogy/application-v2.png
|
||||
- Create: static/assets/icons/action/add-v2.png
|
||||
- Create: static/assets/icons/common/chevron-right-v2.png
|
||||
- Create: static/assets/icons/tab/{genealogy,family,profile}-v4.png
|
||||
- Create: static/assets/icons/tab/{genealogy,family,profile}-active-v4.png
|
||||
- Create: tests/g01-visual-contract.ps1
|
||||
- Modify: docs/design/G01_我的家谱_设计记录.md
|
||||
|
||||
**Interfaces:**
|
||||
- Consumes: D1 icon rules and the G-01 asset table.
|
||||
- Produces: the listed asset paths; no legacy static/icons/tab-*.png consumer remains.
|
||||
|
||||
- [x] **Step 1: Write the failing asset contract**
|
||||
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$requiredAssets = @(
|
||||
'static/assets/icons/brand/jiapu-seal-logo.png',
|
||||
'static/assets/icons/common/notice-v3.png',
|
||||
'static/assets/icons/genealogy/tree-v2.png',
|
||||
'static/assets/icons/genealogy/members-v2.png',
|
||||
'static/assets/icons/genealogy/generation-poem-v2.png',
|
||||
'static/assets/icons/genealogy/application-v2.png',
|
||||
'static/assets/icons/action/add-v2.png',
|
||||
'static/assets/icons/common/chevron-right-v2.png',
|
||||
'static/assets/icons/tab/genealogy-v4.png',
|
||||
'static/assets/icons/tab/genealogy-active-v4.png',
|
||||
'static/assets/icons/tab/family-v4.png',
|
||||
'static/assets/icons/tab/family-active-v4.png',
|
||||
'static/assets/icons/tab/profile-v4.png',
|
||||
'static/assets/icons/tab/profile-active-v4.png'
|
||||
)
|
||||
foreach ($asset in $requiredAssets) {
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $root $asset))) {
|
||||
throw "Missing G-01 visual asset: $asset"
|
||||
}
|
||||
}
|
||||
Write-Output 'PASS G-01 visual contract'
|
||||
|
||||
- [x] **Step 2: Run the contract and confirm it fails**
|
||||
|
||||
Run: powershell -ExecutionPolicy Bypass -File C:\Users\Rain\Desktop\job\jiapuapp\tests\g01-visual-contract.ps1
|
||||
|
||||
Expected: an error that names tree-v2.png as missing.
|
||||
|
||||
- [x] **Step 3: Generate and validate every icon**
|
||||
|
||||
Generate each asset separately as a tight 96 × 96px transparent PNG. Shortcut and add icons use antique-gold #B58A4B with the approved restrained double-line style. Tab pairs use the same 24dp silhouette in default ink #342A24 and selected cinnabar #A33B2B; no text, clouds, leaves, shadows, or excess transparent padding.
|
||||
|
||||
- [x] **Step 4: Inspect and register accepted assets**
|
||||
|
||||
Inspect Tabs at 46rpx and shortcuts at 48rpx. Reject opaque corners, excess canvas padding, unrecognizable semantics, and any default/selected silhouette mismatch. Update the G-01 asset table with actual path, 96 × 96px, transparency result, and display-size result. Do not tick page-completion boxes yet.
|
||||
|
||||
- [x] **Step 5: Re-run the asset contract**
|
||||
|
||||
Expected: PASS G-01 visual contract.
|
||||
|
||||
## Task 2: Rebuild header and Android-safe Tabbar
|
||||
|
||||
**Files:**
|
||||
- Modify: components/PageHeader.vue
|
||||
- Modify: components/AppTabbar.vue
|
||||
- Modify: tests/g01-visual-contract.ps1
|
||||
|
||||
**Interfaces:**
|
||||
- Produces: PageHeader title=我的家谱 with unreadCount, and AppTabbar active=genealogy.
|
||||
|
||||
- [x] **Step 1: Extend the failing static contract**
|
||||
|
||||
$header = Get-Content -Raw -Encoding UTF8 (Join-Path $root 'components/PageHeader.vue')
|
||||
$tabbar = Get-Content -Raw -Encoding UTF8 (Join-Path $root 'components/AppTabbar.vue')
|
||||
if ($header -notmatch 'jiapu-seal-logo\.png') { throw 'Header does not use the approved brand PNG.' }
|
||||
if ($header -notmatch 'notice-v3\.png') { throw 'Header does not use the approved notice PNG.' }
|
||||
if ($header -notmatch 'unreadCount\s*>\s*0') { throw 'Header badge is not conditional on unread count.' }
|
||||
if ($tabbar -match '/static/icons/tab-') { throw 'Tabbar still references rejected legacy tab assets.' }
|
||||
if ($tabbar -notmatch 'safe-area-inset-bottom') { throw 'Tabbar has no Android safe-area padding.' }
|
||||
if ($tabbar -notmatch 'font-size:\s*24rpx') { throw 'Tabbar label size is below the approved G-01 size.' }
|
||||
|
||||
- [x] **Step 2: Confirm the contract fails before components change**
|
||||
|
||||
Run the focused contract.
|
||||
|
||||
Expected: failure describing the legacy header or Tabbar implementation.
|
||||
|
||||
- [x] **Step 3: Implement the header**
|
||||
|
||||
Use image-only controls: an 88rpx Logo touch area, centered title, and equal-width 88rpx notice touch area using notice-v3.png. Add v-if unreadCount > 0 for the cinnabar dot. Use the header line-art PNG over a cinnabar base. Do not render text labels for Logo or notification action.
|
||||
|
||||
- [x] **Step 4: Implement the Tabbar**
|
||||
|
||||
Map every item to its v4 default/active PNG paths and choose by active === item.key. Keep a paper-white fixed bar, visible content height 128rpx, padding-bottom env(safe-area-inset-bottom), icon 48rpx, label 24rpx, and each touch target at least 96rpx. Do not use gap.
|
||||
|
||||
- [x] **Step 5: Re-run the contract**
|
||||
|
||||
Expected: PASS G-01 visual contract.
|
||||
|
||||
## Task 3: Rebuild G-01 content and presentation states
|
||||
|
||||
**Files:**
|
||||
- Modify: components/GenealogyCard.vue
|
||||
- Modify: pages/genealogy/index.vue
|
||||
- Modify: tests/g01-visual-contract.ps1
|
||||
|
||||
**Interfaces:**
|
||||
- Consumes: genealogies and notifications from @/data/mock.js.
|
||||
- Produces: isLoading, hasGenealogies, createdGenealogies, and joinedGenealogies visual branches.
|
||||
|
||||
- [x] **Step 1: Add the failing local-state contract**
|
||||
|
||||
$page = Get-Content -Raw -Encoding UTF8 (Join-Path $root 'pages/genealogy/index.vue')
|
||||
if ($page -match "from '@/utils/api\.js'") { throw 'G-01 visual phase must not call the remote API.' }
|
||||
foreach ($state in @('isLoading', 'hasGenealogies', 'createdGenealogies', 'joinedGenealogies')) {
|
||||
if ($page -notmatch $state) { throw "G-01 is missing presentation state: $state" }
|
||||
}
|
||||
foreach ($asset in @('tree-v2.png', 'members-v2.png', 'generation-poem-v2.png', 'application-v2.png', 'add-v2.png')) {
|
||||
if ($page -notmatch [regex]::Escape($asset)) { throw "G-01 does not consume $asset" }
|
||||
}
|
||||
|
||||
- [x] **Step 2: Confirm the contract fails on the legacy page**
|
||||
|
||||
Expected: failure for the API import or missing visual state.
|
||||
|
||||
- [x] **Step 3: Implement the page state owner**
|
||||
|
||||
Remove appApi, genealogyContext, and the mounted API call. Import genealogies and notifications from @/data/mock.js, then define:
|
||||
|
||||
const isLoading = ref(false)
|
||||
const list = ref(genealogies)
|
||||
const hasGenealogies = computed(() => list.value.length > 0)
|
||||
const createdGenealogies = computed(() => list.value.filter((item, index) => index === 0))
|
||||
const joinedGenealogies = computed(() => list.value.filter((item, index) => index > 0))
|
||||
|
||||
Retain only route navigation: tree /pages/tree/index, members /pages/genealogy/detail, generation poem /pages/content/list?type=poem, applications /pages/genealogy/applications, create /pages/genealogy/create, search /pages/genealogy/search, and notifications /pages/notification/index.
|
||||
|
||||
- [x] **Step 4: Implement approved compact layout**
|
||||
|
||||
Compose heritage header, current-genealogy paper slip, four equal shortcut entries with v2 assets, separate 我创建的 / 我加入的 groups, compact paper-slip rows, and the add button. Implement a distinct loading state and an empty paper/scroll state with 新建家谱 and 搜索并申请加入. Apply paper texture to the page and mountain/bamboo only to the lower content region. Add bottom content padding that clears the fixed Tabbar.
|
||||
|
||||
- [x] **Step 5: Simplify GenealogyCard.vue**
|
||||
|
||||
Use a seal-style surname block, title, short location/member metadata, identity label, and common/chevron-right-v2.png. Remove the legacy navy cover, motto, and active-member count. Ensure long copy uses min-width: 0, overflow: hidden, and text-overflow: ellipsis.
|
||||
|
||||
- [x] **Step 6: Re-run the focused contract**
|
||||
|
||||
Expected: PASS G-01 visual contract.
|
||||
|
||||
## Task 4: Verify and update the project record
|
||||
|
||||
**Files:**
|
||||
- Modify: docs/design/G01_我的家谱_设计记录.md
|
||||
- Modify: docs/规划.md
|
||||
- Test: tests/g01-visual-contract.ps1
|
||||
- Test: tests/compile-audit.ps1
|
||||
- Test: tests/uni-scss-injection.ps1
|
||||
|
||||
- [x] **Step 1: Run the automated checks**
|
||||
|
||||
Run:
|
||||
|
||||
powershell -ExecutionPolicy Bypass -File C:\Users\Rain\Desktop\job\jiapuapp\tests\g01-visual-contract.ps1
|
||||
powershell -ExecutionPolicy Bypass -File C:\Users\Rain\Desktop\job\jiapuapp\tests\compile-audit.ps1
|
||||
powershell -ExecutionPolicy Bypass -File C:\Users\Rain\Desktop\job\jiapuapp\tests\uni-scss-injection.ps1
|
||||
|
||||
Expected: each command prints its PASS result.
|
||||
|
||||
- [ ] **Step 2: Verify at Android reference sizes**
|
||||
|
||||
Inspect 360 × 800 and 320 × 568. Confirm no overlap among Logo, title, and bell; notice dot only appears with unread entries; shortcut labels remain one line; list text truncates instead of overlaps; create action clears the Tabbar; all three Tab labels remain fully visible above system navigation.
|
||||
|
||||
- [ ] **Step 3: Update only verified design state**
|
||||
|
||||
In the G-01 record, tick only conditions backed by Tasks 1–2 and the two viewport checks. In the overall planning document, leave G-01 unchecked if even one state, asset, or viewport condition remains incomplete; otherwise record visual shell implemented and verified.
|
||||
|
||||
- [ ] **Step 4: Commit only when Git becomes available**
|
||||
|
||||
If a Git worktree exists, commit changed visual-shell files with message: feat: build G01 genealogy visual shell. If Git remains unavailable, report that no commit was created and do not initialize a repository.
|
||||
|
||||
## Plan Self-Review
|
||||
|
||||
- Task 1 covers local assets and transparency checks.
|
||||
- Task 2 covers the Logo, conditional notification dot, and safe Tabbar.
|
||||
- Task 3 covers G-01 normal, loading, and empty states plus approved compact layout.
|
||||
- Task 4 requires automated and small-screen verification before any completion status changes.
|
||||
Reference in New Issue
Block a user