Files
jiapuapp/docs/superpowers/plans/2026-07-14-a04-registration.md
T
2026-07-14 17:36:43 +08:00

97 lines
4.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# A04 注册账号实施计划
> **For agentic workers:** 使用 `superpowers:executing-plans` 在当前工作区内联执行。用户禁止子代理、worktree、Git 暂存、提交、推送与上传。
**Goal:** 将 A04 从通用表单壳改为带协议确认、字段校验和 A02 回流的独立注册页。
**Architecture:** A04 自己拥有手机号、密码、确认密码和 `agreed` 状态;视觉只复用 A02 的完整卷轴面板、A01 主按钮、认证头与 A02 协议图标。A04 从 `pageCatalog` 临时母版移除,不改变已验收 A01/A02/G01。
**Tech Stack:** Vue 3 `<script setup>`、uni-app、SCSS、PowerShell 契约审计、Chrome DevTools 截图。
## Global Constraints
- 完整面板、按钮与协议图标必须引用已有位图资产,禁止 CSS 绘制最终表面。
- 不使用 ImageGen;现有认证资产已满足本页完整视觉需要。
- 不接入真实注册、短信、微信、协议正文或后端接口。
- A01、A02、G01 可见效果冻结;不修改它们。
---
### Task 1: 固化独立注册页合同
**Files:**
- Create: `tests/a04-registration-contract.ps1`
- Modify: `pages/auth/a04-register.vue`
- Modify: `data/page-catalog.js`
- [x] **Step 1: 写失败的最小契约。**
创建 `tests/a04-registration-contract.ps1`,读取 A04、`pages.json``page-catalog.js`,并断言:A04 不引用 `ModulePage`;存在 `auth-header``register-panel__skin``a02-login-panel.png``a01-primary-button.png`、两枚 A02 协议图标、手机号/密码/确认密码模型、`agreed``toggleAgreement``submitRegister``prepareLogin` 与 A02 路由;拒绝 A04 面板、按钮、协议图标的 CSS `border``background` 伪造。
- [x] **Step 2: 运行红灯。**
运行:
```powershell
powershell.exe -NoProfile -ExecutionPolicy Bypass -File tests/a04-registration-contract.ps1
```
预期:因 A04 仍是 `ModulePage` 而失败。
- [x] **Step 3: 最小独立实现。**
重写 `pages/auth/a04-register.vue`:使用 A02 头、完整卷轴面板、三行真实输入、本页协议行、完整朱砂主按钮与“已有账号? 登录”入口。用 `phone``password``confirmPassword``agreed` 保存状态;`submitRegister` 依次校验协议、11 位手机号、密码、密码一致,再显示“注册服务待接入”。删除 `data/page-catalog.js``a04` 条目。
- [x] **Step 4: 运行绿灯。**
运行:
```powershell
powershell.exe -NoProfile -ExecutionPolicy Bypass -File tests/a04-registration-contract.ps1
powershell.exe -NoProfile -ExecutionPolicy Bypass -File tests/compile-audit.ps1
```
预期:输出 `A04-REGISTRATION-CONTRACT PASS``PASS compile audit`
### Task 2: 记录并验证注册页
**Files:**
- Create: `docs/design/A04_注册账号_设计记录.md`
- Create: `docs/design/screens/runtime/2026-07-14/A04-after-360x800.png`
- Create: `docs/design/screens/runtime/2026-07-14/A04-after-412x915.png`
- Modify: `docs/规划.md`
- Modify: `docs/交接记录.md`
- [x] **Step 1: 写 A04 设计记录。**
记录 A04 的任务、复用资产、本页状态、无后端边界、A02 回流、截图与自动检查;初始状态为“实现与截图完成,等待用户视觉验收”。用户于 2026-07-14 验收后,规划与交接已同步为 A04 冻结,A05 可以开始。
- [x] **Step 2: 捕获并审视两张真实运行截图。**
运行:
```powershell
node scripts/capture-chrome-page.js "http://localhost:5173/#/pages/auth/a04-register" ".auth-page" "docs/design/screens/runtime/2026-07-14/A04-after-360x800.png" 360 800
node scripts/capture-chrome-page.js "http://localhost:5173/#/pages/auth/a04-register" ".auth-page" "docs/design/screens/runtime/2026-07-14/A04-after-412x915.png" 412 915
```
逐张打开检查:完整头、卷轴边框、三项输入、协议、按钮和登录入口可读;无横向裁切、黑块、加载态或 CSS 通用卡片。
- [x] **Step 3: 运行最终回归。**
运行:
```powershell
powershell.exe -NoProfile -ExecutionPolicy Bypass -File tests/a04-registration-contract.ps1
powershell.exe -NoProfile -ExecutionPolicy Bypass -File tests/a03-route-removal-contract.ps1
powershell.exe -NoProfile -ExecutionPolicy Bypass -File tests/a01-a02-ui-contract.ps1
powershell.exe -NoProfile -ExecutionPolicy Bypass -File tests/a02-register-entry-contract.ps1
powershell.exe -NoProfile -ExecutionPolicy Bypass -File tests/a02-asset-alpha-audit.ps1
powershell.exe -NoProfile -ExecutionPolicy Bypass -File tests/capture-chrome-page-contract.ps1
powershell.exe -NoProfile -ExecutionPolicy Bypass -File tests/compile-audit.ps1
powershell.exe -NoProfile -ExecutionPolicy Bypass -File tests/full-page-visual-contract.ps1
git diff --check
```
实际:全部 PASS;用户已于 2026-07-14 确认 A04 通过视觉验收,后续从 A05 开始。