Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
8 years ago
Commit
2525fd9769d56aab9356c218b85c129f2f2b6464
1 parent
1134a6d4
shop link bar
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
9 deletions
apps/product/models/shop-handler.js
apps/product/models/shop-handler.js
View file @
2525fd9
...
...
@@ -72,21 +72,27 @@ const goodsTabBar = (data, shopId) => {
new
:
[]
};
_
.
forEach
(
data
.
hot
,
(
value
)
=>
{
if
(
value
.
url
)
{
_
.
forEach
(
_
.
sortBy
(
data
.
hot
,
o
=>
{
return
-
o
.
position
;
}),
(
value
)
=>
{
value
.
url
=
'#'
;
if
(
value
.
url
&&
value
.
position
)
{
dest
.
hot
.
push
({
name
:
value
.
name
,
href
:
value
.
url
url
:
value
.
url
});
}
});
_
.
forEach
(
data
.
new
,
(
value
)
=>
{
if
(
value
.
url
)
{
_
.
forEach
(
_
.
sortBy
(
data
.
new
,
o
=>
{
return
-
o
.
position
;
}),
(
value
)
=>
{
value
.
url
=
'#'
;
if
(
value
.
url
&&
value
.
position
)
{
dest
.
new
.
push
({
name
:
value
.
name
,
href
:
value
.
url
url
:
value
.
url
});
}
});
...
...
@@ -150,9 +156,16 @@ const navigationBar = (data, shopId) => {
}
];
return
{
navigationBar
:
_
.
union
(
shopNav
,
_
.
filter
(
data
,
(
value
)
=>
{
return
value
.
url
;
}))};
_
.
forEach
(
data
,
(
value
)
=>
{
if
(
value
.
url
)
{
shopNav
.
push
({
name
:
value
.
name
,
url
:
`
$
{
value
.
url
}
&
navBar
=
$
{
shopNav
.
length
}
`
});
}
});
return
{
navigationBar
:
shopNav
};
};
/**
...
...
Please
register
or
login
to post a comment