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] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E9=87=8D=E6=9E=84=E6=8B=BC=E5=9B=A2=E8=A3=85=E4=BF=AE?= =?UTF-8?q?=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 @@ + + +