Authored by 陈峰

hotfix

@@ -879,13 +879,15 @@ module.exports = class extends global.yoho.BaseModel { @@ -879,13 +879,15 @@ module.exports = class extends global.yoho.BaseModel {
879 let other = _.isFunction(that._articleContentFormat()[key]) ? 879 let other = _.isFunction(that._articleContentFormat()[key]) ?
880 that._articleContentFormat()[key](val.data) : ''; 880 that._articleContentFormat()[key](val.data) : '';
881 881
882 - // 前五张图片添加alt  
883 - if (altNum < 6 && (other.pic || other.smallPic)) {  
884 - other.alt = title;  
885 - altNum += other.pic ? 1 : other.smallPic.length;  
886 - } 882 + if (other) {
  883 + // 前五张图片添加alt
  884 + if (altNum < 6 && (other.pic || other.smallPic)) {
  885 + other.alt = title;
  886 + altNum += other.pic ? 1 : other.smallPic.length;
  887 + }
887 888
888 - content.push(other); 889 + content.push(other);
  890 + }
889 } 891 }
890 }); 892 });
891 }); 893 });
@@ -334,7 +334,7 @@ class FilterTools { @@ -334,7 +334,7 @@ class FilterTools {
334 let {baseUrl, origin, params} = this; 334 let {baseUrl, origin, params} = this;
335 const filter = _.get(origin, 'filter', {}); 335 const filter = _.get(origin, 'filter', {});
336 336
337 - if (!filter.brand.length) { 337 + if (!filter.brand || !filter.brand.length) {
338 return false; 338 return false;
339 } 339 }
340 const brands = []; 340 const brands = [];
@@ -586,26 +586,28 @@ const handleOptSortData = (params, filter, baseUrl) => { @@ -586,26 +586,28 @@ const handleOptSortData = (params, filter, baseUrl) => {
586 }]; 586 }];
587 const checks = []; 587 const checks = [];
588 588
589 - if (filter.new || params.new === 'Y') {  
590 - checks.push({  
591 - name: '新品',  
592 - checked: params.new === 'Y',  
593 - href: handleFilterUrl(baseUrl, params, {new: 'Y'}, params.new === 'Y' ? {new: true} : {})  
594 - });  
595 - }  
596 - if (filter.specialoffer || params.specialoffer === 'Y') {  
597 - checks.push({  
598 - name: '打折',  
599 - checked: params.specialoffer === 'Y',  
600 - href: handleFilterUrl(baseUrl, params, {specialoffer: 'Y'}, params.specialoffer === 'Y' ? {specialoffer: true} : {}) // eslint-disable-line  
601 - });  
602 - }  
603 - if (filter.limited || params.limited === 'Y') {  
604 - checks.push({  
605 - name: '限量',  
606 - checked: params.limited === 'Y',  
607 - href: handleFilterUrl(baseUrl, params, {limited: 'Y'}, params.limited === 'Y' ? {limited: true} : {})  
608 - }); 589 + if (filter) {
  590 + if (filter.new || params.new === 'Y') {
  591 + checks.push({
  592 + name: '新品',
  593 + checked: params.new === 'Y',
  594 + href: handleFilterUrl(baseUrl, params, {new: 'Y'}, params.new === 'Y' ? {new: true} : {})
  595 + });
  596 + }
  597 + if (filter.specialoffer || params.specialoffer === 'Y') {
  598 + checks.push({
  599 + name: '打折',
  600 + checked: params.specialoffer === 'Y',
  601 + href: handleFilterUrl(baseUrl, params, {specialoffer: 'Y'}, params.specialoffer === 'Y' ? {specialoffer: true} : {}) // eslint-disable-line
  602 + });
  603 + }
  604 + if (filter.limited || params.limited === 'Y') {
  605 + checks.push({
  606 + name: '限量',
  607 + checked: params.limited === 'Y',
  608 + href: handleFilterUrl(baseUrl, params, {limited: 'Y'}, params.limited === 'Y' ? {limited: true} : {})
  609 + });
  610 + }
609 } 611 }
610 return {sortType, checks}; 612 return {sortType, checks};
611 }; 613 };