Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-discover
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 afc29df7
authored
Jul 31, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
更新车主优选代码
1 parent
99802bfc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
26 deletions
src/views/category/components/pullDownNav.vue
src/views/category/index.vue
src/views/category/ownerPreference/add.vue
src/views/category/ownerPreference/index.vue
src/views/category/components/pullDownNav.vue
View file @
afc29df
...
...
@@ -97,7 +97,7 @@ export default{
},
beforeDestroy
(){
window
.
removeEventListener
(
'resize'
,
this
.
resizeDom
)
},
},
methods
:{
resizeDom
(){
this
.
calcWidth
()
...
...
@@ -116,10 +116,8 @@ export default{
}
return
pre
+
curW
},
0
);
console
.
log
(
curIdx
)
this
.
colList
=
curIdx
>-
1
?
this
.
tabList
.
slice
(
curIdx
)
:
[]
this
.
rowList
=
curIdx
>-
1
?
this
.
tabList
.
slice
(
0
,
curIdx
)
:
this
.
tabList
console
.
log
(
this
.
rowList
)
})
},
selectNav
(
item
){
...
...
@@ -260,4 +258,4 @@ export default{
}
}
}
</
style
>
\ No newline at end of file
</
style
>
src/views/category/index.vue
View file @
afc29df
<
template
>
<div
class=
"category-list-ctnr"
>
<GLTabs
class=
"tabs"
v-model=
"activeName"
:tabPaneList=
"tabPaneList"
@
tab-click=
"handleClick"
></GLTabs>
<template
v-if=
"activeName ==1"
>
<GLTabs
ref=
'GLTabs'
class=
"tabs"
v-model=
"activeName"
:tabPaneList=
"tabPaneList"
@
tab-click=
"handleClick"
removeTab=
"removeTab"
></GLTabs>
<template
v-if=
"activeName =='1'"
>
<pullDownNav
@
confirmDialog=
"handleEdit"
@
inputBlur=
"inputBlur"
@
delete=
"delCategory"
v-model=
"curMainCategoryId"
:tabList=
"mainCategoryList"
:defaultProps=
"
{id: 'id', name: 'categoryName'}">
</pullDownNav>
<div
class=
"main-wrap"
>
...
...
@@ -33,7 +35,7 @@
</div>
</
template
>
<
template
v-if=
"activeName==
2
"
>
<
template
v-if=
"activeName==
'2'
"
>
<ownerPreference></ownerPreference>
</
template
>
</div>
...
...
@@ -138,6 +140,7 @@ export default {
},
created
()
{
this
.
getChannelList
()
},
watch
:
{
curMainCategoryId
:
{
...
...
@@ -147,15 +150,24 @@ export default {
deep
:
true
},
activeName
:
{
handler
()
{
this
.
getMainCategory
()
handler
(
val
)
{
if
(
val
==
1
){
this
.
getMainCategory
()
}
},
deep
:
true
},
},
mounted
()
{
},
methods
:
{
handleClick
(
tab
,
event
)
{
sessionStorage
.
setItem
(
'tagActive'
,
this
.
activeName
)
},
//获取频道名称
getChannelList
()
{
this
.
$apis
.
channel
...
...
@@ -167,7 +179,7 @@ export default {
if
(
res
?.
list
?.
length
)
{
let
tabPaneList
=
[]
res
.
list
.
forEach
(
item
=>
{
if
(
item
.
channelType
==
5
||
item
.
channelType
==
5
)
{
if
(
item
.
channelType
==
5
||
item
.
channelType
==
6
)
{
tabPaneList
.
push
({
label
:
item
.
channelName
,
name
:
item
.
channelType
==
5
?
1
:
2
,
...
...
@@ -175,12 +187,12 @@ export default {
})
}
})
tabPaneList
.
push
({
label
:
'车主优选'
,
name
:
2
})
this
.
tabPaneList
=
tabPaneList
this
.
activeName
=
tabPaneList
[
0
].
name
// 处理返回的tab值
let
tagName
=
sessionStorage
.
getItem
(
'tagActive'
)
this
.
activeName
=
tagName
*
1
||
tabPaneList
[
0
].
name
// this.activeName = tabPaneList[0].name
}
})
},
...
...
src/views/category/ownerPreference/add.vue
View file @
afc29df
...
...
@@ -45,7 +45,7 @@ export default {
formObj
:
{
id
:
''
,
categoryName
:
''
,
categoryStyle
:
1
,
categoryStyle
:
0
,
videoCoverArr
:
[]
},
brandList
:
[],
...
...
@@ -119,7 +119,6 @@ export default {
delete
params
.
videoCoverArr
if
(
!
params
.
id
)
delete
params
.
id
this
.
$apis
.
category
.
addCategoryApi
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
)
{
this
.
$message
.
success
(
'操作成功'
)
this
.
handleCancel
()
...
...
@@ -129,12 +128,12 @@ export default {
})
},
handleCancel
()
{
this
.
$route
.
query
.
name
=
'2'
;
this
.
$router
.
back
()
},
getCaseDetailApi
()
{
this
.
$apis
.
category
.
batchDetailApi
({
id
:
this
.
$route
.
query
.
id
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
)
{
const
attrList
=
[
'id'
,
'categoryName'
,
'categoryStyle'
]
attrList
.
forEach
(
key
=>
{
...
...
src/views/category/ownerPreference/index.vue
View file @
afc29df
...
...
@@ -6,7 +6,7 @@
<span
class=
"table-title"
></span>
<el-button
class=
"operate-btn"
type=
"primary"
size=
"small"
@
click=
"addClassify()"
>
新建分类
</el-button>
</div>
<GLTable
ref=
"ca
se
Ref"
:getListApi=
"getListApi"
:noDataImg=
"url"
:searchForm=
"searchForm"
<GLTable
ref=
"ca
tegory
Ref"
:getListApi=
"getListApi"
:noDataImg=
"url"
:searchForm=
"searchForm"
:beforeSearchFn=
"beforeSearchFn"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
@
setTableFinishFun=
"setTableFinishFun"
>
...
...
@@ -18,9 +18,17 @@
</div>
<div
slot=
"categoryStyle"
slot-scope=
"scope"
>
<div>
{{
scope
.
scope
.
categoryStyle
==
0
?
'竖向排列'
:
scope
.
scope
.
categoryStyle
==
1
?
'横向排列'
:
scope
.
scope
.
categoryStyle
==
2
?
'种草样式'
:
'--'
}}
<div
class=
"category-style"
v-if=
"scope.scope.categoryStyle == 0"
>
<img
src=
"@/assets/category/vertical.png"
>
<span>
商品-竖向排列
</span>
</div>
<div
class=
"category-style"
v-if=
"scope.scope.categoryStyle == 1"
>
<img
src=
"@/assets/category/transverse.png"
>
<span>
商品-横向排列
</span>
</div>
<div
class=
"category-style"
v-if=
"scope.scope.categoryStyle == 2"
>
<img
src=
"@/assets/category/recommend.png"
>
<span>
种草模式
</span>
</div>
</div>
<div
class=
"table-btns"
slot=
"auth-button"
slot-scope=
"scope"
>
...
...
@@ -111,7 +119,8 @@ export default {
},
{
label
:
'分类布局'
,
addHtml
:
'categoryStyle'
addHtml
:
'categoryStyle'
,
width
:
180
},
{
label
:
'创建日期'
,
...
...
@@ -155,7 +164,7 @@ export default {
})
},
handleSearch
()
{
this
.
$refs
.
ca
se
Ref
.
refreshTable
()
this
.
$refs
.
ca
tegory
Ref
.
refreshTable
()
},
handleReset
()
{
...
...
@@ -168,7 +177,7 @@ export default {
},
setTableFinishFun
()
{
//接收到的数据为空
this
.
$refs
.
ca
seRef
.
data
.
length
?
(
this
.
$refs
.
caseRef
.
tableHeightValues
=
''
)
:
this
.
$refs
.
case
Ref
.
setTableHeightFun
()
this
.
$refs
.
ca
tegoryRef
.
data
.
length
?
(
this
.
$refs
.
categoryRef
.
tableHeightValues
=
''
)
:
this
.
$refs
.
category
Ref
.
setTableHeightFun
()
},
addClassify
(
row
=
{},
type
)
{
this
.
$router
.
push
({
...
...
@@ -207,6 +216,13 @@ export default {
cursor
:
pointer
;
}
}
.category-style
{
display
:
flex
;
align-items
:
center
;
img{
width
:
36px
;
margin-right
:
8px
;
}
}
</
style
>
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