diff --git a/src/api/mall/promotion/combination/combinationActivity.ts b/src/api/mall/promotion/combination/combinationActivity.ts index 062db5c2..b3e70154 100644 --- a/src/api/mall/promotion/combination/combinationActivity.ts +++ b/src/api/mall/promotion/combination/combinationActivity.ts @@ -17,6 +17,9 @@ export interface CombinationActivityVO { status?: number limitDuration?: number products: CombinationProductVO[] + spuName?: string + picUrl?: string + marketPrice?: number } // 拼团活动所需属性 @@ -45,6 +48,11 @@ export const getCombinationActivity = async (id: number) => { return await request.get({ url: '/promotion/combination-activity/get?id=' + id }) } +// 查询拼团活动详情列表 +export const getCombinationActivityDetailList = (ids: number[]) => { + return request.get({ url: `/promotion/combination-activity/list-by-ids?ids=${ids}` }) +} + // 新增拼团活动 export const createCombinationActivity = async (data: CombinationActivityVO) => { return await request.post({ url: '/promotion/combination-activity/create', data }) diff --git a/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts b/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts index 0c7e9ff7..f4fdf6e8 100644 --- a/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts +++ b/src/components/DiyEditor/components/mobile/PromotionCombination/config.ts @@ -3,13 +3,21 @@ import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' /** 拼团属性 */ export interface PromotionCombinationProperty { // 布局类型:单列 | 三列 - layoutType: 'oneCol' | 'threeCol' + layoutType: 'oneColBigImg' | 'oneColSmallImg' | 'twoCol' // 商品字段 fields: { // 商品名称 name: PromotionCombinationFieldProperty + // 商品简介 + introduction: PromotionCombinationFieldProperty // 商品价格 price: PromotionCombinationFieldProperty + // 市场价 + marketPrice: PromotionCombinationFieldProperty + // 商品销量 + salesCount: PromotionCombinationFieldProperty + // 商品库存 + stock: PromotionCombinationFieldProperty } // 角标 badge: { @@ -18,6 +26,19 @@ export interface PromotionCombinationProperty { // 角标图片 imgUrl: string } + // 按钮 + btnBuy: { + // 类型:文字 | 图片 + type: 'text' | 'img' + // 文字 + text: string + // 文字按钮:背景渐变起始颜色 + bgBeginColor: string + // 文字按钮:背景渐变结束颜色 + bgEndColor: string + // 图片按钮:图片地址 + imgUrl: string + } // 上圆角 borderRadiusTop: number // 下圆角 @@ -25,7 +46,7 @@ export interface PromotionCombinationProperty { // 间距 space: number // 拼团活动编号 - activityId: number + activityIds: number[] // 组件样式 style: ComponentStyle } @@ -44,12 +65,23 @@ export const component = { name: '拼团', icon: 'mdi:account-group', property: { - layoutType: 'oneCol', + layoutType: 'oneColBigImg', fields: { name: { show: true, color: '#000' }, - price: { show: true, color: '#ff3000' } + 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, diff --git a/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue b/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue index 41f1f9d7..1bd182ec 100644 --- a/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue +++ b/src/components/DiyEditor/components/mobile/PromotionCombination/index.vue @@ -1,135 +1,212 @@ diff --git a/src/components/DiyEditor/components/mobile/PromotionCombination/property.vue b/src/components/DiyEditor/components/mobile/PromotionCombination/property.vue index bfddb52d..6c551ad9 100644 --- a/src/components/DiyEditor/components/mobile/PromotionCombination/property.vue +++ b/src/components/DiyEditor/components/mobile/PromotionCombination/property.vue @@ -2,30 +2,31 @@ - - - - - + - - + + - + + + + + + + + + + + @@ -34,12 +35,36 @@ + +
+ + +
+
+ +
+ + +
+
+ +
+ + +
+
+ +
+ + +
+
@@ -47,10 +72,36 @@ - + + + + + 文字 + 图片 + + + + + () const emit = defineEmits(['update:modelValue']) const { formData } = usePropertyForm(props.modelValue, emit) // 活动列表 -const activityList = ref([]) +const activityList = ref([]) onMounted(async () => { const { list } = await CombinationActivityApi.getCombinationActivityPage({ status: CommonStatusEnum.ENABLE }) activityList.value = list + console.log('formDa', props) }) diff --git a/src/components/DiyEditor/index.vue b/src/components/DiyEditor/index.vue index 700d32bd..8504f3e1 100644 --- a/src/components/DiyEditor/index.vue +++ b/src/components/DiyEditor/index.vue @@ -151,8 +151,13 @@ 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" > + 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..8e8e107f --- /dev/null +++ b/src/views/mall/promotion/combination/components/CombinationShowcase.vue @@ -0,0 +1,158 @@ + + + + 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..36395214 --- /dev/null +++ b/src/views/mall/promotion/combination/components/CombinationTableSelect.vue @@ -0,0 +1,345 @@ + + +