Authored by 刘传洋

m

... ... @@ -68,6 +68,7 @@ const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analys
id: it.product_sku,
skn: it.product_skn,
pid: it.product_id,
brandId: it.brand_id,
isChecked: it.selected === 'Y',
productTitle: it.product_name,
imgCover: it.goods_images ? helpers.image(it.goods_images, 64, 88) : '',
... ... @@ -376,6 +377,7 @@ const formatSubPromotionPools = (pools, selectedGiftsList, isAdvance) => {
let goodsListPool = _.map(pools, p => {
let pool = {
poolType: p.pool_type,
goodsList: formatCartGoods(p.goods_list, isAdvance),
promotionInfos: formatPoolPromotionInfos(p.promotion_list, selectedGiftsList)
};
... ... @@ -393,7 +395,9 @@ const formatSubPromotionPools = (pools, selectedGiftsList, isAdvance) => {
});
// [ [goods, goods], [goods, ..], [] ] => [goods, goods ]
return _.flatten(goodsListPool);
// return _.flatten(goodsListPool);
return goodsListPool;
};
/**
... ... @@ -411,11 +415,12 @@ const formatPromotionPools = (pools, selectedGiftsList, isAdvance) => {
};
if (p.sub_pool) {
let goodsWithPromotion = formatSubPromotionPools(p.sub_pool, selectedGiftsList, isAdvance);
pool.subs = formatSubPromotionPools(p.sub_pool, selectedGiftsList, isAdvance);
/*
if (_.isArray(goodsWithPromotion) && goodsWithPromotion.length) {
pool.goodsList = goodsWithPromotion.concat(pool.goodsList);
}
}*/
}
return pool;
... ...
... ... @@ -143,6 +143,17 @@
</div>
{{/if}}
{{#if subs}}
<div class="cart-table">
{{#each subs}}
<ul class="table table-group">
{{#each .}}
{{> cart-item}}
{{/each}}
</ul>
{{/each}}
</div>
{{/if}}
{{#if goodsList}}
<div class="cart-table">
<ul class="table">
... ...
<li class="pre-sell-box tr
{{#isChecked}}active{{/isChecked}}
{{#inValid}}tr-disabled {{#unless sku}}tr-disabled-none{{/unless}}{{/inValid}}"
{{#inValid}}tr-disabled {{#unless sku}}tr-disabled-none{{/unless}}{{/inValid}}
{{#isSamebrandWithNext}} tr-group {{/isSamebrandWithNext}}"
data-role="pitem"
{{#if pid}}data-pid="{{pid}}"{{/if}}
{{#if id}}data-id="{{id}}"{{/if}}
... ...