Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴迪
gs1
Commits
e775c8bd
Commit
e775c8bd
authored
Dec 12, 2021
by
林家欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改搜索页显示逻辑
parent
9bca8256
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
26 deletions
+17
-26
index.vue
src/components/layout/header/index.vue
+3
-24
topBanner.vue
src/components/layout/topBanner.vue
+14
-2
No files found.
src/components/layout/header/index.vue
View file @
e775c8bd
...
@@ -74,6 +74,7 @@ import HeaderDropdown from "./HeaderDropdown.vue";
...
@@ -74,6 +74,7 @@ import HeaderDropdown from "./HeaderDropdown.vue";
import
{
nav
}
from
"./mock"
;
import
{
nav
}
from
"./mock"
;
import
Qs
from
"qs"
;
import
Qs
from
"qs"
;
import
{
cleanObject
}
from
"@/axios/parameter"
;
import
{
cleanObject
}
from
"@/axios/parameter"
;
import
{
deepFindBreadcrumb
}
from
"@/utils/utils"
;
export
default
{
export
default
{
components
:
{
HeaderBtn
,
HeaderDropdown
},
components
:
{
HeaderBtn
,
HeaderDropdown
},
...
@@ -103,11 +104,11 @@ export default {
...
@@ -103,11 +104,11 @@ export default {
}
else
{
}
else
{
// TODO 去dropdown里面精确查找当前的路径
// TODO 去dropdown里面精确查找当前的路径
let
result
;
let
result
;
result
=
this
.
comparePath
(
nav_
.
children
,
this
.
$route
.
path
);
result
=
deepFindBreadcrumb
(
nav_
.
children
,
this
.
$route
.
path
);
if
(
!
result
&&
Object
.
keys
(
this
.
$route
.
query
).
length
>
0
)
{
if
(
!
result
&&
Object
.
keys
(
this
.
$route
.
query
).
length
>
0
)
{
const
queryString
=
Qs
.
stringify
(
cleanObject
(
this
.
$route
.
query
));
const
queryString
=
Qs
.
stringify
(
cleanObject
(
this
.
$route
.
query
));
let
path
=
`
${
this
.
$route
.
path
}
?
${
queryString
}
`
;
let
path
=
`
${
this
.
$route
.
path
}
?
${
queryString
}
`
;
result
=
this
.
comparePath
(
nav_
.
children
,
path
);
result
=
deepFindBreadcrumb
(
nav_
.
children
,
path
);
}
}
result
&&
result
&&
result
.
breadcrumb
&&
result
.
breadcrumb
&&
...
@@ -123,28 +124,6 @@ export default {
...
@@ -123,28 +124,6 @@ export default {
window
.
removeEventListener
(
"click"
,
this
.
handleWindowClick
);
window
.
removeEventListener
(
"click"
,
this
.
handleWindowClick
);
},
},
methods
:
{
methods
:
{
comparePath
(
arr
,
activePath
)
{
let
current
=
[];
const
deep
=
(
arr
,
activePath
)
=>
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
+=
1
)
{
if
(
arr
[
i
].
link
!==
activePath
&&
arr
[
i
].
children
&&
arr
[
i
].
children
.
length
>
0
)
{
deep
(
arr
[
i
].
children
,
activePath
);
}
else
if
(
arr
[
i
].
link
===
activePath
)
{
current
=
arr
[
i
];
break
;
}
if
(
current
.
length
>
0
)
{
break
;
}
}
};
deep
(
arr
,
activePath
);
return
current
;
},
handleWindowClick
()
{
handleWindowClick
()
{
// console.log('handleWindowClick', this.fromNav, this.preActive);
// console.log('handleWindowClick', this.fromNav, this.preActive);
if
(
this
.
preActive
&&
!
this
.
fromNav
)
{
if
(
this
.
preActive
&&
!
this
.
fromNav
)
{
...
...
src/components/layout/topBanner.vue
View file @
e775c8bd
...
@@ -16,7 +16,12 @@
...
@@ -16,7 +16,12 @@
<div
class=
"top-banner-item tb-hover"
>
咨询电话:400-7000-690
</div>
<div
class=
"top-banner-item tb-hover"
>
咨询电话:400-7000-690
</div>
<div
class=
"top-banner-item"
>
<div
class=
"top-banner-item"
>
<img
src=
"../../assets/image/head/wx.png"
alt=
""
/>
<img
src=
"../../assets/image/head/wx.png"
alt=
""
/>
<a
class=
"tb-hover"
target=
"_blank"
href=
"http://www.ancc.org.cn/gs1cnweixin.aspx"
>
官方微信
</a>
<a
class=
"tb-hover"
target=
"_blank"
href=
"http://www.ancc.org.cn/gs1cnweixin.aspx"
>
官方微信
</a
>
</div>
</div>
<div
class=
"top-banner-item"
>
<div
class=
"top-banner-item"
>
<img
src=
"../../assets/image/head/xlwb.png"
alt=
""
/>
<img
src=
"../../assets/image/head/xlwb.png"
alt=
""
/>
...
@@ -24,7 +29,7 @@
...
@@ -24,7 +29,7 @@
>
官方微博
</a
>
官方微博
</a
>
>
</div>
</div>
<div
class=
"top-banner-item tb-hover"
>
<div
class=
"top-banner-item tb-hover"
@
click=
"handelSearch"
>
<img
src=
"../../assets/image/head/search.png"
alt=
""
/>
<img
src=
"../../assets/image/head/search.png"
alt=
""
/>
</div>
</div>
</div>
</div>
...
@@ -34,6 +39,13 @@
...
@@ -34,6 +39,13 @@
<
script
>
<
script
>
export
default
{
export
default
{
name
:
"topBanner"
,
name
:
"topBanner"
,
methods
:
{
handelSearch
()
{
this
.
$router
.
push
({
path
:
"/Home/sousuo"
,
});
},
},
};
};
</
script
>
</
script
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment