Files
huangguo_server/VIP卡片UI配置接口.md
T
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

1.5 KiB

VIP卡片 UI 配置接口

本次不新增接口,在现有接口中增加 uiConfig

1. 发布配置

POST /api/web/admin/vip-card-experiment/publish

variantAvariantB 增加:

{
  "uiConfig": {
    "backgroundImage": "背景图地址",
    "badgeStyles": [
      {
        "badgeType": "MOST_POPULAR",
        "backgroundColor": "#2B251A",
        "textColor": "#F7D98C"
      }
    ]
  }
}

说明:

  • backgroundImage:当前 A/B 分组的会员中心整体页面背景图,不是单个套餐卡片背景。
  • badgeType:与套餐返回的 badgeType 对应。
  • backgroundColor:角标背景色。
  • textColor:角标文字颜色。
  • 颜色支持 #RRGGBB#RRGGBBAA

2. 查询配置

GET /api/web/admin/vip-card-experiment/current

增加返回:

data.variantA.uiConfig
data.variantB.uiConfig

3. App/H5 套餐接口

GET /api/app/vip/product

增加返回:

data.uiConfig

App/H5 只会收到当前登录用户命中分组的 uiConfig

4. 图片上传

继续使用现有接口:

POST /api/web/admin/vid/uploadStatic

将返回的 data.coverImg 填入 uiConfig.backgroundImage

注意

  • uiConfig 不传时,前端使用默认背景和默认配色。
  • badgeStyles 只控制颜色,角标文字仍使用套餐中的 badgeText
  • desc 不参与新角标显示。
  • 发布接口是整份实验发布;修改配置时需要使用新的 experimentId