From cc744ec5fba6430b28df649cc640991f84b8d9d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=8B=E4=BA=8E=E5=88=9D=E8=A7=81?= <752204717@qq.com> Date: Fri, 28 Feb 2025 17:36:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/shop/curriculum.vue | 43 ++++++++++++++------------ src/views/modules/shop/shopproduct.vue | 21 +++++++++++-- 2 files changed, 43 insertions(+), 21 deletions(-) diff --git a/src/views/modules/shop/curriculum.vue b/src/views/modules/shop/curriculum.vue index b4b243c..82f7070 100644 --- a/src/views/modules/shop/curriculum.vue +++ b/src/views/modules/shop/curriculum.vue @@ -168,6 +168,12 @@ + + + + + + { // console.log(err); // }); - }else{ - console.log('op.insert.image at line 407:', op.insert.image) - // 获取光标所在位置 - var quill = that.$refs.myQuillEditor.quill; - var length = this.quillEditorIndex; + } else { + console.log("op.insert.image at line 407:", op.insert.image); + // 获取光标所在位置 + var quill = that.$refs.myQuillEditor.quill; + var length = this.quillEditorIndex; - console.log("length at line 397:", length); + console.log("length at line 397:", length); - // 插入图片,res为服务器返回的图片链接地址 - quill.insertEmbed(length, "image", op.insert.image); - // 调整光标到最后 - quill.setSelection(length + 1); - this.uploadLoading = false; + // 插入图片,res为服务器返回的图片链接地址 + quill.insertEmbed(length, "image", op.insert.image); + // 调整光标到最后 + quill.setSelection(length + 1); + this.uploadLoading = false; } } } }); - + delta.ops = ops; // 不加会报错 return delta; }, @@ -705,7 +710,9 @@ add:'/master/shopProduct/addProduct', this.$http .request({ - url: this.$http.adornUrl(this.dataForm.productId?this.urlList.edit:this.urlList.add), + url: this.$http.adornUrl( + this.dataForm.productId ? this.urlList.edit : this.urlList.add + ), method: "POST", data: { ...this.dataForm, @@ -718,8 +725,6 @@ add:'/master/shopProduct/addProduct', } }) - - .then(({ data }) => { if (data && data.code === 0) { this.$message({ diff --git a/src/views/modules/shop/shopproduct.vue b/src/views/modules/shop/shopproduct.vue index 007d0cb..1ac4d02 100644 --- a/src/views/modules/shop/shopproduct.vue +++ b/src/views/modules/shop/shopproduct.vue @@ -90,12 +90,22 @@ + + + +