Browse Source

商品详情-新增优惠介绍说明字段

Xiao_123 1 tháng trước cách đây
mục cha
commit
f1fcc72bed

+ 1 - 0
src/api/mall/product/spu.ts

@@ -42,6 +42,7 @@ export interface Spu {
   picUrl?: string // 商品封面图
   picUrl?: string // 商品封面图
   sliderPicUrls?: string[] // 商品轮播图
   sliderPicUrls?: string[] // 商品轮播图
   introduction?: string // 商品简介
   introduction?: string // 商品简介
+  activeIntroduction?: string // 优惠活动说明
   deliveryTypes?: number[] // 配送方式
   deliveryTypes?: number[] // 配送方式
   deliveryTemplateId?: number | undefined // 运费模版
   deliveryTemplateId?: number | undefined // 运费模版
   brandId?: number // 商品品牌编号
   brandId?: number // 商品品牌编号

+ 5 - 0
src/views/mall/product/spu/form/InfoForm.vue

@@ -60,6 +60,9 @@
     <el-form-item label="商品轮播图" prop="sliderPicUrls">
     <el-form-item label="商品轮播图" prop="sliderPicUrls">
       <UploadImgs v-model="formData.sliderPicUrls" :disabled="isDetail" />
       <UploadImgs v-model="formData.sliderPicUrls" :disabled="isDetail" />
     </el-form-item>
     </el-form-item>
+    <el-form-item label="优惠活动说明" prop="activeIntroduction">
+      <Editor v-model:modelValue="formData.activeIntroduction" height="150px" />
+    </el-form-item>
   </el-form>
   </el-form>
 </template>
 </template>
 
 
@@ -74,6 +77,7 @@ import { CategoryVO } from '@/api/mall/product/category'
 import * as ProductBrandApi from '@/api/mall/product/brand'
 import * as ProductBrandApi from '@/api/mall/product/brand'
 import { BrandVO } from '@/api/mall/product/brand'
 import { BrandVO } from '@/api/mall/product/brand'
 import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
 import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
+import { Editor } from '@/components/Editor'
 
 
 defineOptions({ name: 'ProductSpuInfoForm' })
 defineOptions({ name: 'ProductSpuInfoForm' })
 
 
@@ -95,6 +99,7 @@ const formData = reactive<Spu>({
   picUrl: '', // 商品封面图
   picUrl: '', // 商品封面图
   sliderPicUrls: [], // 商品轮播图
   sliderPicUrls: [], // 商品轮播图
   introduction: '', // 商品简介
   introduction: '', // 商品简介
+  activeIntroduction: undefined, // 优惠活动简介
   type: '0', // 商品类型
   type: '0', // 商品类型
   brandId: undefined // 商品品牌
   brandId: undefined // 商品品牌
 })
 })

+ 2 - 0
src/views/mall/product/spu/form/index.vue

@@ -89,6 +89,7 @@ const formData = ref<ProductSpuApi.Spu>({
   picUrl: '', // 商品封面图
   picUrl: '', // 商品封面图
   sliderPicUrls: [], // 商品轮播图
   sliderPicUrls: [], // 商品轮播图
   introduction: '', // 商品简介
   introduction: '', // 商品简介
+  activeIntroduction: undefined, // 优惠活动简介
   deliveryTypes: [], // 配送方式数组
   deliveryTypes: [], // 配送方式数组
   deliveryTemplateId: undefined, // 运费模版
   deliveryTemplateId: undefined, // 运费模版
   brandId: undefined, // 商品品牌
   brandId: undefined, // 商品品牌
@@ -148,6 +149,7 @@ const getDetail = async () => {
           item.secondBrokeragePrice = formatToFraction(item.secondBrokeragePrice)
           item.secondBrokeragePrice = formatToFraction(item.secondBrokeragePrice)
         }
         }
       })
       })
+      formLoading.value = false
       formData.value = res
       formData.value = res
     } finally {
     } finally {
       formLoading.value = false
       formLoading.value = false