Files
device-voice-h5/openspec/changes/add-h5-popup-candidate-flow/tasks.md
2026-09-16 16:32:08 +08:00

37 lines
1.8 KiB
Markdown

## 1. API Layer
- [ ] 1.1 Add `popupApi.getCandidate(page, identifier)` for `GET /api/c/v1/popup-candidates`
- [ ] 1.2 Add `popupApi.submitRiskExchangeAddress(assetId, params)` for `POST /api/c/v1/risk-exchanges/{asset_id}/address`
- [ ] 1.3 Include the notification `id` in the mark-read request body (R3)
## 2. PopupCandidate Component
- [ ] 2.1 Query the candidate once per mount and emit `empty` when none exists
- [ ] 2.2 Render title/body and hide silently on resource-invisible responses
- [ ] 2.3 Map `action_type` through the whitelist and navigate from the mapped page
- [ ] 2.4 Mark the notification read on dismiss and on action (R3)
- [ ] 2.5 Deduplicate by `notification_id` within a session so same-day repeats do not re-popup
- [ ] 2.6 Provide the risk-exchange address form, submission, and result view
## 3. Page Wiring
- [ ] 3.1 Wire `home` in `pages/index/index.vue` with priority over the legacy unread-notification popup
- [ ] 3.2 Wire `package_purchase` in `pages/package-order/package-order.vue`
- [ ] 3.3 Wire `asset_wallet_recharge` in `pages/my-wallet/my-wallet.vue`
- [ ] 3.4 Leave `asset_detail` unwired
## 4. Notification Contract Alignment
- [ ] 4.1 Remove client-side priority re-sort and rely on the backend ordering
- [ ] 4.2 Align the category label map with `approval/expiry/sync/system`
- [ ] 4.3 Keep the unread badge consistent with popup counting and `99+` display
- [ ] 4.4 Keep `read-all` out of the popup display chain
## 5. Regression Verification
- [ ] 5.1 Operation popup with action navigates to the mapped page and marks read
- [ ] 5.2 Risk-exchange popup submits the address and shows the exchange number
- [ ] 5.3 Repeat entry with the same `notification_id` does not re-popup
- [ ] 5.4 Invisible asset shows no popup and no error branch
- [ ] 5.5 Notification center renders new `h5.popup.*` types without layout breakage