import type { ComponentStyle, DiyComponent } from '../../../util';
|
|
/** 拼团属性 */
|
export interface PromotionCombinationProperty {
|
layoutType: 'oneColBigImg' | 'oneColSmallImg' | 'twoCol'; // 布局类型:单列 | 三列
|
fields: {
|
introduction: PromotionCombinationFieldProperty; // 商品简介
|
marketPrice: PromotionCombinationFieldProperty; // 市场价
|
name: PromotionCombinationFieldProperty; // 商品名称
|
price: PromotionCombinationFieldProperty; // 商品价格
|
salesCount: PromotionCombinationFieldProperty; // 商品销量
|
stock: PromotionCombinationFieldProperty; // 商品库存
|
}; // 商品字段
|
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 PromotionCombinationFieldProperty {
|
show: boolean; // 是否显示
|
color: string; // 颜色
|
}
|
|
/** 定义组件 */
|
export const component = {
|
id: 'PromotionCombination',
|
name: '拼团',
|
icon: 'mdi:account-group',
|
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<PromotionCombinationProperty>;
|