diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue index 6bb5a18..fc68129 100644 --- a/src/components/Editor/index.vue +++ b/src/components/Editor/index.vue @@ -40,7 +40,7 @@ export default { /* 最小高度 */ minHeight: { type: Number, - default: null, + default: 500, }, /* 只读 */ readOnly: { @@ -60,7 +60,7 @@ export default { }, data() { return { - uploadUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址 + uploadUrl: process.env.VUE_APP_BASE_API + "/oss/upload", // 上传的图片服务器地址 headers: { Authorization: "Bearer " + getToken() }, @@ -176,7 +176,7 @@ export default { // 获取光标所在位置 let length = quill.getSelection().index; // 插入图片 res.url为服务器返回的图片地址 - quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName); + quill.insertEmbed(length, "image", res.url); // 调整光标到最后 quill.setSelection(length + 1); } else { diff --git a/src/views/pms/product/AddProduct.vue b/src/views/pms/product/AddProduct.vue index 72c81de..356bca7 100644 --- a/src/views/pms/product/AddProduct.vue +++ b/src/views/pms/product/AddProduct.vue @@ -43,7 +43,7 @@ - + @@ -71,7 +71,7 @@ - 刷新列表 + 刷新列表 @@ -97,12 +97,13 @@
详情页
- - + + - - + + +
@@ -127,6 +128,7 @@ export default { form: {}, skuList:[], skuAttr:[], + albumPics:null, productAttr: [ { name: '颜色', @@ -143,6 +145,8 @@ export default { const {id} = this.$route.query if (id) { this.getInfo(id); + }else{ + this.form.publishStatus=0 } }, methods: { @@ -199,7 +203,7 @@ export default { getPmsProduct(id).then(response => { const {albumPics } = response if (albumPics) { - response.albumPics = albumPics.split(',') + this.albumPics = albumPics.split(',') } this.form = response; if(this.form.productAttr){ @@ -212,6 +216,9 @@ export default { submitForm() { this.$refs["form"].validate(valid => { if (valid) { + if(this.albumPics){ + this.form.albumPics = this.albumPics.toString() + } this.form.skuList = this.skuList if(this.form.categoryId && Array.isArray(this.form.categoryId)){ this.form.categoryId = this.form.categoryId.pop() diff --git a/src/views/pms/product/index.vue b/src/views/pms/product/index.vue index a7ac6f6..2a87a3c 100644 --- a/src/views/pms/product/index.vue +++ b/src/views/pms/product/index.vue @@ -63,10 +63,18 @@ - + + + - + + +