Files
device-voice-h5/openspec/changes/update-device-exchange-shipping-entry-and-index-iccid/proposal.md
sexygoat b611808316
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 1m48s
fix: 优化换货
2026-05-14 12:14:05 +08:00

29 lines
2.0 KiB
Markdown

## Why
The device exchange popup currently collects the shipping address as a single free-text field. This makes Chinese address entry error-prone, does not support selecting province/city/district from a standard area dataset, and forces users to manually rewrite recipient details even when they already copied a full shipping string from another app.
The homepage top summary card already loads asset information from `/api/c/v1/asset/info`, but it does not surface the `ICCID` value even though the response now provides `data.iccid`. Users need that value visible above the package name on the homepage.
## What Changes
- Replace the single shipping-address input in `pages/device-exchange/device-exchange.vue` with province/city/district selection backed by `element-china-area-data` plus a separate detailed-address input
- Add a pasteable shipping-info input so the page can recognize and prefill recipient name, phone number, and address from one copied string
- Keep the existing exchange shipping submission API contract and assemble the selected region text together with the detailed address into `recipient_address`
- Add an `ICCID` line above the package name in the homepage top summary card
- Use `data.iccid` from `/api/c/v1/asset/info?identifier=...` as the homepage `ICCID` source of truth
## Capabilities
### New Capabilities
- `device-exchange-shipping-entry`: Define structured shipping entry, pasted shipping-text recognition, and payload composition for the device exchange popup
- `index-asset-summary`: Define homepage summary display rules for `ICCID`
### Modified Capabilities
## Impact
- Affected code: `pages/device-exchange/device-exchange.vue`, `pages/index/index.vue`, `components/UserInfoCard.vue`, related address parsing helpers if introduced
- Affected dependencies: `element-china-area-data`
- Affected API usage: `/api/c/v1/exchange/{id}/shipping-info`, `/api/c/v1/asset/info`
- No backend API contract change is required if the frontend continues submitting a composed `recipient_address` string