From 70c2fe409c633926d71a44e0b49dd740496d619c Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 24 Jun 2023 01:48:07 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=AE=8C=E5=96=84=E7=A7=92?= =?UTF-8?q?=E6=9D=80=E6=B4=BB=E5=8A=A8=E7=AE=A1=E7=90=86=E2=91=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit b1e7f149638243885ae97f6c31f5df24d9b6ffa2) --- src/api/mall/product/spu.ts | 10 ++ .../mall/promotion/seckill/seckillActivity.ts | 19 ++- .../mall/product/spu/components/SkuList.vue | 87 +++++++++- .../mall/product/spu/components/index.ts | 44 ++++- .../seckill/activity/SeckillActivityForm.vue | 50 +----- .../activity/components/SpuAndSkuList.vue | 157 ++++++++++++++++++ .../components/SpuAndSkuSelectForm.vue | 32 +--- .../seckill/activity/components/index.ts | 3 +- 8 files changed, 327 insertions(+), 75 deletions(-) create mode 100644 src/views/mall/promotion/seckill/activity/components/SpuAndSkuList.vue diff --git a/src/api/mall/product/spu.ts b/src/api/mall/product/spu.ts index 3f583a03..954c7d41 100644 --- a/src/api/mall/product/spu.ts +++ b/src/api/mall/product/spu.ts @@ -49,6 +49,16 @@ export interface Spu { recommendGood?: boolean // 是否优品 } +export interface SpuRespVO extends Spu { + price: number + salesCount: number + marketPrice: number + costPrice: number + stock: number + createTime: Date + status: number +} + // 获得 Spu 列表 export const getSpuPage = (params: PageParam) => { return request.get({ url: '/product/spu/page', params }) diff --git a/src/api/mall/promotion/seckill/seckillActivity.ts b/src/api/mall/promotion/seckill/seckillActivity.ts index 2c59319c..fc2d1871 100644 --- a/src/api/mall/promotion/seckill/seckillActivity.ts +++ b/src/api/mall/promotion/seckill/seckillActivity.ts @@ -1,8 +1,9 @@ import request from '@/config/axios' +import { Sku, SpuRespVO } from '@/api/mall/product/spu' export interface SeckillActivityVO { id: number - spuId: number + spuIds: number[] name: string status: number remark: string @@ -17,6 +18,22 @@ export interface SeckillActivityVO { singleLimitCount: number stock: number totalStock: number + products: SeckillProductVO[] +} + +export interface SeckillProductVO { + spuId: number + skuId: number + seckillPrice: number + stock: number +} + +type SkuExtension = Sku & { + productConfig: SeckillProductVO +} + +export interface SpuExtension extends SpuRespVO { + skus: SkuExtension[] // 重写类型 } // 查询秒杀活动列表 diff --git a/src/views/mall/product/spu/components/SkuList.vue b/src/views/mall/product/spu/components/SkuList.vue index faad3b17..da263686 100644 --- a/src/views/mall/product/spu/components/SkuList.vue +++ b/src/views/mall/product/spu/components/SkuList.vue @@ -1,7 +1,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/mall/promotion/seckill/activity/components/SpuAndSkuSelectForm.vue b/src/views/mall/promotion/seckill/activity/components/SpuAndSkuSelectForm.vue index cf538fc2..c3de9a2b 100644 --- a/src/views/mall/promotion/seckill/activity/components/SpuAndSkuSelectForm.vue +++ b/src/views/mall/promotion/seckill/activity/components/SpuAndSkuSelectForm.vue @@ -51,7 +51,7 @@ :data="list" :expand-row-keys="expandRowKeys" row-key="id" - @expandChange="getPropertyList" + @expand-change="expandChange" @selection-change="selectSpu" > @@ -111,7 +111,7 @@