Authored by 周少峰

Merge branch 'hotfix/cartMvp' into hotfix/studentsText

... ... @@ -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),
... ...
... ... @@ -68,39 +68,4 @@
</div>
</div>
<!-- 商品详细信息窗口 -->
<!--
<script type="text/javascript">
(function (d) {
window.bd_cpro_rtid = "P1fsPWc";
var s = d.createElement("script");
s.type = "text/javascript";
s.async = true;
s.src = location.protocol + "//cpro.baidu.com/cpro/ui/rt.js";
var s0 = d.getElementsByTagName("script")[0];
s0.parentNode.insertBefore(s, s0);
})(document);
</script>
<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>
<script type="text/javascript">
window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
{event: "setAccount", account: 16184},
{event: "setCustomerId", id: "{{uid}}"},
{event: "setSiteType", type: "d"},
{event: "viewBasket", item: {{{cart.criteo}}} }
);
</script>
-->
<!-- 聚效 -->
<!--
<script type="text/javascript">
var _mvq = window._mvq || [];
window._mvq = _mvq;
_mvq.push(['$setAccount', 'm-23428-1']);
_mvq.push(['$setGeneral', 'cartview', '', /*用户名*/ '', '{{uid}}']);
_mvq.push(['$logConversion']);
_mvq.push(['$addItem', '', /*商品id*/ '{{cart.ids}}', '', '']);
_mvq.push(['$logData']);
</script>
-->
{{> cart-analysis}}
... ...
<!-- 商品详细信息窗口 -->
<script type="text/javascript">
(function (d) {
window.bd_cpro_rtid = "P1fsPWc";
var s = d.createElement("script");
s.type = "text/javascript";
s.async = true;
s.src = location.protocol + "//cpro.baidu.com/cpro/ui/rt.js";
var s0 = d.getElementsByTagName("script")[0];
s0.parentNode.insertBefore(s, s0);
})(document);
</script>
<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>
<script type="text/javascript">
window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
{event: "setAccount", account: 16184},
{event: "setCustomerId", id: "{{uid}}"},
{event: "setSiteType", type: "d"},
{event: "viewBasket", item: [
{{# cart.criteo}}
{"id":"{{id}}","quantity":"{{quantity}}","price":"{{price}}"},
{{/ cart.criteo}}
]}
);
</script>
<!-- 聚效 -->
<script type="text/javascript">
var _mvq = window._mvq || [];
window._mvq = _mvq;
_mvq.push(['$setAccount', 'm-23428-1']);
_mvq.push(['$setGeneral', 'cartview', '', /*用户名*/ '', '{{uid}}']);
_mvq.push(['$logConversion']);
_mvq.push(['$addItem', '', /*商品id*/ '{{cart.ids}}', '', '']);
_mvq.push(['$logData']);
</script>
... ...