Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-pay
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6401a60d
authored
Nov 09, 2021
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
编辑商品-描述
1 parent
03f30932
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
23 deletions
src/components/glsx-combi-form/index.vue
src/views/productGroup/editProduct.vue
src/components/glsx-combi-form/index.vue
View file @
6401a60
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<div
class=
"glsx-combi-form"
>
<div
class=
"glsx-combi-form"
>
<el-form
:ref=
"formRef"
:inline=
"true"
:model=
"formObj"
:label-width=
"labelWidth"
:rules=
"formRules"
size=
"small"
class=
"glsx-combi-form-block"
>
<el-form
:ref=
"formRef"
:inline=
"true"
:model=
"formObj"
:label-width=
"labelWidth"
:rules=
"formRules"
size=
"small"
class=
"glsx-combi-form-block"
>
<template
v-for=
"(item, index) in formData"
>
<template
v-for=
"(item, index) in formData"
>
<el-form-item
v-if=
"!item.isHide"
:key=
"index"
:class=
"
{ 'no-label': !item.label, isBlock: isBlock }" :label="item.label ? item.label + ':' : ''" :prop="item.name">
<el-form-item
v-if=
"!item.isHide"
:key=
"index"
:class=
"
{ 'no-label': !item.label, isBlock: isBlock }" :
style="{ ...item.style }" :
label="item.label ? item.label + ':' : ''" :prop="item.name">
<span
v-if=
"!item.isHide && item.tips"
class=
"tips-block"
slot=
"label"
>
<span
v-if=
"!item.isHide && item.tips"
class=
"tips-block"
slot=
"label"
>
<span
class=
"tips-label"
>
{{
item
.
label
}}
</span>
<span
class=
"tips-label"
>
{{
item
.
label
}}
</span>
<el-tooltip
popper-class=
"tooltip-class"
effect=
"dark"
:content=
"item.tips"
:placement=
"item.placement || 'top'"
>
<el-tooltip
popper-class=
"tooltip-class"
effect=
"dark"
:content=
"item.tips"
:placement=
"item.placement || 'top'"
>
...
...
src/views/productGroup/editProduct.vue
View file @
6401a60
...
@@ -64,38 +64,38 @@
...
@@ -64,38 +64,38 @@
<div
v-for=
"(item, index) in externalFormList"
:key=
"index"
>
<div
v-for=
"(item, index) in externalFormList"
:key=
"index"
>
<p
class=
"edit-sub-title"
>
{{
item
.
title
}}
</p>
<p
class=
"edit-sub-title"
>
{{
item
.
title
}}
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
:labelWidth=
"labelWidth"
:isBlock=
"true"
:formRef=
"item.editChildRef"
:formObj=
"editForm"
:formData=
"item.editFormData"
:formRules=
"item.editRule"
>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
:labelWidth=
"labelWidth"
:isBlock=
"true"
:formRef=
"item.editChildRef"
:formObj=
"editForm"
:formData=
"item.editFormData"
:formRules=
"item.editRule"
>
<template
slot=
"
banner
Btn"
>
<template
slot=
"
describe
Btn"
>
<el-button
type=
"primary"
@
click=
"handle
BannerAdd"
>
新增banner
</el-button>
<el-button
type=
"primary"
@
click=
"handle
DescribeImgAdd"
>
添加图片
</el-button>
</
template
>
</
template
>
<div
:style=
"{ 'margin-left': labelWidth }"
slot=
"
bannerList
"
slot-scope=
"scope"
>
<div
:style=
"{ 'margin-left': labelWidth }"
slot=
"
descImgs
"
slot-scope=
"scope"
>
<div
v-for=
"(subItem, subIndex) in editForm[scope.scope.name]"
:key=
"subIndex"
class=
"flex"
>
<div
v-for=
"(subItem, subIndex) in editForm[scope.scope.name]"
:key=
"subIndex"
class=
"flex"
>
<!-- 上传图片 -->
<!-- 上传图片 -->
<div
class=
"banner-upload-box"
>
<div
class=
"banner-upload-box"
>
<div
class=
"p-t-12"
>
<div
class=
"p-t-12"
>
<div
class=
"flex"
>
<div
class=
"flex"
>
<div
v-show=
"!subItem.
bannerImg
"
class=
"activity-img img-w-h"
style=
"margin-bottom: 11px;"
>
<div
v-show=
"!subItem.
content
"
class=
"activity-img img-w-h"
style=
"margin-bottom: 11px;"
>
<div
class=
"add"
>
+
</div>
<div
class=
"add"
>
+
</div>
<span
class=
"number"
>
上传
</span>
<span
class=
"number"
>
上传
</span>
<input
type=
"file"
style=
"opacity: 0;"
ref=
"file"
class=
"activity-img img-w-h"
accept=
"image/png, image/jpeg, image/gif, image/jpg"
@
change=
"e => handleImgChange(e, subIndex)"
/>
<input
type=
"file"
style=
"opacity: 0;"
ref=
"file"
class=
"activity-img img-w-h"
accept=
"image/png, image/jpeg, image/gif, image/jpg"
@
change=
"e => handleImgChange(e, subIndex)"
/>
</div>
</div>
<div
v-show=
"!subItem.
bannerImg
"
>
<div
v-show=
"!subItem.
content
"
>
<el-button
type=
"text"
class=
"el-icon-delete"
@
click=
"handle
Banner
Delete(subIndex)"
></el-button>
<el-button
type=
"text"
class=
"el-icon-delete"
@
click=
"handle
Empty
Delete(subIndex)"
></el-button>
</div>
</div>
</div>
</div>
<span
v-show=
"subItem.
bannerImg
"
class=
"muti-imgs"
>
<span
v-show=
"subItem.
content
"
class=
"muti-imgs"
>
<img
class=
"img-w-h"
:src=
"subItem.
bannerImg
"
/>
<img
class=
"img-w-h"
:src=
"subItem.
content
"
/>
<span
class=
"img-btns"
>
<span
class=
"img-btns"
>
<span
class=
"btn-item"
>
<span
class=
"btn-item"
>
<i
class=
"el-icon-delete"
@
click=
"handleImgDelete(scope.scope.name, subIndex)"
></i>
<i
class=
"el-icon-delete"
@
click=
"handleImgDelete(scope.scope.name, subIndex)"
></i>
<i
class=
"el-icon-zoom-in"
@
click=
"handleImgLook(subItem.
bannerImg
)"
></i>
<i
class=
"el-icon-zoom-in"
@
click=
"handleImgLook(subItem.
content
)"
></i>
</span>
</span>
</span>
</span>
</span>
</span>
</div>
</div>
<p
class=
"edit-tips"
>
支持上传
1
0MB以内的jpg,png,jpeg图片
</p>
<p
class=
"edit-tips"
>
支持上传
2
0MB以内的jpg,png,jpeg图片
</p>
</div>
</div>
<!-- 选择商品 -->
<!-- 选择商品 -->
<div
v-show=
"subItem.bannerImg"
class=
"flex-grow"
>
<
!-- <
div v-show="subItem.bannerImg" class="flex-grow">
<div>
<div>
<span>商品链接:</span>
<span>商品链接:</span>
<el-button v-show="!subItem.goodsId" type="text" class="btn-link" @click="handleSinglePro(scope.scope, subIndex)">选择</el-button>
<el-button v-show="!subItem.goodsId" type="text" class="btn-link" @click="handleSinglePro(scope.scope, subIndex)">选择</el-button>
...
@@ -106,19 +106,21 @@
...
@@ -106,19 +106,21 @@
<img class="img-60" :src="subItem.goods.goodsImage">
<img class="img-60" :src="subItem.goods.goodsImage">
<p class="pro-txt flex-grow one-line-ellipsis">{{ subItem.goods.goodsName }}</p>
<p class="pro-txt flex-grow one-line-ellipsis">{{ subItem.goods.goodsName }}</p>
</div>
</div>
</div>
</div>
-->
</div>
</div>
</div>
</div>
</glsx-combi-form>
</glsx-combi-form>
</div>
</div>
</div>
</div>
<!-- <glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form> -->
</div>
</div>
</div>
</div>
<div
class=
"footer"
:style=
"{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<div
class=
"footer"
:style=
"{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type=
"primary"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"default"
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"default"
@
click=
"handleCancel"
>
取消
</el-button>
</div>
</div>
<el-dialog
:visible
.
sync=
"isImgVisible"
>
<img
class=
"dialog-img"
width=
"100%"
:src=
"dialogImageUrl"
alt=
""
/>
</el-dialog>
</div>
</div>
</template>
</template>
...
@@ -149,7 +151,8 @@ export default {
...
@@ -149,7 +151,8 @@ export default {
goodsDetailImageList
:
[],
goodsDetailImageList
:
[],
goodsVideo
:
''
,
goodsVideo
:
''
,
classifyIdList
:
[],
classifyIdList
:
[],
zoneId
:
''
zoneId
:
''
,
descImgList
:
[]
},
},
labelWidth
:
'110px'
,
labelWidth
:
'110px'
,
externalFormList
:
[
externalFormList
:
[
...
@@ -241,23 +244,46 @@ export default {
...
@@ -241,23 +244,46 @@ export default {
optionId
:
'id'
,
optionId
:
'id'
,
optionLabel
:
'zoneName'
,
optionLabel
:
'zoneName'
,
optionsName
:
'zoneList'
optionsName
:
'zoneList'
}
]
},
},
{
{
title
:
'Banner管理'
,
label
:
'商品描述'
,
editFormData
:
[
name
:
''
,
addHtml
:
'describeBtn'
},
{
{
label
:
'banner图片'
,
label
:
''
,
addHtml
:
'bannerBtn'
name
:
'describeTxt'
,
type
:
'input'
,
inputType
:
'textarea'
,
width
:
'320px'
,
placeholder
:
'请输入商品描述'
,
rows
:
5
,
maxlength
:
'200'
,
style
:
{
'margin-left'
:
'110px'
}
},
},
{
{
label
:
''
,
label
:
''
,
name
:
'
banner
List'
,
name
:
'
descImg
List'
,
addHtml
:
'
bannerList
'
addHtml
:
'
descImgs
'
}
}
]
]
},
},
// {
// title: 'Banner管理',
// editFormData: [
// {
// label: 'banner图片',
// addHtml: 'bannerBtn'
// },
// {
// label: '',
// name: 'bannerList',
// addHtml: 'bannerList'
// }
// ]
// },
{
{
title
:
'公告管理'
,
title
:
'公告管理'
,
editFormData
:
[
editFormData
:
[
...
@@ -285,6 +311,15 @@ export default {
...
@@ -285,6 +311,15 @@ export default {
]
]
}
}
],
],
descImgItem
:
{
content
:
''
,
// warning: '请上传20M以内的jpg、jpeg、png图片',
resType
:
1
,
bizType
:
2
},
// 查看大图
isImgVisible
:
false
,
dialogImageUrl
:
''
,
baseData
:
{
baseData
:
{
classifyList
:
[],
classifyList
:
[],
zoneList
:
[]
zoneList
:
[]
...
@@ -350,6 +385,60 @@ export default {
...
@@ -350,6 +385,60 @@ export default {
})
})
}
}
},
},
// 商品描述-图片
handleDescribeImgAdd
()
{
if
(
this
.
editForm
.
descImgList
.
length
>=
10
)
{
this
.
$message
({
message
:
'最多只允许添加10个'
,
type
:
'error'
})
return
true
}
this
.
editForm
.
descImgList
.
push
(
this
.
$common
.
utils
.
deepClone
(
this
.
descImgItem
))
},
// 图片-描述-start
handleImgChange
(
e
,
idx
)
{
var
reader
=
new
FileReader
()
var
file
=
e
.
srcElement
.
files
[
0
]
const
isLt
=
file
.
size
/
1024
/
1024
<
20
const
isType
=
[
'image/jpeg'
,
'image/png'
,
'image/jpg'
].
includes
(
file
.
type
)
if
(
!
isType
)
{
this
.
$message
.
error
(
'上传图片不是jpg、jpeg或png的格式!'
)
return
true
}
if
(
!
isLt
)
{
this
.
$message
.
error
(
'上传图片大小不能超过20MB!'
)
return
true
}
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
e
=>
{
const
imgFile
=
e
.
target
.
result
const
base64
=
file
.
name
.
split
(
'.'
)[
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$apis
.
common
.
uploadImgApi
({
file
:
base64
,
fileType
:
'image'
}).
then
(
res
=>
{
this
.
editForm
.
descImgList
[
idx
].
content
=
res
})
}
},
handleEmptyDelete
(
idx
)
{
this
.
editForm
.
descImgList
.
splice
(
idx
,
1
)
},
handleImgDelete
(
attrName
,
subIndex
)
{
this
.
$messageBox
.
confirm
(
'是否删除该图片?'
,
'删除'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'error'
,
callback
:
action
=>
{
if
(
action
==
'confirm'
)
{
this
.
editForm
[
attrName
].
splice
(
subIndex
,
1
)
}
}
})
},
handleImgLook
(
src
)
{
this
.
isImgVisible
=
true
this
.
dialogImageUrl
=
src
},
// 图片-描述-end
handleConfirm
()
{
handleConfirm
()
{
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
(
valid
=>
{
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment