提交 b5d49a86 authored 作者: huaxinzhu's avatar huaxinzhu

bug修复

上级 3327b7c0
...@@ -69,9 +69,9 @@ ...@@ -69,9 +69,9 @@
} }
}, },
// 禁止粘贴图片 // 禁止粘贴图片
clipboard: { // clipboard: {
//matchers: [[Node.ELEMENT_NODE, this.handleCustomMatcher]] // //matchers: [[Node.ELEMENT_NODE, this.handleCustomMatcher]]
} // }
} }
}, },
index: 0, index: 0,
...@@ -85,20 +85,20 @@ ...@@ -85,20 +85,20 @@
}, },
watch: {}, watch: {},
methods: { methods: {
handleCustomMatcher(node, Delta) { // handleCustomMatcher(node, Delta) {
let ops = [] // let ops = []
console.log(123); // console.log(123);
debugger // debugger
Delta.ops.forEach(op => { // Delta.ops.forEach(op => {
if (op.insert && typeof op.insert === 'string') {// 如果粘贴了图片,这里会是一个对象,所以可以这样处理 // if (op.insert && typeof op.insert === 'string') {// 如果粘贴了图片,这里会是一个对象,所以可以这样处理
ops.push({ // ops.push({
insert: op.insert, // insert: op.insert,
}) // })
} // }
}) // })
Delta.ops = ops // Delta.ops = ops
return Delta // return Delta
}, // },
/** 初始化 商品详情 */ /** 初始化 商品详情 */
initInfo() { initInfo() {
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
let quill = this.$refs.myTextEditor.quill; let quill = this.$refs.myTextEditor.quill;
let length = quill.getSelection().index; let length = quill.getSelection().index;
// 插入图片 res.data.url为服务器返回的图片地址 // 插入图片 res.data.url为服务器返回的图片地址
quill.insertEmbed(length, 'image)', res.data.image_url) quill.insertEmbed(length, 'image', res.data.image_url)
// 调整光标到最后 // 调整光标到最后
quill.setSelection(length + 1) quill.setSelection(length + 1)
if(this.index < this.indexall){ if(this.index < this.indexall){
...@@ -148,6 +148,12 @@ ...@@ -148,6 +148,12 @@
// //
onEditorChange({editor, html, text}) { onEditorChange({editor, html, text}) {
this.goodsDeForm.description = html; this.goodsDeForm.description = html;
// console.log( 100,this.$refs.file.files );
// console.log( 200,this.goodsDeForm.description );
// console.log( 300,this.goodsDetailsImgFileList );
// if( this.goodsDeForm.description.indexOf('img') < -1 ) {
// this.goodsDetailsImgFileList = [];
// }
}, },
onEditorBlur(){//失去焦点事件 onEditorBlur(){//失去焦点事件
......
...@@ -433,7 +433,7 @@ ...@@ -433,7 +433,7 @@
} }
// 商品详情 是否填写完整 // 商品详情 是否填写完整
let isGoodsDetailsImgMsg = this.$refs.goodsdetailsimg.goodsDeForm.description ? true : false; let isGoodsDetailsImgMsg = (this.$refs.goodsdetailsimg.goodsDeForm.description.indexOf('img') > -1) ? true : false;
// 售后服务 是否填写完整 // 售后服务 是否填写完整
let isGoodsAfterSaleMsg = this.$refs['goodsaftersale'].validateGoodsAfterSaleForm(); let isGoodsAfterSaleMsg = this.$refs['goodsaftersale'].validateGoodsAfterSaleForm();
...@@ -466,6 +466,12 @@ ...@@ -466,6 +466,12 @@
// 获取 商品信息数据 // 获取 商品信息数据
let spxxData = this.$refs.goodsInfo.goodsInfoForm; let spxxData = this.$refs.goodsInfo.goodsInfoForm;
if( spxxData.imgs.length > 5 ) {
this.$message({ type: 'warning',message: '商品信息中,商品图片最大数量为5张,请检查' });
this.setFloorNavMountClick(0);
return;
}
// 商品规格 // 商品规格
let spggData = this.$refs.goodsspecifications.speData; let spggData = this.$refs.goodsspecifications.speData;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论