From 7e44b621a5785878416367cd4e29404be243f4c1 Mon Sep 17 00:00:00 2001 From: owen Date: Fri, 1 Dec 2023 20:24:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=90=A5=E9=94=80=EF=BC=9A=E9=80=82=E9=85=8D?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6=E3=80=90?= =?UTF-8?q?=E7=A7=92=E6=9D=80=E3=80=91=EF=BC=88=E5=BE=85=E9=87=8D=E5=86=99?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/PromotionSeckill/config.ts | 64 +++++++++ .../mobile/PromotionSeckill/index.vue | 125 ++++++++++++++++++ .../mobile/PromotionSeckill/property.vue | 112 ++++++++++++++++ src/components/DiyEditor/util.ts | 8 +- 4 files changed, 308 insertions(+), 1 deletion(-) create mode 100644 src/components/DiyEditor/components/mobile/PromotionSeckill/config.ts create mode 100644 src/components/DiyEditor/components/mobile/PromotionSeckill/index.vue create mode 100644 src/components/DiyEditor/components/mobile/PromotionSeckill/property.vue diff --git a/src/components/DiyEditor/components/mobile/PromotionSeckill/config.ts b/src/components/DiyEditor/components/mobile/PromotionSeckill/config.ts new file mode 100644 index 00000000..800398be --- /dev/null +++ b/src/components/DiyEditor/components/mobile/PromotionSeckill/config.ts @@ -0,0 +1,64 @@ +import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' + +/** 秒杀属性 */ +export interface PromotionSeckillProperty { + // 布局类型:单列 | 三列 + layoutType: 'oneCol' | 'threeCol' + // 商品字段 + fields: { + // 商品名称 + name: PromotionSeckillFieldProperty + // 商品价格 + price: PromotionSeckillFieldProperty + } + // 角标 + badge: { + // 是否显示 + show: boolean + // 角标图片 + imgUrl: string + } + // 上圆角 + borderRadiusTop: number + // 下圆角 + borderRadiusBottom: number + // 间距 + space: number + // 秒杀活动编号 + activityId: number + // 组件样式 + style: ComponentStyle +} +// 商品字段 +export interface PromotionSeckillFieldProperty { + // 是否显示 + show: boolean + // 颜色 + color: string +} + +// 定义组件 +export const component = { + id: 'PromotionSeckill', + name: '秒杀', + icon: 'mdi:calendar-time', + property: { + activityId: undefined, + layoutType: 'oneCol', + fields: { + name: { show: true, color: '#000' }, + price: { show: true, color: '#ff3000' } + }, + badge: { show: false, imgUrl: '' }, + borderRadiusTop: 8, + borderRadiusBottom: 8, + space: 8, + style: { + bgType: 'color', + bgColor: '', + marginLeft: 8, + marginRight: 8, + marginBottom: 8 + } as ComponentStyle + } +} as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/PromotionSeckill/index.vue b/src/components/DiyEditor/components/mobile/PromotionSeckill/index.vue new file mode 100644 index 00000000..1b4113b6 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/PromotionSeckill/index.vue @@ -0,0 +1,125 @@ + + + + diff --git a/src/components/DiyEditor/components/mobile/PromotionSeckill/property.vue b/src/components/DiyEditor/components/mobile/PromotionSeckill/property.vue new file mode 100644 index 00000000..87537822 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/PromotionSeckill/property.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/src/components/DiyEditor/util.ts b/src/components/DiyEditor/util.ts index 2eb10f92..9f75aaa8 100644 --- a/src/components/DiyEditor/util.ts +++ b/src/components/DiyEditor/util.ts @@ -116,6 +116,12 @@ export const PAGE_LIBS = [ { name: '营销组件', extended: true, - components: ['CombinationCard', 'SeckillCard', 'PointCard', 'CouponCard', 'PromotionArticle'] + components: [ + 'PromotionCombination', + 'PromotionSeckill', + 'PromotionPoint', + 'CouponCard', + 'PromotionArticle' + ] } ] as DiyComponentLibrary[]