This commit is contained in:
2025-02-28 17:36:48 +08:00
parent 2314f863e1
commit cc744ec5fb
2 changed files with 43 additions and 21 deletions

View File

@@ -168,6 +168,12 @@
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="VIP优惠图书" prop="isFreeMail">
<el-radio-group v-model="dataForm.isVipPrice">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</div>
<el-form-item label="商品详情" prop="productDetails">
<el-upload
@@ -357,9 +363,9 @@ export default {
// { required: true, message: '排序不能为空', trigger: 'blur' }
// ]
},
urlList:{
edit:'/master/shopProduct/editProductDetail',
add:'/master/shopProduct/addProduct',
urlList: {
edit: "/master/shopProduct/editProductDetail",
add: "/master/shopProduct/addProduct"
},
// 富文本编辑器配置
editorOption: {
@@ -406,7 +412,6 @@ add:'/master/shopProduct/addProduct',
if (op.insert && typeof op.insert !== "string") {
// 如果粘贴了图片,这里会是一个对象
if (op.insert.image) {
if (op.insert.image.includes(";base64")) {
let file = that.dataURLtoFile(
op.insert.image,
@@ -481,24 +486,24 @@ add:'/master/shopProduct/addProduct',
// .catch(err => {
// 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({