...
|
...
|
@@ -512,7 +512,7 @@ const _formatProduct = (products, arr) => { |
|
|
let goods = {
|
|
|
thumb: helpers.image(val.default_images, 235, 314),
|
|
|
name: val.product_name,
|
|
|
salePrice: val.sales_price,
|
|
|
salesPrice: val.sales_price,
|
|
|
url: helpers.getUrlBySkc(val.product_id, val.goods_list[0].goods_id, val.cn_alphabet)
|
|
|
};
|
|
|
|
...
|
...
|
@@ -592,9 +592,14 @@ const _articleContentFormat = { |
|
|
let pms = getProductList({
|
|
|
query: productSkn.join(',')
|
|
|
}, arr).then(products => {
|
|
|
let p = products.slice(0, 4);
|
|
|
|
|
|
return p;
|
|
|
let pl = [];
|
|
|
|
|
|
if (products && _.isArray(products)) {
|
|
|
pl = products.slice(0, 4);
|
|
|
}
|
|
|
|
|
|
return pl;
|
|
|
});
|
|
|
|
|
|
result.push(pms);
|
...
|
...
|
@@ -665,26 +670,17 @@ const getArticleContent = aid => { |
|
|
}
|
|
|
|
|
|
index = gpromises.length;
|
|
|
|
|
|
return Promise.all(gpromises.concat(ggpromises));
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
|
let goodsResult,
|
|
|
goodsGroupResult;
|
|
|
|
|
|
let goods = [], goodsGroup = [];
|
|
|
|
|
|
goodsResult = res.slice(0, index);
|
|
|
goodsGroupResult = res.slice(index);
|
|
|
|
|
|
for (let gl of goodsResult) {
|
|
|
goods = goods.concat(gl);
|
|
|
}
|
|
|
let goods = _.filter(_.flatten(res.slice(0, index)), function(it) {
|
|
|
return it;
|
|
|
});
|
|
|
|
|
|
for (let ggl of goodsGroupResult) {
|
|
|
goodsGroup = goodsGroup.concat(ggl);
|
|
|
}
|
|
|
let goodsGroup = _.filter(_.flatten(res.slice(index)), function(it) {
|
|
|
return it;
|
|
|
});
|
|
|
|
|
|
if (goods.length > 0) {
|
|
|
content.push({
|
...
|
...
|
|