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