From 75135e1e4f8bc44aa9cadb81f1acce3093cf931b Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 24 Oct 2023 16:57:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=20spu=20=E8=84=B1=E7=A6=BB?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=8D=B7=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/product/spu.ts | 1 - .../product/spu/form/ActivityOrdersSort.vue | 7 ++ .../product/spu/form/OtherSettingsForm.vue | 95 ++++++++++------ src/views/mall/product/spu/form/index.vue | 3 +- src/views/mall/product/spu/form/spu.data.ts | 4 - .../coupon/components}/CouponSelect.vue | 0 .../mall/promotion/coupon/components/index.ts | 4 + src/views/member/user/index.vue | 107 ++++++++++-------- 8 files changed, 131 insertions(+), 90 deletions(-) rename src/views/mall/{product/spu/form => promotion/coupon/components}/CouponSelect.vue (100%) create mode 100644 src/views/mall/promotion/coupon/components/index.ts diff --git a/src/api/mall/product/spu.ts b/src/api/mall/product/spu.ts index 0d0d5b00..8ccd02a5 100644 --- a/src/api/mall/product/spu.ts +++ b/src/api/mall/product/spu.ts @@ -61,7 +61,6 @@ export interface Spu { createTime?: Date // 商品创建时间 status?: number // 商品状态 activityOrders: number[] // 活动排序 - giveCouponTemplates: GiveCouponTemplate[] // 优惠卷 } // 获得 Spu 列表 diff --git a/src/views/mall/product/spu/form/ActivityOrdersSort.vue b/src/views/mall/product/spu/form/ActivityOrdersSort.vue index eb524860..3a41b3c5 100644 --- a/src/views/mall/product/spu/form/ActivityOrdersSort.vue +++ b/src/views/mall/product/spu/form/ActivityOrdersSort.vue @@ -54,6 +54,13 @@ const initSortable = () => { } onMounted(async () => { await nextTick() + // 如果活动排序为空也就是新增的时候加入活动 + if (props.activityOrders && props.activityOrders.length === 0) { + emit( + 'update:activityOrders', + props.promotionTypes.map((item) => item.value as number) + ) + } initSortable() }) diff --git a/src/views/mall/product/spu/form/OtherSettingsForm.vue b/src/views/mall/product/spu/form/OtherSettingsForm.vue index 42e61ba1..d574ae78 100644 --- a/src/views/mall/product/spu/form/OtherSettingsForm.vue +++ b/src/views/mall/product/spu/form/OtherSettingsForm.vue @@ -42,25 +42,12 @@ - - - - - {{ coupon.name }} - - 选择优惠券 - - @@ -91,17 +78,7 @@ {{ promotionTypes.find((item) => item.value === activityType)?.label }} - -