Authored by 姜枫

fix collect brand bug

... ... @@ -136,15 +136,17 @@ const favorite = {
};
retData.brandList = data.brandList;
retData.brandList.forEach(b => {
b.newProduct.forEach(p => {
p.url = `${config.siteUrl}/product/pro_${p.productId}_${p.goods[0].id}/${p.cnAlphabet}.html`;
if (retData.brandList) {
retData.brandList.forEach(b => {
b.newProduct.forEach(p => {
p.url = `${config.siteUrl}/product/pro_${p.productId}_${p.goods[0].id}/${p.cnAlphabet}.html`; // eslint-disable-line
});
b.newProduct.push({
more: true
});
b.newProduct = _.chunk(b.newProduct, 4);
});
b.newProduct.push({
more: true
});
b.newProduct = _.chunk(b.newProduct, 4);
});
}
ret.content.favorite.data = retData;
}
... ...
... ... @@ -242,7 +242,10 @@ const helpers = {
o.url = `${config.siteUrl}/product/pro_${g.productId}_${o.goodsId}/${o.cnAlphabet}.html`;
});
}
g.salesPrice = g.salesPrice || g.marketPrice;
if (g.salesPrice === g.marketPrice) {
delete g.marketPrice;
}
g.url = `${config.siteUrl}/product/pro_${g.productId}_${goodsId}/${g.cnAlphabet}.html`;
});
}
... ...