提交 5f709a64 authored 作者: huaxinzhu's avatar huaxinzhu

Merge branch 'dev_hxz' into test

......@@ -69,9 +69,9 @@
}
},
// 禁止粘贴图片
clipboard: {
//matchers: [[Node.ELEMENT_NODE, this.handleCustomMatcher]]
}
// clipboard: {
// //matchers: [[Node.ELEMENT_NODE, this.handleCustomMatcher]]
// }
}
},
index: 0,
......@@ -85,20 +85,20 @@
},
watch: {},
methods: {
handleCustomMatcher(node, Delta) {
let ops = []
console.log(123);
debugger
Delta.ops.forEach(op => {
if (op.insert && typeof op.insert === 'string') {// 如果粘贴了图片,这里会是一个对象,所以可以这样处理
ops.push({
insert: op.insert,
})
}
})
Delta.ops = ops
return Delta
},
// handleCustomMatcher(node, Delta) {
// let ops = []
// console.log(123);
// debugger
// Delta.ops.forEach(op => {
// if (op.insert && typeof op.insert === 'string') {// 如果粘贴了图片,这里会是一个对象,所以可以这样处理
// ops.push({
// insert: op.insert,
// })
// }
// })
// Delta.ops = ops
// return Delta
// },
/** 初始化 商品详情 */
initInfo() {
......@@ -130,7 +130,7 @@
let quill = this.$refs.myTextEditor.quill;
let length = quill.getSelection().index;
// 插入图片 res.data.url为服务器返回的图片地址
quill.insertEmbed(length, 'image)', res.data.image_url)
quill.insertEmbed(length, 'image', res.data.image_url)
// 调整光标到最后
quill.setSelection(length + 1)
if(this.index < this.indexall){
......@@ -148,6 +148,12 @@
//
onEditorChange({editor, html, text}) {
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(){//失去焦点事件
......
......@@ -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();
......@@ -466,6 +466,12 @@
// 获取 商品信息数据
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;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论