Authored by OF1706

searchTerms sum2

... ... @@ -193,11 +193,8 @@ exports.getBrands4Filter = (params) => {
* @return {[type]} [description]
*/
exports.getSearchRecommend = (channel, params) => {
return searchApi.getSearchRecommend(channel, params).then(result => {
if (result.code === 200) {
let channelNum = 1; // -eslint-disable-line
let channelNum = 1;
switch (channel) {
case 'boys':
... ... @@ -207,8 +204,6 @@ exports.getSearchRecommend = (channel, params) => {
channelNum = 2;
break;
case 'kids':
channelNum = 3;
break;
case 'lifestyle':
channelNum = 3;
break;
... ... @@ -216,6 +211,10 @@ exports.getSearchRecommend = (channel, params) => {
break;
}
return searchApi.getSearchRecommend(channelNum, params).then(result => {
if (result.code === 200) {
let resData = {
hotTerms: []
};
... ...
... ... @@ -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,16 +946,14 @@ 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 {
}else{
$searchRecommend.hide();
}
}
});
}
... ...