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 @@ + + + + + + + + + + + + + + + + + + + + + + + 请上传 + 大小不超过 {{ fileSize }}MB + 格式为 {{ fileType.join("/") }} + 的文件 + + + + + + + + + + + + + + + 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; + } +} +