fix: 消息通知页不能点进详情 — 补全 product_serial_number

问题: 点击通知卡片跳转 detail?taskId=xxx,但 detail.vue onLoad 只认 serial 参数导致空白页

修复:
1. 后端 NotificationResponse 新增 product_serial_number 字段
2. 后端 notifications API 联表 tasks+products 批量填充 serial
3. 前端 notify/index.vue handleCardTap 优先用 product_serial_number 跳转,兜底从 content 正则解析
4. 前端 detail.vue onLoad 新增 taskId 兜底 → doQueryByTask 反查 product_sn
This commit is contained in:
2026-08-11 15:56:25 +08:00
parent 0e3eb6a35a
commit 40a2d87345
4 changed files with 37 additions and 5 deletions

View File

@ -13,6 +13,7 @@ class NotificationResponse(BaseModel):
content: str
type: str
task_id: uuid.UUID | None = None
product_serial_number: str | None = None
is_read: bool
created_at: datetime