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
OF1706
8 years ago
Commit
e24ca4f50a9df35f5ed2b44566e0fe6141fef23a
1 parent
c1987fc7
header api add channel
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
doraemon/models/header.js
doraemon/models/header.js
View file @
e24ca4f
...
...
@@ -191,11 +191,14 @@ const setHeaderData = (resData, type) => (
);
const
getHotSearchAsync
=
()
=>
{
return
api
.
get
(
''
,
{
method
:
'app.search.getTerms'
},
{
const
getHotSearchAsync
=
(
channel
)
=>
{
return
api
.
get
(
''
,
{
method
:
'app.search.getTerms'
,
yh_channel
:
channel
},
{
cache
:
600
,
code
:
200
});
};
const
getHeaderNavAsync
=
()
=>
{
...
...
@@ -215,9 +218,24 @@ exports.requestHeaderData = (type) => {
type
=
type
||
'boys'
;
let
channelNum
=
(
function
()
{
switch
(
type
)
{
case
'boys'
:
return
1
;
case
'girls'
:
return
2
;
case
'kids'
:
case
'lifestyle'
:
return
3
;
default
:
return
1
;
}
}());
return
Promise
.
all
([
getHeaderNavAsync
(),
getHotSearchAsync
()
getHotSearchAsync
(
channelNum
)
]).
then
(
res
=>
{
resData
.
headerData
=
{};
...
...
Please
register
or
login
to post a comment