chore: 文档与 IDE 配置整理
- .kiro/specs/ → docs/specs/(41 个历史需求 spec 迁移,移除 .config.kiro) - CLAUDE.md 三层拆分:根文件精简 + apps/backend/CLAUDE.md + .claude/commands/ - 新增 /spec-close、/pre-change 两个工作流命令 - DDL 基线刷新(从测试库重新导出 11 个文件,dws 35→38 表,biz 18→21 表) - BD_Manual → BD_manual 命名统一(48 个文件) - 修复 3 处文档与数据库不一致(auth.users.status 默认值、scheduled_tasks 字段、RLS 视图数) - 新增 BD_manual_public_rbac_tables.md(public schema 8 张 RBAC/工作流表) - 合并 biz.trigger_jobs 文档(10→12 字段,归档独立文档) - docs/database/README.md 索引更新 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
62
docs/specs/p13-miniapp-fe-polish/design.md
Normal file
62
docs/specs/p13-miniapp-fe-polish/design.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# 设计文档:P13 小程序前端联调补齐与格式统一
|
||||
|
||||
## 概述
|
||||
|
||||
本设计覆盖 P13 PRD 中所有前端改动项。核心策略:通用规则先行(G1~G4),再逐页面修复功能点,最后统一格式化审查。
|
||||
|
||||
## 涉及文件
|
||||
|
||||
### 工具函数(新建/修改)
|
||||
- `apps/miniprogram/miniprogram/utils/storage-level.ts`(新建)— 储值等级计算
|
||||
- `apps/miniprogram/miniprogram/utils/money.ts`(修改)— 补充 formatTrendValue
|
||||
- `apps/miniprogram/miniprogram/utils/time.ts`(修改)— 补充 formatDateShort、formatDateFull、formatDays
|
||||
- `apps/miniprogram/miniprogram/utils/format.wxs`(修改)— 补充 WXS 侧格式化函数
|
||||
|
||||
### 页面文件(按 PRD 编号)
|
||||
- P1 task-list:`pages/task-list/task-list.ts` + `.wxml`
|
||||
- P2 performance:`pages/performance/performance.ts` + `.wxml`
|
||||
- P3 performance-records:`pages/performance-records/performance-records.ts` + `.wxml`
|
||||
- P4 task-detail:`pages/task-detail/task-detail.ts` + `.wxml`
|
||||
- P5 customer-service-records:`pages/customer-service-records/customer-service-records.ts` + `.wxml`
|
||||
- P6 board-finance:`pages/board-finance/board-finance.ts` + `.wxml`
|
||||
- P10 coach-detail:`pages/coach-detail/coach-detail.ts` + `.wxml`
|
||||
|
||||
### 服务层
|
||||
- `apps/miniprogram/miniprogram/services/api.ts` — 确认接口字段对齐
|
||||
|
||||
## 设计决策
|
||||
|
||||
### G1 微信头像
|
||||
- 全局用户信息存储在 app.globalData 或独立 store 中
|
||||
- 三个 banner 页面(task-list、performance、performance-records)在 onShow 时从全局读取 avatarUrl
|
||||
- 无头像时使用默认占位图(已有 avatar-color.ts 可复用)
|
||||
|
||||
### G2 当月预估判断
|
||||
- 纯前端逻辑:`isCurrentMonth = (year === nowYear && month === nowMonth)`
|
||||
- 影响 performance、performance-records、board-finance 三个页面
|
||||
- 条件渲染"预估"标签和标题文案
|
||||
|
||||
### G3 绩效折算
|
||||
- 后端已返回 hours 和 hoursRaw 字段
|
||||
- 前端条件:`hoursRaw !== hours` 时显示"折前 Xh"
|
||||
- 汇总统计同理
|
||||
|
||||
### G4 储值等级
|
||||
- 新建 `utils/storage-level.ts`,导出 `formatStorageLevel(balance: number): string`
|
||||
- 阈值:0→"无"、<200→"少"、<500→"一般"、<1500→"多"、≥1500→"非常多"
|
||||
|
||||
### 格式化工具函数补充
|
||||
- `formatDateShort(date)` → "3月15日"
|
||||
- `formatDateFull(date)` → "2026-03-15"
|
||||
- `formatDays(days)` → "3天"
|
||||
- `formatTrendValue(value)` → "+¥1,200" / "-¥800"
|
||||
- 所有函数遵循缺省值 `--` 规则
|
||||
|
||||
## 执行策略
|
||||
|
||||
按 PRD 第四节实施优先级分三批执行,每个页面逐一审查:
|
||||
1. 通用规则(G1~G4)审查修改
|
||||
2. 数据格式统一标准审查修改
|
||||
3. 页面专属功能点审查修改
|
||||
|
||||
每个页面由子代理独立处理,最大并行数 2。
|
||||
Reference in New Issue
Block a user