feat: 接入新参数:套餐分配生效条件选择,资产详情前代后代换货标识
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 7m0s

This commit is contained in:
luo
2026-07-23 17:06:05 +08:00
parent d7c2c146fe
commit 5e15127a89
16 changed files with 230 additions and 56 deletions

View File

@@ -7,7 +7,7 @@
## What Changes
- 复用 `POST /api/admin/exchanges` 的现有失败 `code``msg` 契约,不改变成功响应结构。
- 创建换货单被退款拦截或其他后端业务规则拒绝时,在创建换货单表单顶部或旧资产行直接展示后端业务原因,例如“该资产存在退款申请”。
- 创建换货单被退款拦截或其他后端业务规则拒绝时,通过统一 HTTP 错误处理展示后端业务原因,例如“该资产存在退款申请”,不在创建弹窗内额外渲染本地错误区域
- 创建失败后保留当前填写的表单、已选资产与流程类型,恢复提交按钮使用户可更换资产后重新提交。
- 前端不新增退款状态查询、预检查区域或退款申请入口。
- 前端不读取或推断退款审批、撤销、拒绝或处理完成状态;是否允许换货完全依据创建接口结果。

View File

@@ -2,22 +2,24 @@
### Requirement: Exchange Creation Refund Interception Feedback
The exchange creation page SHALL display the backend business reason when `POST /api/admin/exchanges` rejects the selected old asset because of an active refund application. The page MUST use the response `code` and `msg` contract without changing the successful exchange response structure.
The exchange creation page SHALL display the backend business reason through the unified HTTP error handling when `POST /api/admin/exchanges` rejects the selected old asset because of an active refund application. The page MUST use the response `code` and `msg` contract without changing the successful exchange response structure, and MUST NOT render an additional local error area inside the create dialog for the same failure.
#### Scenario: Display active refund interception reason
- **GIVEN** 用户已填写创建换货单表单并选择存在活跃退款申请的旧资产
- **WHEN** `POST /api/admin/exchanges` 返回失败 `code``msg`
- **THEN** 页面 MUST display the backend business reason in the create exchange form context
- **THEN** 页面 MUST display the backend business reason through the unified HTTP error handling
- **AND** 当后端 `msg` 为“该资产存在退款申请”时,页面 MUST display that message directly
- **AND** 页面 MUST NOT display a duplicate error alert inside the create exchange dialog
- **AND** 系统 MUST NOT create a new exchange order
#### Scenario: Display other exchange creation business reason
- **GIVEN** 用户已填写创建换货单表单
- **WHEN** 创建接口返回非退款相关的业务失败 `code``msg`
- **THEN** 页面 MUST display the backend `msg` in the create exchange form context
- **THEN** 页面 MUST display the backend `msg` through the unified HTTP error handling
- **AND** 页面 MUST NOT replace the backend business reason with a generic frontend failure message
- **AND** 页面 MUST NOT display a duplicate error alert inside the create exchange dialog
### Requirement: Exchange Creation Retry After Interception

View File

@@ -5,7 +5,7 @@
## 2. Refund Interception Feedback
- [x] 2.1 在创建换货单表单顶部或旧资产行展示后端返回的退款拦截业务原因
- [x] 2.1 通过统一 HTTP 错误处理展示后端返回的退款拦截业务原因,不在创建弹窗内额外渲染本地错误区域
- [x] 2.2 退款拦截失败后保留表单输入、已选资产和流程类型。
- [x] 2.3 请求结束后恢复提交按钮,使用户能够更换资产并再次提交。