From 3d47d6744e0dd78d4df350c5eb6421dba889f8af Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 22 Jun 2023 17:31:36 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=B7=BB=E5=8A=A0=E7=A7=92?= =?UTF-8?q?=E6=9D=80=E6=B4=BB=E5=8A=A8=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/promotion/seckill/seckillActivity.ts | 50 +++ .../mall/promotion/seckill/seckillConfig.ts | 5 + .../mall/product/spu/components/SkuList.vue | 16 +- src/views/mall/product/spu/index.vue | 10 +- .../seckill/activity/SeckillActivityForm.vue | 136 ++++++++ .../components/SpuAndSkuSelectForm.vue | 290 ++++++++++++++++++ .../seckill/activity/components/index.ts | 3 + .../mall/promotion/seckill/activity/index.vue | 86 ++++++ .../seckill/activity/seckillActivity.data.ts | 261 ++++++++++++++++ 9 files changed, 848 insertions(+), 9 deletions(-) create mode 100644 src/api/mall/promotion/seckill/seckillActivity.ts create mode 100644 src/views/mall/promotion/seckill/activity/SeckillActivityForm.vue create mode 100644 src/views/mall/promotion/seckill/activity/components/SpuAndSkuSelectForm.vue create mode 100644 src/views/mall/promotion/seckill/activity/components/index.ts create mode 100644 src/views/mall/promotion/seckill/activity/index.vue create mode 100644 src/views/mall/promotion/seckill/activity/seckillActivity.data.ts diff --git a/src/api/mall/promotion/seckill/seckillActivity.ts b/src/api/mall/promotion/seckill/seckillActivity.ts new file mode 100644 index 00000000..2c59319c --- /dev/null +++ b/src/api/mall/promotion/seckill/seckillActivity.ts @@ -0,0 +1,50 @@ +import request from '@/config/axios' + +export interface SeckillActivityVO { + id: number + spuId: number + name: string + status: number + remark: string + startTime: Date + endTime: Date + sort: number + configIds: string + orderCount: number + userCount: number + totalPrice: number + totalLimitCount: number + singleLimitCount: number + stock: number + totalStock: number +} + +// 查询秒杀活动列表 +export const getSeckillActivityPage = async (params) => { + return await request.get({ url: '/promotion/seckill-activity/page', params }) +} + +// 查询秒杀活动详情 +export const getSeckillActivity = async (id: number) => { + return await request.get({ url: '/promotion/seckill-activity/get?id=' + id }) +} + +// 新增秒杀活动 +export const createSeckillActivity = async (data: SeckillActivityVO) => { + return await request.post({ url: '/promotion/seckill-activity/create', data }) +} + +// 修改秒杀活动 +export const updateSeckillActivity = async (data: SeckillActivityVO) => { + return await request.put({ url: '/promotion/seckill-activity/update', data }) +} + +// 删除秒杀活动 +export const deleteSeckillActivity = async (id: number) => { + return await request.delete({ url: '/promotion/seckill-activity/delete?id=' + id }) +} + +// 导出秒杀活动 Excel +export const exportSeckillActivityApi = async (params) => { + return await request.download({ url: '/promotion/seckill-activity/export-excel', params }) +} diff --git a/src/api/mall/promotion/seckill/seckillConfig.ts b/src/api/mall/promotion/seckill/seckillConfig.ts index fb72936b..aff72821 100644 --- a/src/api/mall/promotion/seckill/seckillConfig.ts +++ b/src/api/mall/promotion/seckill/seckillConfig.ts @@ -19,6 +19,11 @@ export const getSeckillConfig = async (id: number) => { return await request.get({ url: '/promotion/seckill-config/get?id=' + id }) } +// 获得所有开启状态的秒杀时段精简列表 +export const getListAllSimple = async () => { + return await request.get({ url: '/promotion/seckill-config/list-all-simple' }) +} + // 新增秒杀时段配置 export const createSeckillConfig = async (data: SeckillConfigVO) => { return await request.post({ url: '/promotion/seckill-config/create', data }) diff --git a/src/views/mall/product/spu/components/SkuList.vue b/src/views/mall/product/spu/components/SkuList.vue index 4114bd09..6aa26a2b 100644 --- a/src/views/mall/product/spu/components/SkuList.vue +++ b/src/views/mall/product/spu/components/SkuList.vue @@ -118,7 +118,9 @@ max-height="500" size="small" style="width: 99%" + @selection-change="handleSelectionChange" > +