提交 | 用户 | 时间
|
820397
|
1 |
import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' |
H |
2 |
|
|
3 |
/** 秒杀属性 */ |
|
4 |
export interface PromotionSeckillProperty { |
|
5 |
// 布局类型:单列 | 三列 |
9259c2
|
6 |
layoutType: 'oneColBigImg' | 'oneColSmallImg' | 'twoCol' |
820397
|
7 |
// 商品字段 |
H |
8 |
fields: { |
|
9 |
// 商品名称 |
|
10 |
name: PromotionSeckillFieldProperty |
9259c2
|
11 |
// 商品简介 |
H |
12 |
introduction: PromotionSeckillFieldProperty |
820397
|
13 |
// 商品价格 |
H |
14 |
price: PromotionSeckillFieldProperty |
9259c2
|
15 |
// 市场价 |
H |
16 |
marketPrice: PromotionSeckillFieldProperty |
|
17 |
// 商品销量 |
|
18 |
salesCount: PromotionSeckillFieldProperty |
|
19 |
// 商品库存 |
|
20 |
stock: PromotionSeckillFieldProperty |
820397
|
21 |
} |
H |
22 |
// 角标 |
|
23 |
badge: { |
|
24 |
// 是否显示 |
|
25 |
show: boolean |
|
26 |
// 角标图片 |
9259c2
|
27 |
imgUrl: string |
H |
28 |
} |
|
29 |
// 按钮 |
|
30 |
btnBuy: { |
|
31 |
// 类型:文字 | 图片 |
|
32 |
type: 'text' | 'img' |
|
33 |
// 文字 |
|
34 |
text: string |
|
35 |
// 文字按钮:背景渐变起始颜色 |
|
36 |
bgBeginColor: string |
|
37 |
// 文字按钮:背景渐变结束颜色 |
|
38 |
bgEndColor: string |
|
39 |
// 图片按钮:图片地址 |
820397
|
40 |
imgUrl: string |
H |
41 |
} |
|
42 |
// 上圆角 |
|
43 |
borderRadiusTop: number |
|
44 |
// 下圆角 |
|
45 |
borderRadiusBottom: number |
|
46 |
// 间距 |
|
47 |
space: number |
|
48 |
// 秒杀活动编号 |
9259c2
|
49 |
activityIds: number[] |
820397
|
50 |
// 组件样式 |
H |
51 |
style: ComponentStyle |
|
52 |
} |
9259c2
|
53 |
|
820397
|
54 |
// 商品字段 |
H |
55 |
export interface PromotionSeckillFieldProperty { |
|
56 |
// 是否显示 |
|
57 |
show: boolean |
|
58 |
// 颜色 |
|
59 |
color: string |
|
60 |
} |
|
61 |
|
|
62 |
// 定义组件 |
|
63 |
export const component = { |
|
64 |
id: 'PromotionSeckill', |
|
65 |
name: '秒杀', |
|
66 |
icon: 'mdi:calendar-time', |
|
67 |
property: { |
9259c2
|
68 |
layoutType: 'oneColBigImg', |
820397
|
69 |
fields: { |
H |
70 |
name: { show: true, color: '#000' }, |
9259c2
|
71 |
introduction: { show: true, color: '#999' }, |
H |
72 |
price: { show: true, color: '#ff3000' }, |
|
73 |
marketPrice: { show: true, color: '#c4c4c4' }, |
|
74 |
salesCount: { show: true, color: '#c4c4c4' }, |
|
75 |
stock: { show: false, color: '#c4c4c4' } |
820397
|
76 |
}, |
H |
77 |
badge: { show: false, imgUrl: '' }, |
9259c2
|
78 |
btnBuy: { |
H |
79 |
type: 'text', |
|
80 |
text: '立即秒杀', |
|
81 |
bgBeginColor: '#FF6000', |
|
82 |
bgEndColor: '#FE832A', |
|
83 |
imgUrl: '' |
|
84 |
}, |
820397
|
85 |
borderRadiusTop: 8, |
H |
86 |
borderRadiusBottom: 8, |
|
87 |
space: 8, |
|
88 |
style: { |
|
89 |
bgType: 'color', |
|
90 |
bgColor: '', |
|
91 |
marginLeft: 8, |
|
92 |
marginRight: 8, |
|
93 |
marginBottom: 8 |
|
94 |
} as ComponentStyle |
|
95 |
} |
|
96 |
} as DiyComponent<PromotionSeckillProperty> |