...
|
...
|
@@ -25,20 +25,20 @@ const list = (req, res, next) => { |
|
|
let isQuerySecondClass = false; // 标识用户搜的是不是二级品类
|
|
|
let domain = null;
|
|
|
|
|
|
if (params.query) {
|
|
|
let activity = _.get(searchModel.searchKeyActivity(params.query), 'data.urlobj.appUrl', '');
|
|
|
|
|
|
if (activity) {
|
|
|
res.redirect(activity);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (params.shop_id) {
|
|
|
params.shopId = params.shop_id;
|
|
|
}
|
|
|
|
|
|
if (params.query) {
|
|
|
return searchModel.searchKeyActivity(params.query).then(activityResult => {
|
|
|
let activity = _.get(activityResult, 'urlobj.appUrl', '');
|
|
|
|
|
|
if (activity) {
|
|
|
return res.redirect(activity);
|
|
|
} else {
|
|
|
|
|
|
/* 判断是不是品牌, 是品牌跳到品牌列表页(显示搜索框),判断是不是品类, 是品类加导航标题(不显示搜索框) */
|
|
|
Promise.all([
|
|
|
return Promise.all([
|
|
|
searchModel.getAllBrandNames(),
|
|
|
searchModel.getClassNames()
|
|
|
]).then(result => {
|
...
|
...
|
@@ -125,6 +125,9 @@ const list = (req, res, next) => { |
|
|
pageFooter: true
|
|
|
});
|
|
|
}).catch(next);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -132,6 +135,7 @@ const list = (req, res, next) => { |
|
|
*/
|
|
|
const index = (req, res, next) => {
|
|
|
let title = '搜索';
|
|
|
|
|
|
((render) => {
|
|
|
if (_.get(req, 'app.locals.wap.search.removeHotSearch', false)) {
|
|
|
render([]);
|
...
|
...
|
@@ -156,7 +160,7 @@ const index = (req, res, next) => { |
|
|
}
|
|
|
|
|
|
});
|
|
|
})
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
...
|
...
|
|