79 lines
1.5 KiB
Markdown
79 lines
1.5 KiB
Markdown
# VIP卡片 UI 配置接口
|
|
|
|
本次不新增接口,在现有接口中增加 `uiConfig`。
|
|
|
|
## 1. 发布配置
|
|
|
|
```http
|
|
POST /api/web/admin/vip-card-experiment/publish
|
|
```
|
|
|
|
`variantA`、`variantB` 增加:
|
|
|
|
```json
|
|
{
|
|
"uiConfig": {
|
|
"backgroundImage": "背景图地址",
|
|
"badgeStyles": [
|
|
{
|
|
"badgeType": "MOST_POPULAR",
|
|
"backgroundColor": "#2B251A",
|
|
"textColor": "#F7D98C"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
```
|
|
|
|
说明:
|
|
|
|
- `backgroundImage`:当前 A/B 分组的会员中心整体页面背景图,不是单个套餐卡片背景。
|
|
- `badgeType`:与套餐返回的 `badgeType` 对应。
|
|
- `backgroundColor`:角标背景色。
|
|
- `textColor`:角标文字颜色。
|
|
- 颜色支持 `#RRGGBB`、`#RRGGBBAA`。
|
|
|
|
## 2. 查询配置
|
|
|
|
```http
|
|
GET /api/web/admin/vip-card-experiment/current
|
|
```
|
|
|
|
增加返回:
|
|
|
|
```text
|
|
data.variantA.uiConfig
|
|
data.variantB.uiConfig
|
|
```
|
|
|
|
## 3. App/H5 套餐接口
|
|
|
|
```http
|
|
GET /api/app/vip/product
|
|
```
|
|
|
|
增加返回:
|
|
|
|
```text
|
|
data.uiConfig
|
|
```
|
|
|
|
App/H5 只会收到当前登录用户命中分组的 `uiConfig`。
|
|
|
|
## 4. 图片上传
|
|
|
|
继续使用现有接口:
|
|
|
|
```http
|
|
POST /api/web/admin/vid/uploadStatic
|
|
```
|
|
|
|
将返回的 `data.coverImg` 填入 `uiConfig.backgroundImage`。
|
|
|
|
## 注意
|
|
|
|
- `uiConfig` 不传时,前端使用默认背景和默认配色。
|
|
- `badgeStyles` 只控制颜色,角标文字仍使用套餐中的 `badgeText`。
|
|
- `desc` 不参与新角标显示。
|
|
- 发布接口是整份实验发布;修改配置时需要使用新的 `experimentId`。
|