diff --git a/changelogs/2026-03/26_1530_price_tiers_readonly.md b/changelogs/2026-03/26_1530_price_tiers_readonly.md index 9a7de60..467ac5f 100644 --- a/changelogs/2026-03/26_1530_price_tiers_readonly.md +++ b/changelogs/2026-03/26_1530_price_tiers_readonly.md @@ -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` 字段