Authored by yyq

analysis

@@ -189,7 +189,7 @@ const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analys @@ -189,7 +189,7 @@ const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analys
189 189
190 // 分析用: 商品ID列表 190 // 分析用: 商品ID列表
191 if (_.isArray(_.get(analysis, 'ids'))) { 191 if (_.isArray(_.get(analysis, 'ids'))) {
192 - analysis.ids.push(it.product_id); 192 + analysis.ids.push(it.product_skn);
193 } 193 }
194 194
195 // 分析用: CRITEO 195 // 分析用: CRITEO
@@ -460,13 +460,13 @@ const formatPoolPromotionInfos = (infoList, selectedGiftsList) => { @@ -460,13 +460,13 @@ const formatPoolPromotionInfos = (infoList, selectedGiftsList) => {
460 /** 460 /**
461 * 格式化子优惠池信息,返回商品列表,子优惠列表放在每个商品中 461 * 格式化子优惠池信息,返回商品列表,子优惠列表放在每个商品中
462 */ 462 */
463 -const formatSubPromotionPools = (pools, selectedGiftsList, isAdvance) => { 463 +const formatSubPromotionPools = (pools, selectedGiftsList, isAdvance, analysis) => {
464 464
465 let goodsListPool = _.map(pools, p => { 465 let goodsListPool = _.map(pools, p => {
466 let pool = { 466 let pool = {
467 poolType: p.pool_type, 467 poolType: p.pool_type,
468 isBrandGroup: Number(p.pool_type) === 1, 468 isBrandGroup: Number(p.pool_type) === 1,
469 - goodsList: formatCartGoods(p.goods_list, isAdvance), 469 + goodsList: formatCartGoods(p.goods_list, isAdvance, false, false, analysis),
470 promotionInfos: formatPoolPromotionInfos(p.promotion_list, selectedGiftsList) 470 promotionInfos: formatPoolPromotionInfos(p.promotion_list, selectedGiftsList)
471 }; 471 };
472 472
@@ -492,19 +492,19 @@ const formatSubPromotionPools = (pools, selectedGiftsList, isAdvance) => { @@ -492,19 +492,19 @@ const formatSubPromotionPools = (pools, selectedGiftsList, isAdvance) => {
492 * giftsList, priceGifts 已选择的赠品和加价购,判断可选的赠品和加价购是否被选中 492 * giftsList, priceGifts 已选择的赠品和加价购,判断可选的赠品和加价购是否被选中
493 * 优惠池 493 * 优惠池
494 */ 494 */
495 -const formatPromotionPools = (pools, selectedGiftsList, isAdvance) => { 495 +const formatPromotionPools = (pools, selectedGiftsList, isAdvance, analysis) => {
496 return _.map(pools, p => { 496 return _.map(pools, p => {
497 497
498 let pool = { 498 let pool = {
499 poolTitle: p.pool_title, 499 poolTitle: p.pool_title,
500 poolType: p.pool_type, 500 poolType: p.pool_type,
501 isBrandGroup: Number(p.pool_type) === 1, 501 isBrandGroup: Number(p.pool_type) === 1,
502 - goodsList: formatCartGoods(p.goods_list, isAdvance), 502 + goodsList: formatCartGoods(p.goods_list, isAdvance, false, false, analysis),
503 promotionInfos: formatPoolPromotionInfos(p.promotion_list, selectedGiftsList) 503 promotionInfos: formatPoolPromotionInfos(p.promotion_list, selectedGiftsList)
504 }; 504 };
505 505
506 if (p.sub_pool) { 506 if (p.sub_pool) {
507 - pool.subs = formatSubPromotionPools(p.sub_pool, selectedGiftsList, isAdvance); 507 + pool.subs = formatSubPromotionPools(p.sub_pool, selectedGiftsList, isAdvance, analysis);
508 508
509 /* 509 /*
510 if (_.isArray(goodsWithPromotion) && goodsWithPromotion.length) { 510 if (_.isArray(goodsWithPromotion) && goodsWithPromotion.length) {
@@ -560,7 +560,7 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => { @@ -560,7 +560,7 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => {
560 result.advanceCart = { 560 result.advanceCart = {
561 // 未参加活动的商品 561 // 未参加活动的商品
562 // goodsList: chelper.formatCartGoods(_.get(advCartData, 'goods_list'), true, false, false, analysisData), 562 // goodsList: chelper.formatCartGoods(_.get(advCartData, 'goods_list'), true, false, false, analysisData),
563 - pools: formatPromotionPools(_.get(advCartData, 'goods_pool_list'), null, true), 563 + pools: formatPromotionPools(_.get(advCartData, 'goods_pool_list'), null, true, analysisData),
564 offShelves: formatOffShelves(_.get(advCartData, 'off_shelves_goods_list'), true, analysisData), 564 offShelves: formatOffShelves(_.get(advCartData, 'off_shelves_goods_list'), true, analysisData),
565 soldOuts: formatSoldOuts(_.get(advCartData, 'sold_out_goods_list'), true, analysisData), 565 soldOuts: formatSoldOuts(_.get(advCartData, 'sold_out_goods_list'), true, analysisData),
566 promotionInfos: formatPromotionInfos(_.get(advCartData, 'promotion_info')), 566 promotionInfos: formatPromotionInfos(_.get(advCartData, 'promotion_info')),
@@ -585,7 +585,7 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => { @@ -585,7 +585,7 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => {
585 // 已选择的全场加价购和赠品 585 // 已选择的全场加价购和赠品
586 goodsList: goodsList, 586 goodsList: goodsList,
587 587
588 - pools: formatPromotionPools(_.get(ordCartData, 'goods_pool_list'), goodsList), 588 + pools: formatPromotionPools(_.get(ordCartData, 'goods_pool_list'), goodsList, false, analysisData),
589 589
590 offShelves: formatOffShelves(_.get(ordCartData, 'off_shelves_goods_list'), false, analysisData), 590 offShelves: formatOffShelves(_.get(ordCartData, 'off_shelves_goods_list'), false, analysisData),
591 soldOuts: formatSoldOuts(_.get(ordCartData, 'sold_out_goods_list'), false, analysisData), 591 soldOuts: formatSoldOuts(_.get(ordCartData, 'sold_out_goods_list'), false, analysisData),
@@ -68,39 +68,4 @@ @@ -68,39 +68,4 @@
68 </div> 68 </div>
69 </div> 69 </div>
70 70
71 -<!-- 商品详细信息窗口 -->  
72 -<!--  
73 -<script type="text/javascript">  
74 - (function (d) {  
75 - window.bd_cpro_rtid = "P1fsPWc";  
76 - var s = d.createElement("script");  
77 - s.type = "text/javascript";  
78 - s.async = true;  
79 - s.src = location.protocol + "//cpro.baidu.com/cpro/ui/rt.js";  
80 - var s0 = d.getElementsByTagName("script")[0];  
81 - s0.parentNode.insertBefore(s, s0);  
82 - })(document);  
83 -</script>  
84 -<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>  
85 -<script type="text/javascript">  
86 - window.criteo_q = window.criteo_q || [];  
87 - window.criteo_q.push(  
88 - {event: "setAccount", account: 16184},  
89 - {event: "setCustomerId", id: "{{uid}}"},  
90 - {event: "setSiteType", type: "d"},  
91 - {event: "viewBasket", item: {{{cart.criteo}}} }  
92 - );  
93 -</script>  
94 --->  
95 -<!-- 聚效 -->  
96 -<!--  
97 -<script type="text/javascript">  
98 - var _mvq = window._mvq || [];  
99 - window._mvq = _mvq;  
100 - _mvq.push(['$setAccount', 'm-23428-1']);  
101 - _mvq.push(['$setGeneral', 'cartview', '', /*用户名*/ '', '{{uid}}']);  
102 - _mvq.push(['$logConversion']);  
103 - _mvq.push(['$addItem', '', /*商品id*/ '{{cart.ids}}', '', '']);  
104 - _mvq.push(['$logData']);  
105 -</script>  
106 ---> 71 + {{> cart-analysis}}
  1 +<!-- 商品详细信息窗口 -->
  2 +<script type="text/javascript">
  3 + (function (d) {
  4 + window.bd_cpro_rtid = "P1fsPWc";
  5 + var s = d.createElement("script");
  6 + s.type = "text/javascript";
  7 + s.async = true;
  8 + s.src = location.protocol + "//cpro.baidu.com/cpro/ui/rt.js";
  9 + var s0 = d.getElementsByTagName("script")[0];
  10 + s0.parentNode.insertBefore(s, s0);
  11 + })(document);
  12 +</script>
  13 +<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>
  14 +<script type="text/javascript">
  15 + window.criteo_q = window.criteo_q || [];
  16 + window.criteo_q.push(
  17 + {event: "setAccount", account: 16184},
  18 + {event: "setCustomerId", id: "{{uid}}"},
  19 + {event: "setSiteType", type: "d"},
  20 + {event: "viewBasket", item: [
  21 + {{# cart.criteo}}
  22 + {"id":"{{id}}","quantity":"{{quantity}}","price":"{{price}}"},
  23 + {{/ cart.criteo}}
  24 + ]}
  25 + );
  26 +</script>
  27 +<!-- 聚效 -->
  28 +<script type="text/javascript">
  29 + var _mvq = window._mvq || [];
  30 + window._mvq = _mvq;
  31 + _mvq.push(['$setAccount', 'm-23428-1']);
  32 + _mvq.push(['$setGeneral', 'cartview', '', /*用户名*/ '', '{{uid}}']);
  33 + _mvq.push(['$logConversion']);
  34 + _mvq.push(['$addItem', '', /*商品id*/ '{{cart.ids}}', '', '']);
  35 + _mvq.push(['$logData']);
  36 +</script>