gaoluyang
2026-06-24 712aa51536236d43e87273e4ce45ac5691dffad8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import type { ComponentStyle, DiyComponent } from '../../../util';
 
/** 积分商城属性 */
export interface PromotionPointProperty {
  layoutType: 'oneColBigImg' | 'oneColSmallImg' | 'twoCol'; // 布局类型:单列 | 三列
  fields: {
    introduction: PromotionPointFieldProperty; // 商品简介
    marketPrice: PromotionPointFieldProperty; // 市场价
    name: PromotionPointFieldProperty; // 商品名称
    price: PromotionPointFieldProperty; // 商品价格
    salesCount: PromotionPointFieldProperty; // 商品销量
    stock: PromotionPointFieldProperty; // 商品库存
  }; // 商品字段
  badge: {
    imgUrl: string; // 角标图片
    show: boolean; // 是否显示
  }; // 角标
  // 按钮
  btnBuy: {
    bgBeginColor: string; // 文字按钮:背景渐变起始颜色
    bgEndColor: string; // 文字按钮:背景渐变结束颜色
    imgUrl: string; // 图片按钮:图片地址
    text: string; // 文字
    type: 'img' | 'text'; // 类型:文字 | 图片
  }; // 按钮
  borderRadiusTop: number; // 上圆角
  borderRadiusBottom: number; // 下圆角
  space: number; // 间距
  activityIds: number[]; // 积分活动编号
  style: ComponentStyle; // 组件样式
}
 
/** 商品字段属性 */
export interface PromotionPointFieldProperty {
  show: boolean; // 是否显示
  color: string; // 颜色
}
 
/** 定义组件 */
export const component = {
  id: 'PromotionPoint',
  name: '积分商城',
  icon: 'ep:present',
  property: {
    layoutType: 'oneColBigImg',
    fields: {
      name: { show: true, color: '#000' },
      introduction: { show: true, color: '#999' },
      price: { show: true, color: '#ff3000' },
      marketPrice: { show: true, color: '#c4c4c4' },
      salesCount: { show: true, color: '#c4c4c4' },
      stock: { show: false, color: '#c4c4c4' },
    },
    badge: { show: false, imgUrl: '' },
    btnBuy: {
      type: 'text',
      text: '立即兑换',
      bgBeginColor: '#FF6000',
      bgEndColor: '#FE832A',
      imgUrl: '',
    },
    borderRadiusTop: 8,
    borderRadiusBottom: 8,
    space: 8,
    style: {
      bgType: 'color',
      bgColor: '',
      marginLeft: 8,
      marginRight: 8,
      marginBottom: 8,
    } as ComponentStyle,
  },
} as DiyComponent<PromotionPointProperty>;