Files
luo da95a914e3
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 2m59s
fix: some
2026-10-13 14:53:19 +08:00

64 lines
3.4 KiB
Markdown
Raw 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.
## ADDED Requirements
### Requirement: Expiry reminders SHALL use the optional asset-info response
H5 SHALL 仅以 `GET /api/c/v1/asset/info` 返回的可选 `expiry_reminder` 作为本次临期主动提醒来源,在首页资产信息区展示可关闭横幅。剩余天数、到期时间、等级及等级名称 SHALL 使用 `remaining_days`、`expires_at`、`level`、`level_name`,SHALL NOT 用旧未读临期通知或客户端计算补发提醒。
#### Scenario: Asset info includes a reminder
- **WHEN** 当前资产响应含有效 expiry_reminder
- **THEN** H5 SHALL 展示该资产临期横幅及后端提供的提醒信息
#### Scenario: Asset info omits the optional field
- **WHEN** 响应无 expiry_reminder,且当前进入没有已接收的待展示提醒
- **THEN** H5 SHALL 不显示临期横幅,也不从 is_expiring 或通知列表补发
### Requirement: Reminder presentation SHALL preserve server calendar and levels
H5 SHALL 正确显示 0~15 天,按后端 `red`(0~3)、`purple`(4~7)、`pink`(8~15)设置视觉等级,并提供文字信息。到期时间 SHALL 按 Asia/Shanghai 展示,SHALL NOT 按客户端日期重新判定等级或剩余自然日。
#### Scenario: Zero remaining days
- **WHEN** 后端返回 remaining_days=0、level=red
- **THEN** H5 SHALL 正常展示 0 天及红色等级,不能把 0 当作缺失
#### Scenario: Client timezone differs from Shanghai
- **WHEN** 用户设备的本地时区不是 Asia/Shanghai
- **THEN** H5 SHALL 保留后端天数和等级,到期时间使用上海时区呈现
### Requirement: One-time reminder delivery SHALL survive competing asset-info consumers
H5 SHALL 在 asset/info 的共享成功返回入口接收一次性提醒,按当前客户上下文及资产隔离并暂存至对应资产可见。后端负责每日一次,前端 SHALL 防止同次接收被重复展示,SHALL NOT 因并发空字段响应覆盖已接收提醒、使用额外轮询或在关闭后复播。
#### Scenario: Child component receives the only reminder response
- **WHEN** TrafficCard 等调用方先获得 expiry_reminder,首页后续响应未返回该字段
- **THEN** H5 SHALL 通过共享接收状态在当前资产信息区展示该提醒,不将其丢弃
#### Scenario: Same asset is re-entered after dismissal
- **WHEN** 用户关闭提醒后再次进入同一资产,后端不再返回字段
- **THEN** H5 SHALL 不重播先前已展示提醒
#### Scenario: User switches customer or asset
- **WHEN** 用户退出、切换客户或进入另一资产
- **THEN** H5 SHALL 不显示旧上下文提醒;其他资产有新提醒时 SHALL 独立处理
### Requirement: Expiry notifications SHALL remain in the notification center without driving popups
H5 SHALL 从首页旧未读通知弹窗来源排除临期项,同时保留通知中心临期列表、未读数和既有阅读操作。临期横幅展示或关闭 SHALL NOT 自动标记通知已读,其他通知及候选弹窗链路 SHALL 保持不变。
#### Scenario: Unread expiry notification exists without a new reminder
- **WHEN** 通知列表返回未读临期项,但 asset/info 无本次提醒
- **THEN** H5 SHALL 不以该项触发旧首页临期弹窗
- **AND** 通知中心 SHALL 仍可展示和阅读该项
#### Scenario: User closes an expiry banner
- **WHEN** 用户关闭临期横幅
- **THEN** H5 SHALL 不猜测 notification_id、不发送自动单条已读或全部已读请求