Authored by 郭成尧

'base-shop'

@@ -67,6 +67,7 @@ const _shop = (req, res, shopId) => { @@ -67,6 +67,7 @@ const _shop = (req, res, shopId) => {
67 67
68 listModel.getShopData(req, shopId, uid, isApp).then((result) => { 68 listModel.getShopData(req, shopId, uid, isApp).then((result) => {
69 if (result.goBrand) { 69 if (result.goBrand) {
  70 +
70 // 跳转基础模板 71 // 跳转基础模板
71 _baseShop(req, res, result.goBrand); 72 _baseShop(req, res, result.goBrand);
72 } else { 73 } else {
@@ -398,19 +398,20 @@ const getBaseShopData = (params) => { @@ -398,19 +398,20 @@ const getBaseShopData = (params) => {
398 _getShopDecorator(params.shop_id), 398 _getShopDecorator(params.shop_id),
399 getShopBrands(params.shop_id) 399 getShopBrands(params.shop_id)
400 ]).then(result => { 400 ]).then(result => {
401 - result[0] = result[0] || {};  
402 401
403 - _.forEach(result[0].list, item => {  
404 - if (item.resourceName === 'shopTopBanner_base') {  
405 - let banner = JSON.parse(item.resourceData); 402 + if (result[0] && _.has(result[0], 'list')) {
  403 + _.forEach(result[0].list, item => {
  404 + if (item.resourceName === 'shopTopBanner_base') {
  405 + let banner = JSON.parse(item.resourceData);
406 406
407 - finalResult = _.assign(finalResult, {  
408 - shopBanner: {  
409 - banner: banner[0].shopSrc  
410 - }  
411 - });  
412 - }  
413 - }); 407 + finalResult = _.assign(finalResult, {
  408 + baseShopHome: {
  409 + banner: _.get(banner, 'banner[0].shopSrc', '')
  410 + }
  411 + });
  412 + }
  413 + });
  414 + }
414 415
415 if (params.multBrandShopType === '2') { 416 if (params.multBrandShopType === '2') {
416 // 转义店铺 417 // 转义店铺