Authored by 徐炜

Merge branch 'prod-list-optimization' into feature/prod-list-opt

# Conflicts:
#	apps/product/controllers/list.js
#	apps/product/controllers/search.js
#	public/js/product/search/list.js
... ... @@ -34,25 +34,25 @@ const list = (req, res, next) => {
if (activity) {
return res.redirect(activity);
} else {
// 获取第一页数据做服务端渲染
let initialData = {
query: query,
type: 'default',
order: '0',
page: 1,
limit: 6,
};
/* 判断是不是品牌, 是品牌跳到品牌列表页(显示搜索框),判断是不是品类, 是品类加导航标题(不显示搜索框) */
return Promise.all([
searchModel.getBrandDomain(query),
searchModel.getClassNames(),
searchModel.getSearchData(initialData)
]).then(result => {
if (query) {
query = query.toLowerCase();
domain = result[0];
// 获取第一页数据做服务端渲染
let initialData = {
query: query,
type: 'default',
order: '0',
page: 1,
limit: 6,
};
/* 判断是不是品牌, 是品牌跳到品牌列表页(显示搜索框),判断是不是品类, 是品类加导航标题(不显示搜索框) */
return Promise.all([
searchModel.getBrandDomain(query),
searchModel.getClassNames(),
searchModel.getSearchData(initialData)
]).then(result => {
if (query) {
query = query.toLowerCase();
domain = result[0];
// 跳转到品牌商品列表页
if (domain !== null && !params.shop_id) {
... ... @@ -106,19 +106,21 @@ const list = (req, res, next) => {
title = params.title ? params.title : title;
res.render('search/list', {
_noLazy: true,
module: 'product',
page: 'search-list',
pageHeader: headerModel.setNav({
navTitle: title
}),
title: title,
goodList: params,
firstPageGoodsList: result[2] || [],
pageFooter: true
});
}).catch(next);
res.render('search/list', {
_noLazy: true,
module: 'product',
page: 'search-list',
pageHeader: headerModel.setNav({
navTitle: title
}),
title: title,
goodList: params,
firstPageGoodsList: result[2] || [],
pageFooter: true
});
}).catch(next);
}
});
};
/**
... ...