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) => { @@ -34,25 +34,25 @@ const list = (req, res, next) => {
34 if (activity) { 34 if (activity) {
35 return res.redirect(activity); 35 return res.redirect(activity);
36 } else { 36 } else {
37 - // 获取第一页数据做服务端渲染  
38 - let initialData = {  
39 - query: query,  
40 - type: 'default',  
41 - order: '0',  
42 - page: 1,  
43 - limit: 6,  
44 - };  
45 -  
46 - /* 判断是不是品牌, 是品牌跳到品牌列表页(显示搜索框),判断是不是品类, 是品类加导航标题(不显示搜索框) */  
47 - return Promise.all([  
48 - searchModel.getBrandDomain(query),  
49 - searchModel.getClassNames(),  
50 - searchModel.getSearchData(initialData)  
51 - ]).then(result => {  
52 - if (query) {  
53 - query = query.toLowerCase();  
54 -  
55 - domain = result[0]; 37 + // 获取第一页数据做服务端渲染
  38 + let initialData = {
  39 + query: query,
  40 + type: 'default',
  41 + order: '0',
  42 + page: 1,
  43 + limit: 6,
  44 + };
  45 +
  46 + /* 判断是不是品牌, 是品牌跳到品牌列表页(显示搜索框),判断是不是品类, 是品类加导航标题(不显示搜索框) */
  47 + return Promise.all([
  48 + searchModel.getBrandDomain(query),
  49 + searchModel.getClassNames(),
  50 + searchModel.getSearchData(initialData)
  51 + ]).then(result => {
  52 + if (query) {
  53 + query = query.toLowerCase();
  54 +
  55 + domain = result[0];
56 56
57 // 跳转到品牌商品列表页 57 // 跳转到品牌商品列表页
58 if (domain !== null && !params.shop_id) { 58 if (domain !== null && !params.shop_id) {
@@ -106,19 +106,21 @@ const list = (req, res, next) => { @@ -106,19 +106,21 @@ const list = (req, res, next) => {
106 106
107 title = params.title ? params.title : title; 107 title = params.title ? params.title : title;
108 108
109 - res.render('search/list', {  
110 - _noLazy: true,  
111 - module: 'product',  
112 - page: 'search-list',  
113 - pageHeader: headerModel.setNav({  
114 - navTitle: title  
115 - }),  
116 - title: title,  
117 - goodList: params,  
118 - firstPageGoodsList: result[2] || [],  
119 - pageFooter: true  
120 - });  
121 - }).catch(next); 109 + res.render('search/list', {
  110 + _noLazy: true,
  111 + module: 'product',
  112 + page: 'search-list',
  113 + pageHeader: headerModel.setNav({
  114 + navTitle: title
  115 + }),
  116 + title: title,
  117 + goodList: params,
  118 + firstPageGoodsList: result[2] || [],
  119 + pageFooter: true
  120 + });
  121 + }).catch(next);
  122 + }
  123 + });
122 }; 124 };
123 125
124 /** 126 /**