Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-content
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 a94153b2
authored
May 31, 2023
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化
1 parent
2798952e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
98 deletions
src/views/discoverManager/addProd.vue
src/views/discoverManager/components/AddImage/index.vue
src/views/discoverManager/addProd.vue
View file @
a94153b
<!-- 专区管理 -->
<
template
>
<div
class=
"ctnr"
>
<glsx-combi-form
class=
"glsx-combi-form"
ref=
"baseInfoRef"
labelWidth=
"154px"
defaultWidth=
"432px"
:isInline=
"false"
:formObj
.
sync=
"formObj"
:formData=
"formData"
:formRules=
"myRule"
>
<!-- 模块分割线 -->
<div
class=
"big-title"
slot=
"coverBigTitleSlot"
>
产品封面设置
</div>
<div
class=
"detail-title"
slot=
"detailBigTitleSlot"
>
<div
class=
"big-title"
>
产品详情内容配置
</div>
</div>
<div
slot=
"moduleSlot"
class=
"radio-slot"
>
<el-radio-group
@
change=
"menuRadioChange"
v-model=
"formObj.menuId"
>
<el-radio
v-for=
"item in menuList"
:key=
"item.id"
:label=
"item.id"
>
{{
item
.
name
}}
</el-radio>
</el-radio-group>
</div>
<div
slot=
"zoneSlot"
class=
"radio-slot"
>
<el-radio-group
v-model=
"formObj.subMenuId"
>
<el-radio
v-for=
"item in subMenuList"
:key=
"item.id"
:label=
"item.id"
>
{{
item
.
name
}}
</el-radio>
</el-radio-group>
</div>
<div
slot=
"contZoneSlot"
class=
"radio-slot"
>
<el-radio-group
v-model=
"formObj.type"
>
<el-radio
:label=
"formObj.type"
>
{{
contentType
[
formObj
.
type
]
}}
</el-radio>
</el-radio-group>
</div>
<div
slot=
"businessSlot"
class=
"business-slot"
>
<span
class=
"module"
>
{{
routeInfo
.
menuName
}}
</span>
<i
class=
"el-icon-arrow-right arrow-right"
></i>
<span
class=
"module"
>
{{
routeInfo
.
subMenuName
}}
</span>
<i
class=
"el-icon-arrow-right arrow-right"
></i>
<span
class=
"module active"
>
特色产品
</span>
</div>
<div
slot=
"coverDetailSlot"
class=
"cover-Slot"
>
<Upload
v-if=
"!formObj.prodImg"
:empty=
"true"
@
clickEvent=
"openCoverDialog"
:default-style=
"
{width: '84px', height: '84px'}" :formObj="formObj" btnName="创建封面" attr="coverDetail">
</Upload>
<Upload
v-else
:default-style=
"
{width: '84px', height: '84px'}" :formObj="formObj" btnName="创建封面" attr="prodImg">
</Upload>
</div>
<div
slot=
"mainImageSlot"
class=
"main-image-Slot"
>
<Upload
placement=
"right"
tip=
"图片&视频只能上传一个"
fileType=
"all"
:formObj=
"formObj"
attr=
"imageUrl"
></Upload>
</div>
<div
slot=
"viewSlot"
class=
"view-slot"
>
<el-input
placeholder=
"请输入观看人数"
v-model=
"formObj.view"
onkeyup=
"value=value.replace(/^(0+)|[^\d]+/g,'')"
type=
"text"
></el-input>
</div>
<div
slot=
"expansionDetailSlot"
class=
"expansion-detail-slot"
>
<div>
<div
:class=
"['tab-item',
{'active-tab': item.selected, 'editing': contentTypeObj.id
&&
contentTypeObj.id==item.id}]" @click.stop="selectContentType(item)" v-for="item in contentTypeList" :key="item.id">
<img
v-if=
"item.selected"
class=
"active-label"
@
click=
"showOperateDialog(1, item)"
:src=
"require('@/assets/active-label.png')"
/>
<el-input
v-if=
"contentTypeObj.id && contentTypeObj.id==item.id"
v-focus
v-model=
"contentTypeObj.name"
@
blur=
"blurContentType"
type=
"text"
class=
"add-input"
></el-input>
<template
v-else
>
<span
>
{{
item
.
name
}}
</span>
<i
class=
"el-icon-edit edit"
@
click
.
stop=
"editContentType(item)"
></i>
</
template
>
</div>
<div
v-if=
"!isEditType"
class=
"tab-item add-btn"
@
click=
"addContentType"
><i
class=
"el-icon-plus"
></i>
新建
</div>
<el-input
v-else
v-focus
v-model=
"contentTypeObj.name"
@
blur=
"blurContentType"
type=
"text"
class=
"add-input"
></el-input>
<div>
<div
class=
"ctnr"
>
<glsx-combi-form
class=
"glsx-combi-form"
ref=
"baseInfoRef"
labelWidth=
"154px"
defaultWidth=
"432px"
:isInline=
"false"
:formObj
.
sync=
"formObj"
:formData=
"formData"
:formRules=
"myRule"
>
<!-- 模块分割线 -->
<div
class=
"big-title"
slot=
"coverBigTitleSlot"
>
产品封面设置
</div>
<div
class=
"detail-title"
slot=
"detailBigTitleSlot"
>
<div
class=
"big-title"
>
产品详情内容配置
</div>
</div>
<div
slot=
"moduleSlot"
class=
"radio-slot"
>
<el-radio-group
@
change=
"menuRadioChange"
v-model=
"formObj.menuId"
>
<el-radio
v-for=
"item in menuList"
:key=
"item.id"
:label=
"item.id"
>
{{
item
.
name
}}
</el-radio>
</el-radio-group>
</div>
<div
slot=
"zoneSlot"
class=
"radio-slot"
>
<el-radio-group
v-model=
"formObj.subMenuId"
>
<el-radio
v-for=
"item in subMenuList"
:key=
"item.id"
:label=
"item.id"
>
{{
item
.
name
}}
</el-radio>
</el-radio-group>
</div>
<div
slot=
"contZoneSlot"
class=
"radio-slot"
>
<el-radio-group
v-model=
"formObj.type"
>
<el-radio
:label=
"formObj.type"
>
{{
contentType
[
formObj
.
type
]
}}
</el-radio>
</el-radio-group>
</div>
<div
slot=
"businessSlot"
class=
"business-slot"
>
<span
class=
"module"
>
{{
routeInfo
.
menuName
}}
</span>
<i
class=
"el-icon-arrow-right arrow-right"
></i>
<span
class=
"module"
>
{{
routeInfo
.
subMenuName
}}
</span>
<i
class=
"el-icon-arrow-right arrow-right"
></i>
<span
class=
"module active"
>
特色产品
</span>
</div>
<div
class=
"global-title-wrap"
>
<span
v-for=
"(item,index) in selectedtypeList"
:key=
"index"
:class=
"['title', {'curTitleCla': curTypeIdx==index}]"
@
click=
"changeTable(item, index)"
>
{{item.name}}
</span>
<div
class=
"expansion-content"
v-if=
"selectedtypeList && selectedtypeList.length"
>
<glsx-combi-form
ref=
"expansionRef"
labelWidth=
"154px"
defaultWidth=
"432px"
:isInline=
"false"
:formObj
.
sync=
"selectedtypeList[curTypeIdx]"
:formData=
"expansionFormData"
:formRules=
"expansionRule"
>
<div
slot=
"detailImageSlot"
>
<Upload
tip=
"建议尺寸:最大5M,宽度750px"
btnName=
"上传详情图"
:formObj=
"selectedtypeList[curTypeIdx]"
attr=
"posterUrl"
@
delImage=
"delImage"
></Upload>
</div>
<div
slot=
"detailVideoSlot"
>
<Upload
:disabled=
"!!selectedtypeList[curTypeIdx].buttonEventType || !!selectedtypeList[curTypeIdx].posterEventType"
btnName=
"上传详情视频"
fileType=
"video"
:formObj=
"selectedtypeList[curTypeIdx]"
@
delImage=
"delImage"
attr=
"videoUrl"
></Upload>
</div>
<div
slot=
"mouseEventSlot"
class=
"link-slot"
>
<el-checkbox
@
change=
"showBox($event, 'mouseShow')"
:disabled=
"!!selectedtypeList[curTypeIdx].videoUrl"
@
click
.
stop=
"showBox(1, 'mouseShow')"
v-model=
"selectedtypeList[curTypeIdx].posterEventType"
>
长按跳链接
</el-checkbox>
<span
class=
"link-btn"
ref=
"mouseNameRef"
@
click=
"mouseShow = true"
>
链接
</span>
<!-- 鼠标链接弹窗 -->
<div
class=
"link-dialog"
ref=
"mouseRef"
v-show=
"mouseShow && selectedtypeList[curTypeIdx].posterEventType"
>
<label
for=
""
>
链接地址:
</label>
<el-input
v-model=
"selectedtypeList[curTypeIdx].posterEventUrl"
placeholder=
"请输入链接地址"
></el-input>
<div
slot=
"coverDetailSlot"
class=
"cover-Slot"
>
<Upload
v-if=
"!formObj.prodImg"
:empty=
"true"
@
clickEvent=
"openCoverDialog"
:default-style=
"
{width: '84px', height: '84px'}" :formObj="formObj" btnName="创建封面" attr="coverDetail">
</Upload>
<Upload
v-else
:default-style=
"
{width: '84px', height: '84px'}" :formObj="formObj" btnName="创建封面" attr="prodImg">
</Upload>
</div>
<div
slot=
"mainImageSlot"
class=
"main-image-Slot"
>
<Upload
placement=
"right"
tip=
"图片&视频只能上传一个"
fileType=
"all"
:formObj=
"formObj"
attr=
"imageUrl"
></Upload>
</div>
<div
slot=
"viewSlot"
class=
"view-slot"
>
<el-input
placeholder=
"请输入观看人数"
v-model=
"formObj.view"
onkeyup=
"value=value.replace(/^(0+)|[^\d]+/g,'')"
type=
"text"
></el-input>
</div>
<div
slot=
"expansionDetailSlot"
class=
"expansion-detail-slot"
>
<div>
<div
:class=
"['tab-item',
{'active-tab': item.selected, 'editing': contentTypeObj.id
&&
contentTypeObj.id==item.id}]" @click.stop="selectContentType(item)" v-for="item in contentTypeList" :key="item.id">
<img
v-if=
"item.selected"
class=
"active-label"
@
click=
"showOperateDialog(1, item)"
:src=
"require('@/assets/active-label.png')"
/>
<el-input
v-if=
"contentTypeObj.id && contentTypeObj.id==item.id"
v-focus
v-model=
"contentTypeObj.name"
@
blur=
"blurContentType"
type=
"text"
class=
"add-input"
></el-input>
<template
v-else
>
<span
>
{{
item
.
name
}}
</span>
<i
class=
"el-icon-edit edit"
@
click
.
stop=
"editContentType(item)"
></i>
</
template
>
</div>
<div
v-if=
"!isEditType"
class=
"tab-item add-btn"
@
click=
"addContentType"
><i
class=
"el-icon-plus"
></i>
新建
</div>
<el-input
v-else
v-focus
v-model=
"contentTypeObj.name"
@
blur=
"blurContentType"
type=
"text"
class=
"add-input"
></el-input>
</div>
<div
class=
"global-title-wrap"
>
<span
v-for=
"(item,index) in selectedtypeList"
:key=
"index"
:class=
"['title', {'curTitleCla': curTypeIdx==index}]"
@
click=
"changeTable(item, index)"
>
{{item.name}}
</span>
<div
class=
"expansion-content"
v-if=
"selectedtypeList && selectedtypeList.length"
>
<glsx-combi-form
ref=
"expansionRef"
labelWidth=
"154px"
defaultWidth=
"432px"
:isInline=
"false"
:formObj
.
sync=
"selectedtypeList[curTypeIdx]"
:formData=
"expansionFormData"
:formRules=
"expansionRule"
>
<div
slot=
"detailImageSlot"
>
<Upload
tip=
"建议尺寸:最大5M,宽度750px"
btnName=
"上传详情图"
:formObj=
"selectedtypeList[curTypeIdx]"
attr=
"posterUrl"
@
delImage=
"delImage"
></Upload>
</div>
</div>
<div
slot=
"buttonEventSlot"
class=
"link-slot"
>
<el-checkbox
@
change=
"showBox($event, 'btnShow')"
:disabled=
"!!selectedtypeList[curTypeIdx].videoUrl"
v-model=
"selectedtypeList[curTypeIdx].buttonEventType"
>
按钮跳链接
</el-checkbox>
<span
ref=
"btnNameRef"
v-if=
"!selectedtypeList[curTypeIdx].buttonEventName"
@
click
.
stop=
"showBox(1, 'btnShow')"
class=
"link-btn"
>
链接
</span>
<span
ref=
"btnNameRef"
v-else
class=
"link-btn"
@
click
.
stop=
"showBox(1, 'btnShow')"
>
{{selectedtypeList[curTypeIdx].buttonEventName}}
</span>
<!-- 按钮链接弹窗 -->
<div
class=
"link-dialog button-link-dialog"
ref=
"btnRef"
v-show=
"btnShow && selectedtypeList[curTypeIdx].buttonEventType"
>
<div>
<label
for=
""
>
按钮名称:
</label>
<el-input
v-model=
"selectedtypeList[curTypeIdx].buttonEventName"
placeholder=
"请输入按钮名称"
></el-input>
</div>
<div
style=
"margin-top: 20px;"
>
<div
slot=
"detailVideoSlot"
>
<Upload
:disabled=
"!!selectedtypeList[curTypeIdx].buttonEventType || !!selectedtypeList[curTypeIdx].posterEventType"
btnName=
"上传详情视频"
fileType=
"video"
:formObj=
"selectedtypeList[curTypeIdx]"
@
delImage=
"delImage"
attr=
"videoUrl"
></Upload>
</div>
<div
slot=
"mouseEventSlot"
class=
"link-slot"
>
<el-checkbox
@
change=
"showBox($event, 'mouseShow')"
:disabled=
"!!selectedtypeList[curTypeIdx].videoUrl"
@
click
.
stop=
"showBox(1, 'mouseShow')"
v-model=
"selectedtypeList[curTypeIdx].posterEventType"
>
长按跳链接
</el-checkbox>
<span
class=
"link-btn"
ref=
"mouseNameRef"
@
click=
"mouseShow = true"
>
链接
</span>
<!-- 鼠标链接弹窗 -->
<div
class=
"link-dialog"
ref=
"mouseRef"
v-show=
"mouseShow && selectedtypeList[curTypeIdx].posterEventType"
>
<label
for=
""
>
链接地址:
</label>
<el-input
v-model=
"selectedtypeList[curTypeIdx].
button
EventUrl"
placeholder=
"请输入链接地址"
></el-input>
<el-input
v-model=
"selectedtypeList[curTypeIdx].
poster
EventUrl"
placeholder=
"请输入链接地址"
></el-input>
</div>
</div>
</div>
</glsx-combi-form>
</div>
<div
slot=
"buttonEventSlot"
class=
"link-slot"
>
<el-checkbox
@
change=
"showBox($event, 'btnShow')"
:disabled=
"!!selectedtypeList[curTypeIdx].videoUrl"
v-model=
"selectedtypeList[curTypeIdx].buttonEventType"
>
按钮跳链接
</el-checkbox>
<span
ref=
"btnNameRef"
v-if=
"!selectedtypeList[curTypeIdx].buttonEventName"
@
click
.
stop=
"showBox(1, 'btnShow')"
class=
"link-btn"
>
链接
</span>
<span
ref=
"btnNameRef"
v-else
class=
"link-btn"
@
click
.
stop=
"showBox(1, 'btnShow')"
>
{{selectedtypeList[curTypeIdx].buttonEventName}}
</span>
<!-- 按钮链接弹窗 -->
<div
class=
"link-dialog button-link-dialog"
ref=
"btnRef"
v-show=
"btnShow && selectedtypeList[curTypeIdx].buttonEventType"
>
<div>
<label
for=
""
>
按钮名称:
</label>
<el-input
v-model=
"selectedtypeList[curTypeIdx].buttonEventName"
placeholder=
"请输入按钮名称"
></el-input>
</div>
<div
style=
"margin-top: 20px;"
>
<label
for=
""
>
链接地址:
</label>
<el-input
v-model=
"selectedtypeList[curTypeIdx].buttonEventUrl"
placeholder=
"请输入链接地址"
></el-input>
</div>
</div>
</div>
</glsx-combi-form>
</div>
</div>
</div>
</div>
</glsx-combi-form>
<ProdCoverDialog
@
closeDialog=
"closeDialog"
@
confirmDialog=
"confirmDialog"
v-if=
"coverVisible"
:visible=
"coverVisible"
></ProdCoverDialog>
<div
class=
"footer-btn"
>
<el-button
:size=
"size"
@
click=
"goListPage"
>
取消
</el-button>
<el-button
:size=
"size"
@
click=
"commitForm"
type=
"primary"
>
确定
</el-button>
</div>
</glsx-combi-form>
<ProdCoverDialog
@
closeDialog=
"closeDialog"
@
confirmDialog=
"confirmDialog"
v-if=
"coverVisible"
:visible=
"coverVisible"
></ProdCoverDialog>
</div>
<GLFooter
class=
"gl-footer"
>
<el-button
class=
"btn-cancle"
@
click=
"goListPage"
>
取消
</el-button>
<el-button
@
click=
"commitForm"
type=
"primary"
>
确定
</el-button>
</GLFooter>
</div>
</template>
<
script
>
...
...
@@ -494,7 +495,7 @@ export default {
this
.
$apis
.
discover
.
addContentApi
(
params
).
then
(
res
=>
{
if
(
res
)
{
this
.
$message
.
success
(
'操作成功'
)
this
.
$router
.
push
(
'/discoverManager/index'
)
this
.
goListPage
(
)
}
})
}
...
...
@@ -519,7 +520,6 @@ export default {
videoUrl
:
''
,
posterUrl
:
''
}
console
.
log
(
this
.
selectedtypeList
)
this
.
selectedtypeList
.
push
(
obj
)
}
},
...
...
@@ -541,8 +541,8 @@ export default {
<
style
scoped
lang=
"scss"
>
.ctnr
{
background-color
:
#fff
;
padding
:
20px
20px
0
;
background-color
:
#fff
;
.glsx-combi-form{
.big-title{
margin-left
:
74px
;
...
...
src/views/discoverManager/components/AddImage/index.vue
View file @
a94153b
...
...
@@ -164,7 +164,6 @@ export default {
if
(
item
.
name
==
'business'
)
item
.
isHide
=
true
}
});
console
.
log
(
this
.
formData
)
this
.
getMenuList
()
}
},
...
...
@@ -187,13 +186,11 @@ export default {
this
.
detailVisible
=
false
},
onCancel
(){
console
.
log
(
this
.
formObj
)
this
.
contentObj
.
imageDialogVisible
=
false
// this.$emit('closeVideoDialog')
},
async
getContentDetail
(){
this
.
$apis
.
discover
.
getContentDetailApi
({
id
:
this
.
contentObj
.
id
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
?.
id
){
for
(
const
key
in
this
.
formObj
){
this
.
formObj
[
key
]
=
res
[
key
]
...
...
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