Authored by 周少峰

Merge branch '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
... ... @@ -203,7 +203,7 @@ const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analys
} else {
// 分析用: 商品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>
... ...
... ... @@ -67,6 +67,22 @@ exports.studentsNum = (data) => {
*/
exports.studentResource = (data) => {
let dest = {couponObj: {}};
let rightsTextObj = [{
rightName: '认证立赠100有货币',
rightContent: '认证成功,立即赠送100有货币。'
},{
rightName: '新品立享9折',
rightContent: '学生购买指定原价新品时,可立即享受9折优惠,此折扣与VIP折扣不可同时享受。'
},{
rightName: '每1元返1个有货币',
rightContent: '学生购买指定商品时,每1元返1个有货币(以商品的实际成交金额计算);<br>' +
'有货币返还时间:确认收货7日后,系统自动将对应数量的有货币返还至购买账户;<br>' +
'有货币有效期:获得当日至次年12月31日,逾期自动作废;<br>' +
'查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细。'
},{
rightName: '分期付款',
rightContent: '开通有货分期后,可享受部分商品30天延后付款,最长6个月的分期付款,开启任性购物模式。'
}];
_.forEach(data, (value) => {
switch (value.template_name) {
... ... @@ -77,6 +93,10 @@ exports.studentResource = (data) => {
Object.assign(dest.couponObj, {couponItem: getCoupon(value.data), floorId: value.template_id});
break;
case 'recommend_content_five':
Object.assign(value.data.list[0], rightsTextObj[0]);
Object.assign(value.data.list[1], rightsTextObj[1]);
Object.assign(value.data.list[2], rightsTextObj[2]);
Object.assign(value.data.list[3], rightsTextObj[3]);
Object.assign(dest, {rightsObj: {rightsItem: value.data.list || {}, floorId: value.template_id}});
break;
case 'image_list':
... ... @@ -99,6 +119,7 @@ exports.studentResource = (data) => {
break;
}
});
_.isEmpty(dest.couponObj) ? delete dest.couponObj : '';
return dest;
};
... ...
... ... @@ -3,6 +3,10 @@
<div class="stu-rights-item">
<img class="" src="{{image2 src w=300 h=300}}">
</img>
<div class="item-content hide">
<p class="item-title">{{rightName}}</p>
<p class="item-detail">{{{rightContent}}}</p>
</div>
</div>
{{/rightsItem}}
</div>
... ...
{
"name": "yohobuy-node",
"version": "5.4.18",
"version": "5.4.20",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -17,7 +17,9 @@ var $sortItem = $('.sort-item'),
$stuYear = $('#stu-entrance-year-show'),
$stuYearWrap = $stuYear.parent(),
$identityForm = $('#identity-form'),
$identityWrap = $('#identity-wrap');
$identityWrap = $('#identity-wrap'),
$rightsItem = $('#stuRights .stu-rights-item'),
rightsText = '';
var $rightDia = $('#rights-dia'),
$couponDia = $('#coupon-dia');
... ... @@ -444,21 +446,17 @@ $couponDia.on('click', function() {
createStuDialog('stu-agree-dialog', cont);
});
$rightsItem.each(function(index,ele) {
var title = $(ele).find('.item-title').html(),
detail = $(ele).find('.item-detail').html(),
i = Number(index) + 1;
rightsText += '<p>权益' + i + ':' + title + '</p><p>' + detail + '</p>';
i !== $rightsItem.length ? rightsText+='<br>' : '';
});
$rightDia.on('click', function() {
var cont = '<h3 class="dia-title">特权详细说明</h3>' +
'<p>权益1:新品立享9折</p>' +
'<p>学生购买指定原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受。</p><br>' +
'<p>权益2:每1元返1个有货币</p>' +
'<p>学生购买指定商品时,以商品的实际成交金额计算,每1元返1个有货币;</p>' +
'<p>返有货币时间:确认收货7日后,系统将自动将对应数量的有货币返至购买账户;</p>' +
'<p>有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>' +
'<p>查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细。</p><br>' +
'<p>权益3:免单抽奖</p>' +
'<p>每月将在累计购物金额最高的学校中,抽取3名幸运学生用户,获得免单资格;</p>' +
'<p>免单用户名单将在每月第1个工作日公布在有货微信公众号上,可关注【有货YOHOBUY】;</p>' +
'<p>免单用户将在中奖次日获得与实付金额等额的现金券,使用时间:中奖当月。</p><br>' +
'<p>权益4:学生专享活动</p>' +
'<p>每月不定期的开展学生专享活动,可打开有货APP推送,及时查收学生专享活动通知。</p>';
var cont = '<h3 class="dia-title">特权详细说明</h3>' + rightsText;
createStuDialog('stu-rights-dialog', cont);
... ... @@ -660,28 +658,6 @@ $(function() {
}, 100);
var rightsFirst = '<div class="item-content hide">' +
'<p class="item-title">新品立享9折</p>' +
'<p>学生购买指定原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受。</p></div>';
var rightsSecond = '<div class="item-content hide">' +
'<p class="item-title">每1元返1个有货币</p>' +
'<p>学生购买指定商品时,以商品的实际成交金额计算,每1元返1个有货币;</p>' +
'<p>返有货币时间:确认收货7日后,系统将自动将对应数量的有货币返至购买账户;</p>' +
'<p>有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>' +
'<p>查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细。</p></div>';
var rightsThird = '<div class="item-content hide">' +
'<p class="item-title">免单抽奖</p>' +
'<p>每月将在累计购物金额最高的学校中,抽取3名幸运学生用户,获得免单资格;</p>' +
'<p>免单用户名单将在每月第1个工作日公布在有货微信公众号上,可关注【有货YOHOBUY】;</p>' +
'<p>免单用户将在中奖次日获得与实付金额等额的现金券,使用时间:中奖当月。</p></div>';
var rightsFourth = '<div class="item-content hide">' +
'<p class="item-title">学生专享活动</p>' +
'<p>每月不定期的开展学生专享活动,可打开有货APP推送,及时查收学生专享活动通知。</p></div>';
$('.coupon > a').each(function() {
couponIds.push($(this).attr('data-id'));
});
... ... @@ -815,14 +791,9 @@ $(function() {
});
// 学生权益,悬浮显示内容
$('#stuRights .stu-rights-item:eq(0)').append(rightsFirst);
$('#stuRights .stu-rights-item:eq(1)').append(rightsSecond);
$('#stuRights .stu-rights-item:eq(2)').append(rightsThird);
$('#stuRights .stu-rights-item:eq(3)').append(rightsFourth);
// 悬浮效果
$('#stuRights .stu-rights-item:eq(0), #stuRights .stu-rights-item:eq(1),' +
'#stuRights .stu-rights-item:eq(2), #stuRights .stu-rights-item:eq(3)').hover(function() {
$rightsItem.hover(function() {
var content = $(this).find('.item-content');
var gapHeight;
... ...
... ... @@ -469,6 +469,7 @@
.stu-good-detail {
position: relative;
overflow: visible;
height: auto;
}
.good-detail-text > .price .stu-tag {
... ...