...
|
...
|
@@ -189,7 +189,7 @@ const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analys |
|
|
|
|
|
// 分析用: 商品ID列表
|
|
|
if (_.isArray(_.get(analysis, 'ids'))) {
|
|
|
analysis.ids.push(it.product_id);
|
|
|
analysis.ids.push(it.product_skn);
|
|
|
}
|
|
|
|
|
|
// 分析用: CRITEO
|
...
|
...
|
@@ -460,13 +460,13 @@ const formatPoolPromotionInfos = (infoList, selectedGiftsList) => { |
|
|
/**
|
|
|
* 格式化子优惠池信息,返回商品列表,子优惠列表放在每个商品中
|
|
|
*/
|
|
|
const formatSubPromotionPools = (pools, selectedGiftsList, isAdvance) => {
|
|
|
const formatSubPromotionPools = (pools, selectedGiftsList, isAdvance, analysis) => {
|
|
|
|
|
|
let goodsListPool = _.map(pools, p => {
|
|
|
let pool = {
|
|
|
poolType: p.pool_type,
|
|
|
isBrandGroup: Number(p.pool_type) === 1,
|
|
|
goodsList: formatCartGoods(p.goods_list, isAdvance),
|
|
|
goodsList: formatCartGoods(p.goods_list, isAdvance, false, false, analysis),
|
|
|
promotionInfos: formatPoolPromotionInfos(p.promotion_list, selectedGiftsList)
|
|
|
};
|
|
|
|
...
|
...
|
@@ -492,19 +492,19 @@ const formatSubPromotionPools = (pools, selectedGiftsList, isAdvance) => { |
|
|
* giftsList, priceGifts 已选择的赠品和加价购,判断可选的赠品和加价购是否被选中
|
|
|
* 优惠池
|
|
|
*/
|
|
|
const formatPromotionPools = (pools, selectedGiftsList, isAdvance) => {
|
|
|
const formatPromotionPools = (pools, selectedGiftsList, isAdvance, analysis) => {
|
|
|
return _.map(pools, p => {
|
|
|
|
|
|
let pool = {
|
|
|
poolTitle: p.pool_title,
|
|
|
poolType: p.pool_type,
|
|
|
isBrandGroup: Number(p.pool_type) === 1,
|
|
|
goodsList: formatCartGoods(p.goods_list, isAdvance),
|
|
|
goodsList: formatCartGoods(p.goods_list, isAdvance, false, false, analysis),
|
|
|
promotionInfos: formatPoolPromotionInfos(p.promotion_list, selectedGiftsList)
|
|
|
};
|
|
|
|
|
|
if (p.sub_pool) {
|
|
|
pool.subs = formatSubPromotionPools(p.sub_pool, selectedGiftsList, isAdvance);
|
|
|
pool.subs = formatSubPromotionPools(p.sub_pool, selectedGiftsList, isAdvance, analysis);
|
|
|
|
|
|
/*
|
|
|
if (_.isArray(goodsWithPromotion) && goodsWithPromotion.length) {
|
...
|
...
|
@@ -560,7 +560,7 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => { |
|
|
result.advanceCart = {
|
|
|
// 未参加活动的商品
|
|
|
// goodsList: chelper.formatCartGoods(_.get(advCartData, 'goods_list'), true, false, false, analysisData),
|
|
|
pools: formatPromotionPools(_.get(advCartData, 'goods_pool_list'), null, true),
|
|
|
pools: formatPromotionPools(_.get(advCartData, 'goods_pool_list'), null, true, analysisData),
|
|
|
offShelves: formatOffShelves(_.get(advCartData, 'off_shelves_goods_list'), true, analysisData),
|
|
|
soldOuts: formatSoldOuts(_.get(advCartData, 'sold_out_goods_list'), true, analysisData),
|
|
|
promotionInfos: formatPromotionInfos(_.get(advCartData, 'promotion_info')),
|
...
|
...
|
@@ -585,7 +585,7 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => { |
|
|
// 已选择的全场加价购和赠品
|
|
|
goodsList: goodsList,
|
|
|
|
|
|
pools: formatPromotionPools(_.get(ordCartData, 'goods_pool_list'), goodsList),
|
|
|
pools: formatPromotionPools(_.get(ordCartData, 'goods_pool_list'), goodsList, false, analysisData),
|
|
|
|
|
|
offShelves: formatOffShelves(_.get(ordCartData, 'off_shelves_goods_list'), false, analysisData),
|
|
|
soldOuts: formatSoldOuts(_.get(ordCartData, 'sold_out_goods_list'), false, analysisData),
|
...
|
...
|
|