Authored by 姜枫

fix shop search

@@ -160,6 +160,7 @@ const shop = { @@ -160,6 +160,7 @@ const shop = {
160 limit: 4 160 limit: 4
161 }; 161 };
162 let shopInfo = shopInfoResult; 162 let shopInfo = shopInfoResult;
  163 + let seoResult = listModel.getBrandShopSeo(channel, shopInfoResult, req.query);
163 164
164 /* 基础店铺返回程序内的跳转信号,跳转到基础店铺 */ 165 /* 基础店铺返回程序内的跳转信号,跳转到基础店铺 */
165 if (shopInfoResult && shopInfoResult.shop_template_type && parseInt(shopInfoResult.shop_template_type, 10) === 1) { 166 if (shopInfoResult && shopInfoResult.shop_template_type && parseInt(shopInfoResult.shop_template_type, 10) === 1) {
@@ -204,7 +205,7 @@ const shop = { @@ -204,7 +205,7 @@ const shop = {
204 205
205 let result = listModel.formShopData(shopData, shopId, isApp); 206 let result = listModel.formShopData(shopData, shopId, isApp);
206 207
207 - result = _.assign(result, pageHeader); 208 + result = _.assign(result, pageHeader, {shopId: shopId, coverChannel: channel, seoResult: seoResult});
208 209
209 res.render('newshop/shop-classics', { 210 res.render('newshop/shop-classics', {
210 module: 'product', 211 module: 'product',
@@ -35,13 +35,12 @@ const list = (req, res, next) => { @@ -35,13 +35,12 @@ const list = (req, res, next) => {
35 return res.redirect(activity); 35 return res.redirect(activity);
36 } else { 36 } else {
37 // 获取第一页数据做服务端渲染 37 // 获取第一页数据做服务端渲染
38 - let initialData = {  
39 - query: query, 38 + let initialData = _.assign({
40 type: 'default', 39 type: 'default',
41 order: '0', 40 order: '0',
42 page: 1, 41 page: 1,
43 - limit: 6,  
44 - }; 42 + limit: 6
  43 + }, params);
45 44
46 if (query) { 45 if (query) {
47 query = query.toLowerCase(); 46 query = query.toLowerCase();
@@ -963,5 +963,6 @@ module.exports = { @@ -963,5 +963,6 @@ module.exports = {
963 getBrandFavStatus, 963 getBrandFavStatus,
964 getShopDecorator: _getShopDecorator, 964 getShopDecorator: _getShopDecorator,
965 getShopCategoryApi: _getShopCategory, 965 getShopCategoryApi: _getShopCategory,
966 - formShopData: _formShopData 966 + formShopData: _formShopData,
  967 + getBrandShopSeo: _getBrandShopSeo
967 }; 968 };
@@ -153,6 +153,8 @@ const _searchGoods = (params) => { @@ -153,6 +153,8 @@ const _searchGoods = (params) => {
153 params.app_type = 1; 153 params.app_type = 1;
154 } 154 }
155 155
  156 + console.log(method, params);
  157 +
156 return api.get('', _.assign({ 158 return api.get('', _.assign({
157 method: method 159 method: method
158 }, params), { 160 }, params), {