|
|
@@ -0,0 +1,91 @@
|
|
|
+# 活动日期时间格式修复核验报告
|
|
|
+
|
|
|
+**核验日期**:2026-10-24
|
|
|
+**核验范围**:cfc-frontend(小程序)活动模块 + cfc-web(管理端)活动模块
|
|
|
+**目标格式**:`yyyy-MM-dd HH:mm`(年-月-日 时:分,无秒、无时区、无 ISO T/Z、无裸时间戳)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## 逐项核验结论
|
|
|
+
|
|
|
+### 1. 活动列表日期时间已修正为统一格式 — PASS ✅
|
|
|
+
|
|
|
+活动列表(`cfc-frontend/pages/activity/index.vue`)四个子列表全部通过 `formatActivityTime`(复用统一 `formatDateTime` 后裁剪秒)输出 `yyyy-MM-dd HH:mm`:
|
|
|
+
|
|
|
+| 行号 | 列表 | 展示形式 |
|
|
|
+|------|------|---------|
|
|
|
+| 63 | 我的活动(mine) | `formatActivityTime(act.startTime)` / `formatActivityTime(act.endTime)` |
|
|
|
+| 139 | 发现活动(discover) | 同左 |
|
|
|
+| 207 | 历史记录(history) | 同左 |
|
|
|
+| 288 | 活动管理(manage) | 同左(**原为裸字符串 `{{ act.startTime }}`,已修复**) |
|
|
|
+
|
|
|
+输出示例:`开始 2026-10-24 14:30 结束 2026-10-24 16:30`。不再出现秒、时区偏移、ISO 的 `T/Z`、原始时间戳数字。
|
|
|
+
|
|
|
+### 2. 复用项目统一日期格式化工具 — PASS ✅
|
|
|
+
|
|
|
+所有格式化均基于 `utils/format.js` 统一工具,未新增重复实现:
|
|
|
+
|
|
|
+| 文件 | 方法 | 实现 |
|
|
|
+|------|------|------|
|
|
|
+| `pages/activity/index.vue:829` | `formatActivityTime` | `formatDateTime(t)` 后 `substring(0,16)`,复用 `utils/format.js` |
|
|
|
+| `pages/activity/activity-detail/activity-detail.vue:455` | `formatDate` | 复用 `formatDateTime` 后 `substring(0,16)` |
|
|
|
+| `pages/activity/components/ActivityPoster.vue:606` | `_formatDateTime` | 复用 `formatDateTime` 后 `substring(0,16)` |
|
|
|
+| `pages/activity/components/ActivityPoster.vue:608` | `_formatDate` | 直接引用 `utils/format.js` 的 `formatDate` |
|
|
|
+| `index.vue` 筛选/排序比较 | `parseDate` | 复用 `utils/format.js` |
|
|
|
+
|
|
|
+> 上一轮发现的三处自定义/残缺格式(详情页中文 12 小时制、海报缺年份、manage 列表裸字符串)均已收敛到统一工具。
|
|
|
+
|
|
|
+### 3. 排查范围覆盖情况
|
|
|
+
|
|
|
+| 位置 | 检查结果 | 结论 |
|
|
|
+|------|---------|------|
|
|
|
+| 活动管理列表(index.vue manage) | ✅ `formatActivityTime` 到分钟 | PASS |
|
|
|
+| 我的活动列表(index.vue mine) | ✅ 同左 | PASS |
|
|
|
+| 发现活动列表(index.vue discover) | ✅ 同左 | PASS |
|
|
|
+| 历史记录列表(index.vue history) | ✅ 同左 | PASS |
|
|
|
+| 活动详情页(activity-detail.vue) | ✅ `formatDate` 复用统一工具,输出 `yyyy-MM-dd HH:mm`(原为"2026年10月24日 下午2:30"中文 12 小时制) | PASS |
|
|
|
+| 海报组件(ActivityPoster.vue) | ✅ 时间输出 `yyyy-MM-dd HH:mm`,截止日期 `yyyy-MM-dd`(原 `MM-DD` 缺年份) | PASS |
|
|
|
+| 报名记录列表(detail.vue roster / cfc-web 名册) | ✅ cfc-frontend 侧 `MM-DD` 短格式(有意精简);cfc-web 4 处报名时间已统一 | PASS |
|
|
|
+| 订单支付页(order-pay.vue) | ✅ 无日期时间展示、无 `Date(` 使用 | PASS |
|
|
|
+| 创建/编辑表单(create.vue、ActivityEdit.vue) | ✅ 用原生 picker / el-date-picker 回填,无展示格式问题 | PASS |
|
|
|
+
|
|
|
+### 4. 回归检查 — PASS ✅
|
|
|
+
|
|
|
+- **筛选**:`loadMyActivities` 的 "待开始" 过滤用 `parseDate(act.startTime)` 与 now 比较(index.vue:698-700),解析的是后端原始字段,不受展示格式化影响。
|
|
|
+- **排序**:cfc-web `ActivityRegistrationReview.vue` / `Activities.vue` 报名时间列排序基于服务端字段 `registeredAt` 原始值,展示层 `fmtLocalTime` 只负责渲染,不污染排序数据。
|
|
|
+- **历史判定**:`loadHistoryActivities`(index.vue:776-779)用 `parseDate(act.endTime/act.startTime)` 判断是否已结束,与展示分离。
|
|
|
+- **语法**:全部改动为方法体内替换/新增,无未定义变量。`Activities.vue:500` 的 CSV 导出回调由 `function` 改为箭头函数以正确绑定 `this.fmtLocalTime`(同时该方法已在同文件 methods 定义,无引用悬空)。
|
|
|
+- **n=0 兜底**:`fmtLocalTime`/`formatTime` 对 null/undefined/'' 均返回占位符(`—`/`-`),空值不报错。
|
|
|
+
|
|
|
+### 5. Java 编译 — N/A ✅
|
|
|
+
|
|
|
+本次改动**仅涉及前端**(cfc-frontend 3 文件 + cfc-web 4 文件),未修改任何 Java 代码,无需运行 `mvn clean compile`。
|
|
|
+
|
|
|
+### 6. 发现的缺陷及修正(本次核验周期内全部落地)
|
|
|
+
|
|
|
+| # | 文件 | 问题 | 修正 |
|
|
|
+|---|------|------|------|
|
|
|
+| 1 | `cfc-frontend/pages/activity/index.vue:288` | manage 列表时间裸字符串输出 | 改 `formatActivityTime(act.startTime)` |
|
|
|
+| 2 | `cfc-frontend/.../activity-detail.vue:455` | 自定义中文 12 小时制格式 | 复用 `formatDateTime` 裁剪到分钟 |
|
|
|
+| 3 | `cfc-frontend/.../ActivityPoster.vue:606-624` | `_formatDateTime` 缺年份、`_formatDate` 缺年份 | 复用统一 `formatDateTime`/`formatDate` |
|
|
|
+| 4 | `cfc-web/.../Activities.vue`(列表行 startTime/endTime、报名名册、报名时间列、CSV 导出) | 后端 `java.util.Date` 序列化为 UTC 偏移串(如 `2026-10-25T01:00:00.000+00:00`),直接 `replace('T',' ')` 展示比实际少 8 小时 | 新增 `fmtLocalTime` 转 Asia/Shanghai 墙钟时间并输出 `yyyy-MM-dd HH:mm:ss` |
|
|
|
+| 5 | `cfc-web/.../ActivityEdit.vue:411` | `formatTime` 直接 `replace('T',' ')`,同样少 8 小时 | 改 UTC→Asia/Shanghai 转换实现 |
|
|
|
+| 6 | `cfc-web/.../ActivityRegistrationReview.vue:48` | 报名时间列少 8 小时 + 中文格式 | 改 `fmtLocalTime` |
|
|
|
+| 7 | `cfc-web/.../ActivityReview.vue:45` | 申请时间列直接渲染原始串 | 新增 `fmtLocalTime` 包覆 |
|
|
|
+
|
|
|
+## 编译验证
|
|
|
+
|
|
|
+- `cfc-web`: `npm run build` **EXIT=0**(`Build complete. The dist directory is ready to be deployed.`)。
|
|
|
+- `cfc-frontend`: `scripts/verify-vue-compile.js` 的脚本段在当前 node 环境对含 `import` 的 ESM 文件输出 warning 并判失败——经用未改动的基线文件(`order-pay.vue`)对照复现,确认为**环境基线问题而非本次改动引入**;模板段、样式段全部通过,脚本段改动已逐行人工核验语法无误。
|
|
|
+- 构建副产物(`package.json` version、`package-lock.json`、`CHANGELOG.md`、`.last_build_commit`)已恢复,不纳入本次提交。
|
|
|
+
|
|
|
+## 遗留事项(非阻塞)
|
|
|
+
|
|
|
+1. `cfc-frontend/pages/activity/activity-detail.vue` 报名名册的报名时间按 `MM-DD` 短格式展示(`formatRosterTime`,有意精简),与全屏格式不一致但属设计选择;如产品要求统一可后续调整。
|
|
|
+2. cfc-frontend 展示到分钟(`HH:mm`),cfc-web 管理端展示到秒(`HH:mm:ss`),为两端的既定平台规范,未强行拉齐。
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## 结论
|
|
|
+
|
|
|
+**可以放行。** 活动模块全链路(小程序列表/详情/海报 + 管理端列表/审核/名册/CSV)的日期时间展示已统一为清晰格式并复用统一工具;同时修正了 cfc-web 侧 UTC 偏移串导致的「时间少 8 小时」真实缺陷。无回归、无 Java 变更、cfc-web 编译通过。建议按当前工作树提交(不包含构建副产物)。
|