feat(messages): 补齐 PC 消息中心通知与已读操作

This commit is contained in:
yml2213
2026-10-30 14:19:23 +08:00
parent ca2c8fee26
commit 398bf28d7d
3 changed files with 257 additions and 21 deletions
+29
View File
@@ -0,0 +1,29 @@
# Phase 2 PC 消息中心通知验收
> 日期:2026-10-30
> 范围:PC 消息中心增加「通知」Tab,与移动端消息中心对齐。
## 1. 交付内容
- `frontend/src/features/messages/MessagesPage.tsx`
- 新增「会话 / 通知」Tabs。
- 通知列表展示标题、正文、相对时间与未读点。
- 点击单条通知调用 `POST /notifications/:id/read` 并刷新列表。
- 顶栏支持「全部已读」,调用 `PUT /notifications/read-all`。
- 未读通知数量展示在 Tab 与页面顶部。
- `frontend/src/styles/pc-messages.css`
- 新增 `.pc-messages-tabs`、`.pc-notice-list`、`.pc-notice-row*` 样式。
- 未读通知使用朱砂色圆点与浅色光晕,保持现有品牌语言。
## 2. 验证记录
| 检查 | 结果 |
|---|---|
| `npx tsc --noEmit` | 见提交时结果 |
| `npm run build` | 见提交时结果 |
| `GET /api/notifications` | 现有接口,移动端已在用 |
## 3. 说明
- 通知点击目前只标记已读,不自动跳转业务详情;后续可按 `biz_type/biz_id` 映射订单、申诉或公告。
- 通知分页沿用 React Query `useInfiniteQuery`,每页 20 条。