fix: 订单列表套餐显示销售价
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 7m33s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 7m33s
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
# Change: 创建订单使用套餐建议售价
|
||||
|
||||
## Why
|
||||
|
||||
创建订单弹窗中套餐选项当前展示成本价,容易让运营人员误以为下单金额等同成本价。套餐选项价格应展示套餐 `suggested_retail_price` 建议售价。
|
||||
|
||||
## What Changes
|
||||
|
||||
- 创建订单弹窗的套餐选项展示 `suggested_retail_price`,不再展示 `cost_price`。
|
||||
- 创建订单提交请求仍只提交套餐 ID 等订单字段,不额外提交 `suggested_retail_price`。
|
||||
|
||||
## Impact
|
||||
|
||||
- Affected specs: `order-management`
|
||||
- Affected code: `src/views/order-management/order-list/index.vue`
|
||||
@@ -0,0 +1,21 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Create Order Suggested Retail Price
|
||||
|
||||
The system SHALL show the selected package `suggested_retail_price` as the package price in the admin order creation dialog.
|
||||
|
||||
#### Scenario: Display package suggested retail price in create order dialog
|
||||
|
||||
- **GIVEN** 用户正在订单管理创建订单弹窗选择套餐
|
||||
- **AND** 套餐返回 `suggested_retail_price` 为 `2000` 分且 `cost_price` 为 `1000` 分
|
||||
- **WHEN** 系统渲染套餐下拉选项
|
||||
- **THEN** 套餐选项 MUST display `¥20.00`
|
||||
- **AND** 套餐选项 MUST NOT display `¥10.00` as the package price
|
||||
|
||||
#### Scenario: Do not submit package price when creating an order
|
||||
|
||||
- **GIVEN** 用户已在创建订单弹窗选择套餐
|
||||
- **AND** 所选套餐的 `suggested_retail_price` 为 `2000` 分
|
||||
- **WHEN** 用户提交创建订单表单
|
||||
- **THEN** 系统 MUST NOT include `suggested_retail_price` in the create-order request payload
|
||||
- **AND** 系统 MUST NOT include the selected package `cost_price` in the create-order request payload
|
||||
@@ -0,0 +1,9 @@
|
||||
## 1. Implementation
|
||||
|
||||
- [x] 1.1 Update create-order package option display to show `suggested_retail_price`.
|
||||
- [x] 1.2 Keep create-order request payload unchanged without submitting `suggested_retail_price`.
|
||||
|
||||
## 2. Verification
|
||||
|
||||
- [x] 2.1 Validate the OpenSpec change with strict mode.
|
||||
- [x] 2.2 Run relevant frontend type/lint verification.
|
||||
@@ -137,7 +137,7 @@
|
||||
<ElOption
|
||||
v-for="pkg in packageOptions"
|
||||
:key="pkg.id"
|
||||
:label="`${pkg.package_name} (¥${((pkg.cost_price || 0) / 100).toFixed(2)})`"
|
||||
:label="`${pkg.package_name} (${formatPackageSuggestedRetailPrice(pkg)})`"
|
||||
:value="pkg.id"
|
||||
>
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
@@ -146,7 +146,7 @@
|
||||
<template v-if="pkg.is_gift">
|
||||
<el-tag type="warning" size="small">赠送</el-tag>
|
||||
</template>
|
||||
<template v-else> ¥{{ ((pkg.cost_price || 0) / 100).toFixed(2) }} </template>
|
||||
<template v-else>{{ formatPackageSuggestedRetailPrice(pkg) }}</template>
|
||||
</span>
|
||||
</div>
|
||||
</ElOption>
|
||||
@@ -673,6 +673,13 @@
|
||||
return selectedPackage?.is_gift || false
|
||||
})
|
||||
|
||||
const formatPackageSuggestedRetailPrice = (pkg: PackageResponse): string => {
|
||||
if (pkg.suggested_retail_price === null || pkg.suggested_retail_price === undefined) {
|
||||
return '未配置建议售价'
|
||||
}
|
||||
return `¥${(pkg.suggested_retail_price / 100).toFixed(2)}`
|
||||
}
|
||||
|
||||
// IoT卡选择变化时,根据series_id加载套餐列表
|
||||
const handleIotCardChange = (cardId: number | null) => {
|
||||
if (!cardId) {
|
||||
|
||||
Reference in New Issue
Block a user