Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
S
shop-new
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
王天霸
shop-new
Commits
b5d49a86
提交
b5d49a86
authored
8月 04, 2021
作者:
huaxinzhu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug修复
上级
3327b7c0
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
31 行增加
和
19 行删除
+31
-19
goodsimg.vue
src/views/system/goods/add/components/goodsimg.vue
+24
-18
index.vue
src/views/system/goods/add/index.vue
+7
-1
没有找到文件。
src/views/system/goods/add/components/goodsimg.vue
浏览文件 @
b5d49a86
...
@@ -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
(){
//失去焦点事件
...
...
src/views/system/goods/add/index.vue
浏览文件 @
b5d49a86
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论