...
|
...
|
@@ -9,9 +9,6 @@ const mRoot = '../models'; |
|
|
const search = require(`${mRoot}/search`);
|
|
|
const _ = require('lodash');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const utils = '../../../utils';
|
|
|
const stringCode = require(`${utils}/string-code`);
|
|
|
|
|
|
const config = global.yoho.config;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -175,37 +172,6 @@ const searchLessRecommend = (req, res, next) => { |
|
|
* @param {[type]} res [description]
|
|
|
* @return {[type]} [description]
|
|
|
*/
|
|
|
const keyword = (req, res, next) => {
|
|
|
let params = req.query;
|
|
|
let query = stringCode.hexToUtf8(req.params.id || '');
|
|
|
|
|
|
let resData = {};
|
|
|
|
|
|
return search.getSearchKeywordData(Object.assign(params, {query: query}),
|
|
|
req.yoho.channel).then(result => {
|
|
|
Object.assign(resData, result, {
|
|
|
pageNoFollow: true,
|
|
|
title: `${query}价格_图片_品牌_怎么样-YOHO!BUY有货`,
|
|
|
keywords: `${query},${query}价格,${query}图片,${query}怎么样,${query}品牌,YOHO!BUY有货`,
|
|
|
description: `YOHO!BUY有货网yohobuy.com是国内专业的${query}网上潮流购物商城,为您找到${_.get(result,
|
|
|
'search.totalCount', 0)}条${query}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${query},就上YOHO!BUY有货`
|
|
|
});
|
|
|
|
|
|
if (!_.get(resData, 'search.goods') || !_.get(resData, 'search.goods').length) {
|
|
|
_.set(resData, 'search.keyWord', query);
|
|
|
return res.render('search/no-result', resData);
|
|
|
}
|
|
|
res.render('search/index', resData);
|
|
|
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 搜索推荐列表页
|
|
|
* @param {[type]} req [description]
|
|
|
* @param {[type]} res [description]
|
|
|
* @return {[type]} [description]
|
|
|
*/
|
|
|
const keyId = (req, res, next) => {
|
|
|
let params = req.query;
|
|
|
let id = req.params.id;
|
...
|
...
|
@@ -242,7 +208,6 @@ module.exports = { |
|
|
searchFilterBrands,
|
|
|
searchHistory, // 搜索历史记录
|
|
|
searchLessRecommend,
|
|
|
keyword,
|
|
|
keyId
|
|
|
};
|
|
|
|
...
|
...
|
|