Files
Neo 70324d8542 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>
2026-04-06 00:02:37 +08:00

63 lines
2.6 KiB
Markdown
Raw Permalink 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.
# 设计文档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。