From 18df708b49ca43690622ecb12aead6d3b59e1b1d Mon Sep 17 00:00:00 2001 From: puhui999 Date: Fri, 20 Oct 2023 11:48:59 +0800 Subject: [PATCH] =?UTF-8?q?SPU:=20=E5=AE=8C=E5=96=84=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=8D=B7=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/product/spu.ts | 6 +++++ .../mall/product/spu/form/CouponSelect.vue | 9 +++++--- .../product/spu/form/OtherSettingsForm.vue | 22 +++++++++++-------- src/views/mall/product/spu/form/index.vue | 11 +++++----- src/views/mall/product/spu/form/spu.data.ts | 2 +- 5 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/api/mall/product/spu.ts b/src/api/mall/product/spu.ts index b38beda9..d5251630 100644 --- a/src/api/mall/product/spu.ts +++ b/src/api/mall/product/spu.ts @@ -25,6 +25,11 @@ export interface Sku { salesCount?: number // 商品销量 } +export interface GiveCouponTemplate { + id?: number + name?: string // 优惠券名称 +} + export interface Spu { id?: number name?: string // 商品名称 @@ -55,6 +60,7 @@ export interface Spu { stock?: number // 商品库存 createTime?: Date // 商品创建时间 status?: number // 商品状态 + giveCouponTemplate?: GiveCouponTemplate[] } // 获得 Spu 列表 diff --git a/src/views/mall/product/spu/form/CouponSelect.vue b/src/views/mall/product/spu/form/CouponSelect.vue index de0a2ed4..e0f32af2 100644 --- a/src/views/mall/product/spu/form/CouponSelect.vue +++ b/src/views/mall/product/spu/form/CouponSelect.vue @@ -150,14 +150,15 @@ import { } from '@/views/mall/promotion/coupon/formatter' import { dateFormatter } from '@/utils/formatTime' import * as CouponTemplateApi from '@/api/mall/promotion/coupon/couponTemplate' +import type { GiveCouponTemplate } from '@/api/mall/product/spu' defineOptions({ name: 'CouponSelect' }) defineProps<{ - multipleSelection: { id: number; name: string }[] + multipleSelection: GiveCouponTemplate[] }>() const emit = defineEmits<{ - (e: 'update:multipleSelection', v: { id: number; name: string }[]) + (e: 'update:multipleSelection', v: GiveCouponTemplate[]) }>() const dialogVisible = ref(false) // 弹窗的是否展示 const dialogTitle = ref('选择优惠卷') // 弹窗的标题 @@ -212,6 +213,8 @@ const handleSelectionChange = (val: CouponTemplateApi.CouponTemplateVO[]) => { val.map((item) => ({ id: item.id, name: item.name })) ) } -const submitForm = async () => {} +const submitForm = () => { + dialogVisible.value = false +} diff --git a/src/views/mall/product/spu/form/OtherSettingsForm.vue b/src/views/mall/product/spu/form/OtherSettingsForm.vue index 0576427d..033806b6 100644 --- a/src/views/mall/product/spu/form/OtherSettingsForm.vue +++ b/src/views/mall/product/spu/form/OtherSettingsForm.vue @@ -82,16 +82,15 @@ {{ row.recommendGood ? '是' : '否' }} - +