Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
project-online-fi
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
project-online-fi
Commits
10d434ca
提交
10d434ca
authored
1月 13, 2023
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
9e36a678
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
27 行增加
和
47 行删除
+27
-47
Index.vue
src/modules/shop/views/Index.vue
+27
-47
没有找到文件。
src/modules/shop/views/Index.vue
浏览文件 @
10d434ca
...
@@ -24,59 +24,37 @@ watchEffect(() => {
...
@@ -24,59 +24,37 @@ watchEffect(() => {
}
}
})
})
// h5的tab
// h5的tab
let
menuValue
=
$ref
(
''
)
// tab选中值
let
tabValue
=
$ref
(
''
)
onMounted
(()
=>
{
onMounted
(()
=>
{
clearActive
()
const
defaultMenu
=
route
.
query
?.
type
||
''
const
defaultMenu
=
route
.
query
?.
type
||
''
shopStore
.
filters
=
shopStore
.
filters
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
tabValue
=
defaultMenu
as
string
if
(
b
.
value
===
defaultMenu
)
{
b
.
isActive
=
true
}
else
{
if
(
b
.
children
)
{
b
.
children
.
map
((
i
:
any
)
=>
i
.
value
===
defaultMenu
&&
(
i
.
isActive
=
true
))
b
.
children
.
find
((
i
:
any
)
=>
i
.
isActive
)
&&
(
b
.
isActive
=
true
)
}
}
a
.
push
(
b
)
return
a
},
[])
menuValue
=
defaultMenu
as
string
})
})
// menu下拉框显示
let
childMenuShow
=
$ref
(
false
)
let
childMenuShow
=
$ref
(
false
)
const
menuTab
=
function
(
item
:
any
)
{
if
(
item
.
value
===
'PRP'
)
{
const
changeMenuTab
=
function
(
item
:
any
)
{
window
.
open
(
'https://prp.ezijing.com'
)
switch
(
item
.
value
)
{
window
.
location
.
reload
()
case
'PAA'
:
}
childMenuShow
=
!
childMenuShow
if
(
!
item
.
children
)
{
break
c
learActive
()
c
ase
'PRP'
:
item
.
isActive
=
true
window
.
open
(
'https://prp.ezijing.com'
)
childMenuShow
=
false
break
menuValue
=
item
.
value
default
:
}
else
{
tabValue
=
item
.
value
childMenuShow
=
!
childMenuShow
childMenuShow
=
false
}
}
}
}
const
childMenuTab
=
function
(
item
:
any
,
cItem
:
any
)
{
// 点击下拉框
clearActive
()
const
changeMenuChildTab
=
function
(
item
:
any
)
{
item
.
isActive
=
true
tabValue
=
item
.
value
cItem
.
isActive
=
true
menuValue
=
cItem
.
value
setTimeout
(()
=>
{
setTimeout
(()
=>
{
childMenuShow
=
false
childMenuShow
=
false
},
100
)
},
100
)
}
}
const
clearActive
=
function
()
{
for
(
let
i
=
0
;
i
<
shopStore
.
filters
.
length
;
i
++
)
{
shopStore
.
filters
[
i
].
isActive
=
false
if
(
shopStore
.
filters
[
i
].
children
)
{
shopStore
.
filters
[
i
].
children
.
map
((
c
:
any
)
=>
(
c
.
isActive
=
false
))
}
}
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -116,15 +94,17 @@ const clearActive = function () {
...
@@ -116,15 +94,17 @@ const clearActive = function () {
<img
src=
"https://webapp-pub.ezijing.com/project_online/fi/shop_banner.jpg"
class=
"shop_banner"
/>
<img
src=
"https://webapp-pub.ezijing.com/project_online/fi/shop_banner.jpg"
class=
"shop_banner"
/>
<div
class=
"mobile-tab-box"
>
<div
class=
"mobile-tab-box"
>
<div
<div
:class=
"`item ${shopStore.filters[index].isActive && 'active'}`"
:class=
"`item ${item.children
? item.children.find((i: any) => i.value === tabValue) && 'active'
: item.value === tabValue && 'active'}`"
v-for=
"(item, index) in shopStore.filters"
v-for=
"(item, index) in shopStore.filters"
:key=
"index"
:key=
"index"
>
>
<span
@
click=
"
m
enuTab(item)"
>
{{ item.label }}
</span>
<span
@
click=
"
changeM
enuTab(item)"
>
{{ item.label }}
</span>
<div
class=
"child"
v-if=
"shopStore.filters[index]?.children && childMenuShow"
>
<div
class=
"child"
v-if=
"shopStore.filters[index]?.children && childMenuShow"
>
<div
<div
@
click=
"ch
ildMenuTab(item,
cItem)"
@
click=
"ch
angeMenuChildTab(
cItem)"
:class=
"`child-item ${
cItem.isActiv
e && 'active'}`"
:class=
"`child-item ${
tabValue === cItem.valu
e && 'active'}`"
v-for=
"(cItem, cIndex) in shopStore.filters[index]?.children"
v-for=
"(cItem, cIndex) in shopStore.filters[index]?.children"
:key=
"cIndex"
:key=
"cIndex"
>
>
...
@@ -134,11 +114,11 @@ const clearActive = function () {
...
@@ -134,11 +114,11 @@ const clearActive = function () {
</div>
</div>
</div>
</div>
<div
v-for=
"(item, index) in shopStore.filters"
:key=
"index"
>
<div
v-for=
"(item, index) in shopStore.filters"
:key=
"index"
>
<CourseList
v-if=
"
menu
Value === item.value"
:type=
"item.value"
:courseList=
"shopStore.shopList"
:key=
"index"
/>
<CourseList
v-if=
"
tab
Value === item.value"
:type=
"item.value"
:courseList=
"shopStore.shopList"
:key=
"index"
/>
<
template
v-if=
"shopStore.filters[index]?.children"
>
<
template
v-if=
"shopStore.filters[index]?.children"
>
<div
v-for=
"(cItem, cIndex) in shopStore.filters[index]?.children"
:key=
"cIndex"
>
<div
v-for=
"(cItem, cIndex) in shopStore.filters[index]?.children"
:key=
"cIndex"
>
<CourseList
<CourseList
v-if=
"
menu
Value === cItem.value"
v-if=
"
tab
Value === cItem.value"
:type=
"cItem.value"
:type=
"cItem.value"
:courseList=
"shopStore.shopList"
:courseList=
"shopStore.shopList"
:key=
"index"
:key=
"index"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论