...
|
...
|
@@ -20,6 +20,7 @@ const config = global.yoho.config; |
|
|
*/
|
|
|
const index = (req, res, next) => {
|
|
|
let params = req.query;
|
|
|
|
|
|
let resData = {
|
|
|
title: '潮流商品搜索 | YOHO!BUY 有货',
|
|
|
keywords: 'Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,' +
|
...
|
...
|
@@ -43,6 +44,7 @@ const index = (req, res, next) => { |
|
|
return res.render('search/no-result', resData);
|
|
|
}
|
|
|
res.render('search/index', resData);
|
|
|
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
...
|
...
|
@@ -141,27 +143,6 @@ const searchHistory = (req, res) => { |
|
|
res.send(req.query.callback + '(' + JSON.stringify({ data }) + ')');
|
|
|
};
|
|
|
|
|
|
|
|
|
/**
|
|
|
* search 热门搜索和默认搜索
|
|
|
* @param {[type]} req [description]
|
|
|
* @param {[type]} res [description]
|
|
|
* @return {[type]} [description]
|
|
|
*/
|
|
|
const searchRecommend = (req, res, next) => {
|
|
|
search.getSearchRecommend(req.yoho.channel, req.query).then(result => {
|
|
|
let dest = {
|
|
|
code: 200,
|
|
|
message: 'recommend',
|
|
|
data: result || ''
|
|
|
};
|
|
|
|
|
|
res.type('text/javascript');
|
|
|
res.send(req.query.callback + '(' + JSON.stringify(dest) + ')');
|
|
|
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 搜索少或无 有可能喜欢
|
|
|
**/
|
...
|
...
|
@@ -187,6 +168,6 @@ module.exports = { |
|
|
suggest4Old,
|
|
|
searchFilterBrands,
|
|
|
searchHistory, // 搜索历史记录
|
|
|
searchRecommend, // 搜索框下方 热门搜索
|
|
|
searchLessRecommend
|
|
|
};
|
|
|
|
...
|
...
|
|