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
cdb9b995efd439ba469af8651869227e25aa6c2c
1 parent
da06d573
searchTerms sum2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
26 deletions
apps/product/models/search.js
public/js/header.js
apps/product/models/search.js
View file @
cdb9b99
...
...
@@ -193,28 +193,27 @@ exports.getBrands4Filter = (params) => {
* @return {[type]} [description]
*/
exports
.
getSearchRecommend
=
(
channel
,
params
)
=>
{
return
searchApi
.
getSearchRecommend
(
channel
,
params
).
then
(
result
=>
{
if
(
result
.
code
===
200
)
{
let
channelNum
=
1
;
let
channelNum
=
1
;
// -eslint-disable-line
switch
(
channel
)
{
case
'boys'
:
channelNum
=
1
;
break
;
case
'girls'
:
channelNum
=
2
;
break
;
case
'kids'
:
channelNum
=
3
;
break
;
case
'lifestyle'
:
channelNum
=
3
;
break
;
default
:
break
;
}
switch
(
channel
)
{
case
'boys'
:
channelNum
=
1
;
break
;
case
'girls'
:
channelNum
=
2
;
break
;
case
'kids'
:
case
'lifestyle'
:
channelNum
=
3
;
break
;
default
:
break
;
}
return
searchApi
.
getSearchRecommend
(
channelNum
,
params
).
then
(
result
=>
{
if
(
result
.
code
===
200
)
{
let
resData
=
{
hotTerms
:
[]
...
...
public/js/header.js
View file @
cdb9b99
...
...
@@ -934,8 +934,10 @@ $('.search-suggest-history').mouseenter(function() {
* 搜索 热门搜索和默认搜索 api
* @return {[type]} [description]
*/
function
searchSuggestRecommend
(
key
)
{
function
searchSuggestRecommend
(
channel
,
key
)
{
var
param
=
{
channel
:
channel
,
return_type
:
'jsonp'
,
keyword
:
key
};
...
...
@@ -944,15 +946,13 @@ function searchSuggestRecommend(key) {
var
searchSuggestRecommendHtml
;
//eslint-disable-line
if
(
jsonData
.
code
===
200
)
{
if
(
jsonData
.
data
&&
jsonData
.
data
.
hotTerms
.
length
)
{
if
(
jsonData
.
code
==
200
)
{
searchSuggestRecommendHtml
=
handlebars
.
compile
(
$searchRecommendHbs
.
html
()
||
''
);
$searchRecommend
.
html
(
searchSuggestRecommendHtml
(
jsonData
)).
show
();
}
else
{
$searchRecommend
.
hide
();
}
}
else
{
$searchRecommend
.
hide
();
}
});
...
...
Please
register
or
login
to post a comment