Authored by ccbikai(👎🏻🍜)

Merge branch 'release/guang'

... ... @@ -72,32 +72,35 @@ const _pageArticleContent = (articleContent, isApp, gender) => {
// 通过SKN获取商品信息
productDetailModel.productInfoBySkns(skns).then((product) => {
if (product.data && product.data.product_list) {
let d = [];
if (product && product.data) {
if (product.data.product_list) {
let d = [];
for (let o = 0; o < product.data.product_list.length; o++) {
let goods = product.data.product_list[o];
for (let o = 0; o < product.data.product_list.length; o++) {
let goods = product.data.product_list[o];
// 最多显示4个
if (o > 3) {
break;
// 最多显示4个
if (o > 3) {
break;
}
d.push(guangProcess.formatProduct(goods, false, true, true, 235, 314, isApp, true, gender));
}
d.push(guangProcess.formatProduct(goods, false, true, true, 235, 314, isApp, true, gender));
d.forEach(p => {
if (arr[p.id]) {
p.thumb = helpers.image(arr[p.id], 235, 314);
reco.push(p);
}
});
}
d.forEach(p => {
if (arr[p.id]) {
p.thumb = helpers.image(arr[p.id], 235, 314);
reco.push(p);
}
});
}
// 多个商品
if (product.data.product_list.length > 1) {
build.relatedReco = reco;
} else if (product.data.product_list.length === 1) { // 单个商品
build.relatedReco = reco[0];
// 多个商品
if (product.data.product_list.length && (product.data.product_list.length > 1)) {
build.relatedReco = reco;
} else if (product.data.product_list.length === 1) { // 单个商品
build.relatedReco = reco[0];
}
}
contents.push(build);
joinContentFunc(++i, len);
});
... ... @@ -120,7 +123,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => {
// 通过SKN获取商品信息
productDetailModel.productInfoBySkns(skns).then((product) => {
if (product.data.product_list) {
if (product && product.data && product.data.product_list) {
let g = [];
product.data.product_list.forEach(_ => {
... ...