update: 价格档位改为产品级别定义组合

这个提交包含在:
API Changelog Bot 2026-03-26 14:57:09 +08:00
父节点 4dcb37cc5f
当前提交 da5489f677

查看文件

@ -50,3 +50,40 @@
**流程**:团期管理 → 选择团期 → 配置套餐组合和价格 → 小程序详情页自动取最近可报名团期的套餐展示 **流程**:团期管理 → 选择团期 → 配置套餐组合和价格 → 小程序详情页自动取最近可报名团期的套餐展示
产品编辑页的"价格档位"输入框应该去掉,改为提示"价格档位由团期套餐自动生成"。 产品编辑页的"价格档位"输入框应该去掉,改为提示"价格档位由团期套餐自动生成"。
---
## 更正:产品级别配置组合,价格后端自动算
### 管理端输入
产品编辑时配置 `priceTierLabels`(只输组合名称和人数,不输价格):
```json
[
{ "label": "1大1小", "adultCount": 1, "childCount": 1 },
{ "label": "1大2小", "adultCount": 1, "childCount": 2 },
{ "label": "2大1小", "adultCount": 2, "childCount": 1 }
]
```
通过 `POST /admin/product/save``PUT /admin/product/{id}``priceTierLabels` 字段保存。
### 小程序展示
`priceTiers` 后端根据组合定义,匹配所有可报名团期 combo 的最低售价自动填入 `price`
```json
[
{ "label": "1大1小", "adultCount": 1, "childCount": 1, "price": 12800 },
{ "label": "1大2小", "adultCount": 1, "childCount": 2, "price": 15800 },
{ "label": "2大1小", "adultCount": 2, "childCount": 1, "price": 18800 }
]
```
### 前端改造
产品编辑页的"价格档位"表单改为:
- 输入:档位名称(如"1大1小"+ 成人数 + 儿童数
- **不输入价格**价格由后端从团期combo自动算
- 回显用 `priceTierLabels` 字段