Authored by 陈峰

hotfix

... ... @@ -879,13 +879,15 @@ module.exports = class extends global.yoho.BaseModel {
let other = _.isFunction(that._articleContentFormat()[key]) ?
that._articleContentFormat()[key](val.data) : '';
// 前五张图片添加alt
if (altNum < 6 && (other.pic || other.smallPic)) {
other.alt = title;
altNum += other.pic ? 1 : other.smallPic.length;
}
if (other) {
// 前五张图片添加alt
if (altNum < 6 && (other.pic || other.smallPic)) {
other.alt = title;
altNum += other.pic ? 1 : other.smallPic.length;
}
content.push(other);
content.push(other);
}
}
});
});
... ...
... ... @@ -334,7 +334,7 @@ class FilterTools {
let {baseUrl, origin, params} = this;
const filter = _.get(origin, 'filter', {});
if (!filter.brand.length) {
if (!filter.brand || !filter.brand.length) {
return false;
}
const brands = [];
... ... @@ -586,26 +586,28 @@ const handleOptSortData = (params, filter, baseUrl) => {
}];
const checks = [];
if (filter.new || params.new === 'Y') {
checks.push({
name: '新品',
checked: params.new === 'Y',
href: handleFilterUrl(baseUrl, params, {new: 'Y'}, params.new === 'Y' ? {new: true} : {})
});
}
if (filter.specialoffer || params.specialoffer === 'Y') {
checks.push({
name: '打折',
checked: params.specialoffer === 'Y',
href: handleFilterUrl(baseUrl, params, {specialoffer: 'Y'}, params.specialoffer === 'Y' ? {specialoffer: true} : {}) // eslint-disable-line
});
}
if (filter.limited || params.limited === 'Y') {
checks.push({
name: '限量',
checked: params.limited === 'Y',
href: handleFilterUrl(baseUrl, params, {limited: 'Y'}, params.limited === 'Y' ? {limited: true} : {})
});
if (filter) {
if (filter.new || params.new === 'Y') {
checks.push({
name: '新品',
checked: params.new === 'Y',
href: handleFilterUrl(baseUrl, params, {new: 'Y'}, params.new === 'Y' ? {new: true} : {})
});
}
if (filter.specialoffer || params.specialoffer === 'Y') {
checks.push({
name: '打折',
checked: params.specialoffer === 'Y',
href: handleFilterUrl(baseUrl, params, {specialoffer: 'Y'}, params.specialoffer === 'Y' ? {specialoffer: true} : {}) // eslint-disable-line
});
}
if (filter.limited || params.limited === 'Y') {
checks.push({
name: '限量',
checked: params.limited === 'Y',
href: handleFilterUrl(baseUrl, params, {limited: 'Y'}, params.limited === 'Y' ? {limited: true} : {})
});
}
}
return {sortType, checks};
};
... ...