Authored by 毕凯

Merge branch 'hotfix/undefined' into 'gray'

Hotfix/undefined



See merge request !1208
@@ -294,20 +294,6 @@ const category = (req, res, next) => { @@ -294,20 +294,6 @@ const category = (req, res, next) => {
294 */ 294 */
295 const listNew = (req, res, next) => { 295 const listNew = (req, res, next) => {
296 let params = _.assign({}, req.query); 296 let params = _.assign({}, req.query);
297 -  
298 - /* 勿修改,唤起 APP 使用 */  
299 - let appParams = _.assign({}, req.query, {  
300 - title: req.query.title || req.query.sort_name || '',  
301 - productPool: req.query.filter_poolId,  
302 - actiontype: req.query.actiontype || '1'  
303 - });  
304 -  
305 - delete appParams.filter_poolId;  
306 -  
307 - let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.list","params":' +  
308 - JSON.stringify(appParams) +  
309 - '}';  
310 -  
311 let uid = req.user.uid; 297 let uid = req.user.uid;
312 298
313 // 获取第一页数据做服务端渲染 299 // 获取第一页数据做服务端渲染
@@ -357,6 +343,20 @@ const listNew = (req, res, next) => { @@ -357,6 +343,20 @@ const listNew = (req, res, next) => {
357 title: categoryIntroRedis[0], 343 title: categoryIntroRedis[0],
358 desc: categoryIntroRedis[1] 344 desc: categoryIntroRedis[1]
359 } : null; 345 } : null;
  346 + let appPath = 'yohobuy://yohobuy.com/goapp';
  347 +
  348 + if (params.gender && params.category_id) {
  349 + let appParams = {
  350 + gender: params.gender,
  351 + title: params.seoTitle,
  352 + category_id: params.category_id,
  353 + actiontype: params.actiontype || '1'
  354 + };
  355 +
  356 + appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.list","params":' +
  357 + JSON.stringify(appParams) +
  358 + '}';
  359 + }
360 360
361 res.render('search/list-new', Object.assign({ 361 res.render('search/list-new', Object.assign({
362 _noLazy: true, // 首屏不使用lazyload 362 _noLazy: true, // 首屏不使用lazyload
@@ -583,13 +583,15 @@ const shop = { @@ -583,13 +583,15 @@ const shop = {
583 params.limit = 24; 583 params.limit = 24;
584 584
585 req.ctx(searchModel).getShopGoods(params).then((result) => { 585 req.ctx(searchModel).getShopGoods(params).then((result) => {
586 - if (result.data.product_list && result.data.product_list.length > 0) {  
587 -  
588 - let product_list = productProcess.processProductList(result.data.product_list || [], {  
589 - isApp: params.isApp || (params.appVersion && params.appVersion !== 'false'),  
590 - gender: _coverChannel[params.coverChannel],  
591 - showSimilar: params.shop_id || params.material === 'true' ? false : true  
592 - }); 586 + let productList = _.get(result, 'data.product_list', []);
  587 +
  588 + if (productList.length > 0) {
  589 + let product_list =
  590 + productProcess.processProductList(productList, {
  591 + isApp: params.isApp || (params.appVersion && params.appVersion !== 'false'),
  592 + gender: _coverChannel[params.coverChannel],
  593 + showSimilar: params.shop_id || params.material === 'true' ? false : true
  594 + });
593 595
594 res.render('search/page', { 596 res.render('search/page', {
595 layout: false, 597 layout: false,