Authored by yyq

fix service error

... ... @@ -107,50 +107,45 @@ module.exports = class extends global.yoho.BaseModel {
}
// 头部10个品牌小图块 url
if (res.data && res.data instanceof Array && res.data[1].data && res.data[1].data.list) {
_.forEach(res.data[1].data.list, subValue => {
brandAds.push({
name: subValue.name,
src: helpers.image(imgUtils.getImageUrl(
(subValue.src.match(/(\S*)imageView2/)[1] +
'imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/' +
'background/d2hpdGU=/position/center/quality/80'),
136, 57), 136, 57),
url: subValue.url
});
_.forEach(_.get(res, 'data[1].data.list', []), subValue => {
brandAds.push({
name: subValue.name,
src: helpers.image(imgUtils.getImageUrl(
(subValue.src.match(/(\S*)imageView2/)[1] +
'imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/' +
'background/d2hpdGU=/position/center/quality/80'),
136, 57), 136, 57),
url: subValue.url
});
}
});
// 头部品牌图块,广告位
if (res.data && res.data instanceof Array && res.data[0].data) {
_.forEach(res.data[0].data, (subValue, k) => {
let srcUrl;
_.forEach(_.get(res, 'data[0].data', []), (subValue, k) => {
let srcUrl;
// kids lifestyle 第一张图尺寸不同
if (switchParams.channelType === 1 || switchParams.channelType === 2) {
srcUrl = helpers.image(subValue.src, 222, 180, 3);
} else {
srcUrl = (k === 0) ? helpers.image(subValue.src, 570, 280, 3) :
helpers.image(subValue.src, 280, 280, 3);
}
let brandPlusstarItem = {
name: subValue.title,
src: srcUrl,
url: subValue.url
};
// kids lifestyle 第一张图尺寸不同
if (switchParams.channelType === 1 || switchParams.channelType === 2) {
srcUrl = helpers.image(subValue.src, 222, 180, 3);
if (channel === BOYS || channel === GIRLS) {
if (k === 0) {
brandPlusstarItem.url = helpers.urlFormat('/brands/plusstar', {channel: channel});
} else {
srcUrl = (k === 0) ? helpers.image(subValue.src, 570, 280, 3) :
helpers.image(subValue.src, 280, 280, 3);
}
let brandPlusstarItem = {
name: subValue.title,
src: srcUrl,
url: subValue.url
};
if (channel === BOYS || channel === GIRLS) {
if (k === 0) {
brandPlusstarItem.url = helpers.urlFormat('/brands/plusstar', {channel: channel});
} else {
brandPlusstarItem.url = helpers.urlFormat('/brands/plusstar', {id: k, channel: channel});
}
brandPlusstarItem.url = helpers.urlFormat('/brands/plusstar', {id: k, channel: channel});
}
}
brandLogos.push(brandPlusstarItem);
});
}
brandLogos.push(brandPlusstarItem);
});
// 整合brandTop数据结构,boys、girls
if (switchParams.channelType === 1 || switchParams.channelType === 2) {
... ...
... ... @@ -75,6 +75,8 @@ function getSaleGoodsData(params, vipLevel) {
});
}
finalResult.goods = finalResult.goods || [];
// 处理 VIP 商品数据
if (params.saleType === '2') {
_.forEach(finalResult.goods, (value, key) => {
... ...