From d5f1e504955bd6e9a52eee7aee545a0acae7fc96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Sun, 8 Sep 2024 11:15:53 +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=E5=95=86=E5=9F=8E=EF=BC=9A=E7=A7=92=E6=9D=80=E8=A3=85?= =?UTF-8?q?=E4=BF=AE=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/promotion/seckill/seckillActivity.ts | 6 + .../mobile/PromotionSeckill/config.ts | 42 ++- .../mobile/PromotionSeckill/index.vue | 256 ++++++++----- .../mobile/PromotionSeckill/property.vue | 84 ++++- .../seckill/components/SeckillShowcase.vue | 156 ++++++++ .../seckill/components/SeckillTableSelect.vue | 343 ++++++++++++++++++ 6 files changed, 771 insertions(+), 116 deletions(-) create mode 100644 src/views/mall/promotion/seckill/components/SeckillShowcase.vue create mode 100644 src/views/mall/promotion/seckill/components/SeckillTableSelect.vue diff --git a/src/api/mall/promotion/seckill/seckillActivity.ts b/src/api/mall/promotion/seckill/seckillActivity.ts index 4bb0e8b1..795a25b8 100644 --- a/src/api/mall/promotion/seckill/seckillActivity.ts +++ b/src/api/mall/promotion/seckill/seckillActivity.ts @@ -18,6 +18,7 @@ export interface SeckillActivityVO { singleLimitCount?: number stock?: number totalStock?: number + seckillPrice?: number products?: SeckillProductVO[] } @@ -43,6 +44,11 @@ export const getSeckillActivityPage = async (params) => { return await request.get({ url: '/promotion/seckill-activity/page', params }) } +// 查询拼团活动列表,基于活动编号数组 +export const getSeckillActivityListByIds = (ids: number[]) => { + return request.get({ url: `/promotion/seckill-activity/list-by-ids?ids=${ids}` }) +} + // 查询秒杀活动详情 export const getSeckillActivity = async (id: number) => { return await request.get({ url: '/promotion/seckill-activity/get?id=' + id }) diff --git a/src/components/DiyEditor/components/mobile/PromotionSeckill/config.ts b/src/components/DiyEditor/components/mobile/PromotionSeckill/config.ts index 800398be..022be92c 100644 --- a/src/components/DiyEditor/components/mobile/PromotionSeckill/config.ts +++ b/src/components/DiyEditor/components/mobile/PromotionSeckill/config.ts @@ -3,13 +3,21 @@ import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' /** 秒杀属性 */ export interface PromotionSeckillProperty { // 布局类型:单列 | 三列 - layoutType: 'oneCol' | 'threeCol' + layoutType: 'oneColBigImg' | 'oneColSmallImg' | 'twoCol' // 商品字段 fields: { // 商品名称 name: PromotionSeckillFieldProperty + // 商品简介 + introduction: PromotionSeckillFieldProperty // 商品价格 price: PromotionSeckillFieldProperty + // 市场价 + marketPrice: PromotionSeckillFieldProperty + // 商品销量 + salesCount: PromotionSeckillFieldProperty + // 商品库存 + stock: PromotionSeckillFieldProperty } // 角标 badge: { @@ -18,6 +26,19 @@ export interface PromotionSeckillProperty { // 角标图片 imgUrl: string } + // 按钮 + btnBuy: { + // 类型:文字 | 图片 + type: 'text' | 'img' + // 文字 + text: string + // 文字按钮:背景渐变起始颜色 + bgBeginColor: string + // 文字按钮:背景渐变结束颜色 + bgEndColor: string + // 图片按钮:图片地址 + imgUrl: string + } // 上圆角 borderRadiusTop: number // 下圆角 @@ -25,10 +46,11 @@ export interface PromotionSeckillProperty { // 间距 space: number // 秒杀活动编号 - activityId: number + activityIds: number[] // 组件样式 style: ComponentStyle } + // 商品字段 export interface PromotionSeckillFieldProperty { // 是否显示 @@ -43,13 +65,23 @@ export const component = { name: '秒杀', icon: 'mdi:calendar-time', property: { - activityId: undefined, - 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/PromotionSeckill/index.vue b/src/components/DiyEditor/components/mobile/PromotionSeckill/index.vue index fe092a03..3d34a3d4 100644 --- a/src/components/DiyEditor/components/mobile/PromotionSeckill/index.vue +++ b/src/components/DiyEditor/components/mobile/PromotionSeckill/index.vue @@ -1,135 +1,201 @@ - - + diff --git a/src/components/DiyEditor/components/mobile/PromotionSeckill/property.vue b/src/components/DiyEditor/components/mobile/PromotionSeckill/property.vue index 306ec9b9..61287590 100644 --- a/src/components/DiyEditor/components/mobile/PromotionSeckill/property.vue +++ b/src/components/DiyEditor/components/mobile/PromotionSeckill/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 SeckillActivityApi.getSeckillActivityPage({ status: CommonStatusEnum.ENABLE diff --git a/src/views/mall/promotion/seckill/components/SeckillShowcase.vue b/src/views/mall/promotion/seckill/components/SeckillShowcase.vue new file mode 100644 index 00000000..a924e8ca --- /dev/null +++ b/src/views/mall/promotion/seckill/components/SeckillShowcase.vue @@ -0,0 +1,156 @@ + + + + diff --git a/src/views/mall/promotion/seckill/components/SeckillTableSelect.vue b/src/views/mall/promotion/seckill/components/SeckillTableSelect.vue new file mode 100644 index 00000000..3e4e67e9 --- /dev/null +++ b/src/views/mall/promotion/seckill/components/SeckillTableSelect.vue @@ -0,0 +1,343 @@ + + +