Authored by 郝肖肖

购物车为您优选埋点

... ... @@ -338,7 +338,7 @@
</div>
<!--凑单商品模板-->
<div class="together"></div>
<div class="histroy"></div>
<div class="histroy givePoint"></div>
{{> cart/cart-medley}}
<!-- 商品信息详情 -->
<div class="goods-detail"></div>
... ...
... ... @@ -184,21 +184,34 @@ togetherProductSource = $('#togetherProduct').html();
togetherProductTemplate = Handlerbars.compile(togetherProductSource);
function getTogetherProduct($obj, url, page) {
var PRDID = [];
$.ajax({
type: 'GET',
dataType: 'json',
url: url,
data: page
}).then(function(d) {
if (d.code === 200) {
if (d.data.item) {
if (d.data.item.length > 0) {
$obj.html(' ');
togetherProductStr = togetherProductTemplate(d.data);
$obj.append($(togetherProductStr));
$('#orderProduct li:last').addClass('end');
$('.gift').removeClass('none');
}
if (d.code === 200 && d.data.item.length > 0) {
$obj.html(' ');
togetherProductStr = togetherProductTemplate(d.data);
$obj.append($(togetherProductStr));
$('#orderProduct li:last').addClass('end');
$('.gift').removeClass('none');
//为您优选埋点
if ($obj.hasClass('givePoint')) {
$.each(d.data.item, function(key, val) {
PRDID.push(val.id);
});
window.givePoint({
'REC_POSE': 120003,
'PRD_ID': PRDID.join(','),
'PRD_NUM': d.data.item.length,
'ACTION_ID': 0,
'page_num': page && page.page ? page.page : 1
});
}
}
});
... ...