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 @@