From f122c0c509aaf5a2972a52a5676fe49297e790cd Mon Sep 17 00:00:00 2001 From: luowenfeng <1092164058@qq.com> Date: Wed, 21 Sep 2022 10:42:07 +0800 Subject: [PATCH] =?UTF-8?q?feature(=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0):?= =?UTF-8?q?=20=E5=95=86=E5=93=81=E6=B7=BB=E5=8A=A0=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/VideoUpload/index.vue | 211 ++++++++++++++++++ .../src/views/mall/product/spu/save.vue | 39 +++- 2 files changed, 240 insertions(+), 10 deletions(-) create mode 100644 yudao-ui-admin/src/components/VideoUpload/index.vue diff --git a/yudao-ui-admin/src/components/VideoUpload/index.vue b/yudao-ui-admin/src/components/VideoUpload/index.vue new file mode 100644 index 000000000..4809e1237 --- /dev/null +++ b/yudao-ui-admin/src/components/VideoUpload/index.vue @@ -0,0 +1,211 @@ + + + + + + diff --git a/yudao-ui-admin/src/views/mall/product/spu/save.vue b/yudao-ui-admin/src/views/mall/product/spu/save.vue index b32a1e12f..e95eb356b 100644 --- a/yudao-ui-admin/src/views/mall/product/spu/save.vue +++ b/yudao-ui-admin/src/views/mall/product/spu/save.vue @@ -10,11 +10,13 @@ - - + - + + + + @@ -37,7 +39,6 @@ - @@ -149,7 +150,7 @@ - + @@ -196,11 +197,13 @@ import {createSpu, updateSpu, getSpuDetail} from "@/api/mall/product/spu"; import {getPropertyListAndValue,} from "@/api/mall/product/property"; import Editor from "@/components/Editor"; import ImageUpload from "@/components/ImageUpload"; +import VideoUpload from "@/components/VideoUpload"; export default { components: { Editor, - ImageUpload + ImageUpload, + VideoUpload }, props:{ obj: Object @@ -223,11 +226,13 @@ export default { sort: null, description: null, picUrls: null, + videoUrl: null, status: 0, virtualSalesCount: 0, showStock: true, - brandId: null + brandId: null, }, + categoryList: [], // 价格库存 ratesForm: { @@ -255,8 +260,8 @@ export default { description: [{required: true, message: "描述不能为空", trigger: "blur"},], categoryIds: [{required: true, message: "分类id不能为空", trigger: "blur"},], status: [{required: true, message: "商品状态不能为空", trigger: "blur"}], + brandId: [{required: true, message: "商品品牌不能为空", trigger: "blur"}], picUrls: [{required: true, message: "商品轮播图地址不能为空", trigger: "blur"}], - virtualSalesCount: [{required: true, message: "虚拟销量不能为空", trigger: "blur"}], }, }; }, @@ -379,7 +384,6 @@ export default { rates[0].status = this.baseForm.status; } let form = this.baseForm - if(form.picUrls instanceof Array){ form.picUrls = form.picUrls.flatMap(m=>m.split(',')) }else if(form.picUrls.split(',') instanceof Array){ @@ -428,6 +432,7 @@ export default { this.baseForm.name=data.name; this.baseForm.sellPoint=data.sellPoint; this.baseForm.categoryIds=data.categoryIds; + this.baseForm.videoUrl = data.videoUrl; this.baseForm.sort=data.sort; this.baseForm.description=data.description; this.baseForm.picUrls=data.picUrls; @@ -460,7 +465,8 @@ export default { } this.ratesForm.rates=data.skus }) - } + }, + }, }; @@ -550,4 +556,17 @@ export default { margin-left: 15px; } } + +.mall-image{ + .el-upload--picture-card{ + width: 80px; + height: 80px; + line-height: 90px; + } + .el-upload-list__item{ + width: 80px; + height: 80px; + } +} +