From c486dfd87a21e818a424deb450dfaf26b9fa63e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Tue, 3 Sep 2024 15:52:38 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91=E9=87=8D=E6=9E=84=E6=8B=BC=E5=9B=A2=E8=A3=85?= =?UTF-8?q?=E4=BF=AE=EF=BC=88=E4=BB=8D=E9=9C=80=E4=BC=98=E5=8C=96=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combination/combinationActivity.ts | 62 ++-- .../components/ComponentContainer.vue | 2 +- .../mobile/PromotionCombination/config.ts | 136 ++++--- .../mobile/PromotionCombination/index.vue | 287 +++++++++------ .../mobile/PromotionCombination/property.vue | 145 +++++--- .../components/CombinationShowcase.vue | 147 ++++++++ .../components/CombinationTableSelect.vue | 332 ++++++++++++++++++ 7 files changed, 879 insertions(+), 232 deletions(-) create mode 100644 src/views/mall/promotion/combination/components/CombinationShowcase.vue create mode 100644 src/views/mall/promotion/combination/components/CombinationTableSelect.vue diff --git a/src/api/mall/promotion/combination/combinationActivity.ts b/src/api/mall/promotion/combination/combinationActivity.ts index 062db5c2..f0d2e1de 100644 --- a/src/api/mall/promotion/combination/combinationActivity.ts +++ b/src/api/mall/promotion/combination/combinationActivity.ts @@ -1,66 +1,74 @@ import request from '@/config/axios' -import { Sku, Spu } from '@/api/mall/product/spu' +import {Sku, Spu} from '@/api/mall/product/spu' export interface CombinationActivityVO { - id?: number - name?: string - spuId?: number - totalLimitCount?: number - singleLimitCount?: number - startTime?: Date - endTime?: Date - userSize?: number - totalCount?: number - successCount?: number - orderUserCount?: number - virtualGroup?: number - status?: number - limitDuration?: number - products: CombinationProductVO[] + id?: number + name?: string + spuId?: number + totalLimitCount?: number + singleLimitCount?: number + startTime?: Date + endTime?: Date + userSize?: number + totalCount?: number + successCount?: number + orderUserCount?: number + virtualGroup?: number + status?: number + limitDuration?: number + products: CombinationProductVO[] + spuName?: string + picUrl?: string + marketPrice?: number } // 拼团活动所需属性 export interface CombinationProductVO { - spuId: number - skuId: number - combinationPrice: number // 拼团价格 + spuId: number + skuId: number + combinationPrice: number // 拼团价格 } // 扩展 Sku 配置 export type SkuExtension = Sku & { - productConfig: CombinationProductVO + productConfig: CombinationProductVO } export interface SpuExtension extends Spu { - skus: SkuExtension[] // 重写类型 + skus: SkuExtension[] // 重写类型 } // 查询拼团活动列表 export const getCombinationActivityPage = async (params) => { - return await request.get({ url: '/promotion/combination-activity/page', params }) + return await request.get({url: '/promotion/combination-activity/page', params}) } // 查询拼团活动详情 export const getCombinationActivity = async (id: number) => { - return await request.get({ url: '/promotion/combination-activity/get?id=' + id }) + return await request.get({url: '/promotion/combination-activity/get?id=' + id}) +} + +// 查询拼团活动详情列表 +export const getCombinationActivityDetailList = (ids: number[]) => { + return request.get({url: `/promotion/combination-activity/list?combinationActivityIds=${ids}`}) } // 新增拼团活动 export const createCombinationActivity = async (data: CombinationActivityVO) => { - return await request.post({ url: '/promotion/combination-activity/create', data }) + return await request.post({url: '/promotion/combination-activity/create', data}) } // 修改拼团活动 export const updateCombinationActivity = async (data: CombinationActivityVO) => { - return await request.put({ url: '/promotion/combination-activity/update', data }) + return await request.put({url: '/promotion/combination-activity/update', data}) } // 关闭拼团活动 export const closeCombinationActivity = async (id: number) => { - return await request.put({ url: '/promotion/combination-activity/close?id=' + id }) + return await request.put({url: '/promotion/combination-activity/close?id=' + id}) } // 删除拼团活动 export const deleteCombinationActivity = async (id: number) => { - return await request.delete({ url: '/promotion/combination-activity/delete?id=' + id }) + return await request.delete({url: '/promotion/combination-activity/delete?id=' + id}) } diff --git a/src/components/DiyEditor/components/ComponentContainer.vue b/src/components/DiyEditor/components/ComponentContainer.vue index 48567224..2aa768fe 100644 --- a/src/components/DiyEditor/components/ComponentContainer.vue +++ b/src/components/DiyEditor/components/ComponentContainer.vue @@ -5,7 +5,7 @@ ...style }" > - +
diff --git a/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts b/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts index 0c7e9ff7..5a675d5a 100644 --- a/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts +++ b/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts @@ -1,64 +1,96 @@ -import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' +import {ComponentStyle, DiyComponent} from '@/components/DiyEditor/util' /** 拼团属性 */ export interface PromotionCombinationProperty { - // 布局类型:单列 | 三列 - layoutType: 'oneCol' | 'threeCol' - // 商品字段 - fields: { - // 商品名称 - name: PromotionCombinationFieldProperty - // 商品价格 - price: PromotionCombinationFieldProperty - } - // 角标 - badge: { - // 是否显示 - show: boolean - // 角标图片 - imgUrl: string - } - // 上圆角 - borderRadiusTop: number - // 下圆角 - borderRadiusBottom: number - // 间距 - space: number - // 拼团活动编号 - activityId: number - // 组件样式 - style: ComponentStyle + // 布局类型:单列 | 三列 + layoutType: 'oneColBigImg' | 'oneColSmallImg' | 'twoCol'; + // 商品字段 + fields: { + // 商品名称 + name: PromotionCombinationFieldProperty + // 商品简介 + introduction: PromotionCombinationFieldProperty + // 商品价格 + price: PromotionCombinationFieldProperty + // 市场价 + marketPrice: PromotionCombinationFieldProperty + // 商品销量 + salesCount: PromotionCombinationFieldProperty + // 商品库存 + stock: PromotionCombinationFieldProperty + } + // 角标 + badge: { + // 是否显示 + show: boolean + // 角标图片 + imgUrl: string + } + // 按钮 + btnBuy: { + // 类型:文字 | 图片 + type: 'text' | 'img' + // 文字 + text: string + // 文字按钮:背景渐变起始颜色 + bgBeginColor: string + // 文字按钮:背景渐变结束颜色 + bgEndColor: string + // 图片按钮:图片地址 + imgUrl: string + } + // 上圆角 + borderRadiusTop: number + // 下圆角 + borderRadiusBottom: number + // 间距 + space: number + // 拼团活动编号 + activityIds: number[] + // 组件样式 + style: ComponentStyle } // 商品字段 export interface PromotionCombinationFieldProperty { - // 是否显示 - show: boolean - // 颜色 - color: string + // 是否显示 + show: boolean + // 颜色 + color: string } // 定义组件 export const component = { - id: 'PromotionCombination', - name: '拼团', - icon: 'mdi:account-group', - property: { - 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 - } + id: 'PromotionCombination', + name: '拼团', + icon: 'mdi:account-group', + property: { + layoutType: 'oneColSmallImg', + 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 diff --git a/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue b/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue index 41f1f9d7..45e8b5a4 100644 --- a/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue +++ b/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue @@ -1,135 +1,210 @@ diff --git a/src/components/DiyEditor/components/mobile/PromotionCombination/property.vue b/src/components/DiyEditor/components/mobile/PromotionCombination/property.vue index bfddb52d..afe09552 100644 --- a/src/components/DiyEditor/components/mobile/PromotionCombination/property.vue +++ b/src/components/DiyEditor/components/mobile/PromotionCombination/property.vue @@ -2,84 +2,135 @@ - - - - - + - - - + + + - + + + + + + + + + + +
- - + + +
+
+ +
+ +
- - + + +
+
+ +
+ + +
+
+ +
+ + +
+
+ +
+ +
- + - + + + + + 文字 + 图片 + + + + + @@ -88,24 +139,26 @@ diff --git a/src/views/mall/promotion/combination/components/CombinationShowcase.vue b/src/views/mall/promotion/combination/components/CombinationShowcase.vue new file mode 100644 index 00000000..4ea6928a --- /dev/null +++ b/src/views/mall/promotion/combination/components/CombinationShowcase.vue @@ -0,0 +1,147 @@ + + + + diff --git a/src/views/mall/promotion/combination/components/CombinationTableSelect.vue b/src/views/mall/promotion/combination/components/CombinationTableSelect.vue new file mode 100644 index 00000000..6c8fc1d4 --- /dev/null +++ b/src/views/mall/promotion/combination/components/CombinationTableSelect.vue @@ -0,0 +1,332 @@ + + + From 19789fabf548b2a1d57d537beca9cacc6be3c55d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Wed, 4 Sep 2024 10:39:57 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91=E6=8B=BC=E5=9B=A2=E5=8D=A1=E7=89=87=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/mobile/PromotionCombination/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue b/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue index 45e8b5a4..87c7423e 100644 --- a/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue +++ b/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue @@ -120,8 +120,8 @@ import * as ProductSpuApi from '@/api/mall/product/spu' import * as CombinationActivityApi from '@/api/mall/promotion/combination/combinationActivity' import {fenToYuan} from "@/utils"; -/** 商品卡片 */ -defineOptions({name: 'ProductCard'}) +/** 拼团卡片 */ +defineOptions({name: 'PromotionCombination'}) // 定义属性 // 定义属性 const props = defineProps<{ property: PromotionCombinationProperty }>(); From 757f10cbe6cc54d85e5ad5d737e84afeec5be940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Wed, 4 Sep 2024 17:40:10 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91=E7=8E=B0=E5=9C=A8=E6=AF=8F=E6=AC=A1=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6=E9=83=BD=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E5=8F=B3=E4=BE=A7=E5=B1=9E=E6=80=A7=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DiyEditor/components/ComponentContainer.vue | 2 +- src/components/DiyEditor/index.vue | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/DiyEditor/components/ComponentContainer.vue b/src/components/DiyEditor/components/ComponentContainer.vue index 2aa768fe..48567224 100644 --- a/src/components/DiyEditor/components/ComponentContainer.vue +++ b/src/components/DiyEditor/components/ComponentContainer.vue @@ -5,7 +5,7 @@ ...style }" > - +
diff --git a/src/components/DiyEditor/index.vue b/src/components/DiyEditor/index.vue index 700d32bd..d9fed0d2 100644 --- a/src/components/DiyEditor/index.vue +++ b/src/components/DiyEditor/index.vue @@ -151,8 +151,9 @@ class="m-[calc(0px-var(--el-card-padding))]" view-class="p-[var(--el-card-padding)] p-b-[calc(var(--el-card-padding)+var(--el-card-padding))] property" > + From 10c95406d82f3daeabaf9126305e008c608cdefc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Wed, 4 Sep 2024 22:58:16 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/promotion/combination/combinationActivity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/mall/promotion/combination/combinationActivity.ts b/src/api/mall/promotion/combination/combinationActivity.ts index f0d2e1de..483d6f07 100644 --- a/src/api/mall/promotion/combination/combinationActivity.ts +++ b/src/api/mall/promotion/combination/combinationActivity.ts @@ -50,7 +50,7 @@ export const getCombinationActivity = async (id: number) => { // 查询拼团活动详情列表 export const getCombinationActivityDetailList = (ids: number[]) => { - return request.get({url: `/promotion/combination-activity/list?combinationActivityIds=${ids}`}) + return request.get({url: `/promotion/combination-activity/detail-list?ids=${ids}`}) } // 新增拼团活动 From 03356576b3c9d981c8f4935f9399327b882448f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Wed, 4 Sep 2024 23:08:01 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91=E6=8B=BC=E5=9B=A2=E7=BB=84=E4=BB=B6=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=B8=BA=E5=8D=95=E5=88=97=E5=A4=A7=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DiyEditor/components/mobile/PromotionCombination/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts b/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts index 5a675d5a..ce51960a 100644 --- a/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts +++ b/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts @@ -65,7 +65,7 @@ export const component = { name: '拼团', icon: 'mdi:account-group', property: { - layoutType: 'oneColSmallImg', + layoutType: 'oneColBigImg', fields: { name: {show: true, color: '#000'}, introduction: {show: true, color: '#999'}, From 40fe63a3fbbfd33d779b6d4cc01993024e668edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Thu, 5 Sep 2024 10:55:57 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91=E6=8B=BC=E5=9B=A2=E6=B4=BB=E5=8A=A8=E5=92=8C?= =?UTF-8?q?SPU=E8=AF=A6=E6=83=85=E5=88=86=E5=BC=80=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/mobile/PromotionCombination/index.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue b/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue index 87c7423e..99d4e583 100644 --- a/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue +++ b/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue @@ -123,7 +123,6 @@ import {fenToYuan} from "@/utils"; /** 拼团卡片 */ defineOptions({name: 'PromotionCombination'}) // 定义属性 -// 定义属性 const props = defineProps<{ property: PromotionCombinationProperty }>(); // 商品列表 const spuList = ref([]); @@ -150,13 +149,12 @@ watch( .map(activity => activity.spuId) .filter((spuId): spuId is number => typeof spuId === 'number'); - // 如果有有效的 spuId,调用 API 获取详细信息 + // 如果存在有效的 spuId,调用 API 获取详细信息 if (spuIdList.value.length > 0) { spuList.value = await ProductSpuApi.getSpuDetailList(spuIdList.value); } else { console.warn('没有用于获取详细信息的有效 spuId。'); } - // 更新 SPU 的最低价格 combinationActivityList.value.forEach(activity => { activity.products.forEach(product => { From 4870231b61546fec9c2374d0148a96c8d1fc6871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Thu, 5 Sep 2024 12:46:58 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combination/combinationActivity.ts | 62 +++---- .../mobile/PromotionCombination/config.ts | 168 +++++++++--------- .../mobile/PromotionCombination/index.vue | 161 +++++++++-------- .../mobile/PromotionCombination/property.vue | 92 +++++----- src/components/DiyEditor/index.vue | 6 +- .../components/CombinationShowcase.vue | 89 ++++++---- .../components/CombinationTableSelect.vue | 143 ++++++++------- 7 files changed, 376 insertions(+), 345 deletions(-) diff --git a/src/api/mall/promotion/combination/combinationActivity.ts b/src/api/mall/promotion/combination/combinationActivity.ts index 483d6f07..a6c9aaa9 100644 --- a/src/api/mall/promotion/combination/combinationActivity.ts +++ b/src/api/mall/promotion/combination/combinationActivity.ts @@ -1,74 +1,74 @@ import request from '@/config/axios' -import {Sku, Spu} from '@/api/mall/product/spu' +import { Sku, Spu } from '@/api/mall/product/spu' export interface CombinationActivityVO { - id?: number - name?: string - spuId?: number - totalLimitCount?: number - singleLimitCount?: number - startTime?: Date - endTime?: Date - userSize?: number - totalCount?: number - successCount?: number - orderUserCount?: number - virtualGroup?: number - status?: number - limitDuration?: number - products: CombinationProductVO[] - spuName?: string - picUrl?: string - marketPrice?: number + id?: number + name?: string + spuId?: number + totalLimitCount?: number + singleLimitCount?: number + startTime?: Date + endTime?: Date + userSize?: number + totalCount?: number + successCount?: number + orderUserCount?: number + virtualGroup?: number + status?: number + limitDuration?: number + products: CombinationProductVO[] + spuName?: string + picUrl?: string + marketPrice?: number } // 拼团活动所需属性 export interface CombinationProductVO { - spuId: number - skuId: number - combinationPrice: number // 拼团价格 + spuId: number + skuId: number + combinationPrice: number // 拼团价格 } // 扩展 Sku 配置 export type SkuExtension = Sku & { - productConfig: CombinationProductVO + productConfig: CombinationProductVO } export interface SpuExtension extends Spu { - skus: SkuExtension[] // 重写类型 + skus: SkuExtension[] // 重写类型 } // 查询拼团活动列表 export const getCombinationActivityPage = async (params) => { - return await request.get({url: '/promotion/combination-activity/page', params}) + return await request.get({ url: '/promotion/combination-activity/page', params }) } // 查询拼团活动详情 export const getCombinationActivity = async (id: number) => { - return await request.get({url: '/promotion/combination-activity/get?id=' + id}) + return await request.get({ url: '/promotion/combination-activity/get?id=' + id }) } // 查询拼团活动详情列表 export const getCombinationActivityDetailList = (ids: number[]) => { - return request.get({url: `/promotion/combination-activity/detail-list?ids=${ids}`}) + return request.get({ url: `/promotion/combination-activity/detail-list?ids=${ids}` }) } // 新增拼团活动 export const createCombinationActivity = async (data: CombinationActivityVO) => { - return await request.post({url: '/promotion/combination-activity/create', data}) + return await request.post({ url: '/promotion/combination-activity/create', data }) } // 修改拼团活动 export const updateCombinationActivity = async (data: CombinationActivityVO) => { - return await request.put({url: '/promotion/combination-activity/update', data}) + return await request.put({ url: '/promotion/combination-activity/update', data }) } // 关闭拼团活动 export const closeCombinationActivity = async (id: number) => { - return await request.put({url: '/promotion/combination-activity/close?id=' + id}) + return await request.put({ url: '/promotion/combination-activity/close?id=' + id }) } // 删除拼团活动 export const deleteCombinationActivity = async (id: number) => { - return await request.delete({url: '/promotion/combination-activity/delete?id=' + id}) + return await request.delete({ url: '/promotion/combination-activity/delete?id=' + id }) } diff --git a/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts b/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts index ce51960a..f4fdf6e8 100644 --- a/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts +++ b/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts @@ -1,96 +1,96 @@ -import {ComponentStyle, DiyComponent} from '@/components/DiyEditor/util' +import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' /** 拼团属性 */ export interface PromotionCombinationProperty { - // 布局类型:单列 | 三列 - layoutType: 'oneColBigImg' | 'oneColSmallImg' | 'twoCol'; - // 商品字段 - fields: { - // 商品名称 - name: PromotionCombinationFieldProperty - // 商品简介 - introduction: PromotionCombinationFieldProperty - // 商品价格 - price: PromotionCombinationFieldProperty - // 市场价 - marketPrice: PromotionCombinationFieldProperty - // 商品销量 - salesCount: PromotionCombinationFieldProperty - // 商品库存 - stock: PromotionCombinationFieldProperty - } - // 角标 - badge: { - // 是否显示 - show: boolean - // 角标图片 - imgUrl: string - } - // 按钮 - btnBuy: { - // 类型:文字 | 图片 - type: 'text' | 'img' - // 文字 - text: string - // 文字按钮:背景渐变起始颜色 - bgBeginColor: string - // 文字按钮:背景渐变结束颜色 - bgEndColor: string - // 图片按钮:图片地址 - imgUrl: string - } - // 上圆角 - borderRadiusTop: number - // 下圆角 - borderRadiusBottom: number - // 间距 - space: number - // 拼团活动编号 - activityIds: number[] - // 组件样式 - style: ComponentStyle + // 布局类型:单列 | 三列 + layoutType: 'oneColBigImg' | 'oneColSmallImg' | 'twoCol' + // 商品字段 + fields: { + // 商品名称 + name: PromotionCombinationFieldProperty + // 商品简介 + introduction: PromotionCombinationFieldProperty + // 商品价格 + price: PromotionCombinationFieldProperty + // 市场价 + marketPrice: PromotionCombinationFieldProperty + // 商品销量 + salesCount: PromotionCombinationFieldProperty + // 商品库存 + stock: PromotionCombinationFieldProperty + } + // 角标 + badge: { + // 是否显示 + show: boolean + // 角标图片 + imgUrl: string + } + // 按钮 + btnBuy: { + // 类型:文字 | 图片 + type: 'text' | 'img' + // 文字 + text: string + // 文字按钮:背景渐变起始颜色 + bgBeginColor: string + // 文字按钮:背景渐变结束颜色 + bgEndColor: string + // 图片按钮:图片地址 + imgUrl: string + } + // 上圆角 + borderRadiusTop: number + // 下圆角 + borderRadiusBottom: number + // 间距 + space: number + // 拼团活动编号 + activityIds: number[] + // 组件样式 + style: ComponentStyle } // 商品字段 export interface PromotionCombinationFieldProperty { - // 是否显示 - show: boolean - // 颜色 - color: string + // 是否显示 + 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 - } + 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 diff --git a/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue b/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue index 99d4e583..dfb16672 100644 --- a/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue +++ b/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue @@ -1,8 +1,8 @@ diff --git a/src/components/DiyEditor/components/mobile/PromotionCombination/property.vue b/src/components/DiyEditor/components/mobile/PromotionCombination/property.vue index afe09552..6c551ad9 100644 --- a/src/components/DiyEditor/components/mobile/PromotionCombination/property.vue +++ b/src/components/DiyEditor/components/mobile/PromotionCombination/property.vue @@ -2,24 +2,24 @@ - + - + - + - + diff --git a/src/views/mall/promotion/combination/components/CombinationShowcase.vue b/src/views/mall/promotion/combination/components/CombinationShowcase.vue index 4ea6928a..8e8e107f 100644 --- a/src/views/mall/promotion/combination/components/CombinationShowcase.vue +++ b/src/views/mall/promotion/combination/components/CombinationShowcase.vue @@ -1,41 +1,45 @@