yas-bottom.js
2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
var $ = require('yoho-jquery');
var yas = require('../common/data-yas');
exports.yasBottom = function() {
/* 获取商品编码*/
function getPrdId() {
return +$('.main').data('id');
}
/* 点击商品详情页模块导航时埋点*/
$('.shoppingCar .shoppingCar-nav ul').on('click', 'li', function() {
var $this = $(this);
var $index = $this.index() + 1;
yas.givePoint('YB_GDS_NAVIGATION_C', {PRD_ID: getPrdId(), NAV_INDE: $index});
});
/* 点击商品评价模块中的全部/有图/图片时埋点*/
$('.cc-content .comment-tabs').on('click', 'h2', function() {
var $this = $(this);
var $index = $this.index() + 1;
yas.givePoint('YB_GDS_REVIEWS_TAB_C', {PRD_ID: getPrdId(), POS_ID: $index});
});
$('.comments').on('click', '.img-preview .img-thumb', function() {
yas.givePoint('YB_GDS_REVIEWS_TAB_C', {PRD_ID: getPrdId(), POS_ID: 3});
});
/* 点击商品详情页中的【我要咨询】时埋点*/
$('#common-advice').click(function() {
yas.givePoint('YB_GDS_CONSULT_C', {PRD_ID: getPrdId()});
});
/* 点击商品详情页底部店铺推荐和最近浏览TAB时埋点*/
$('.bottom-tab p').on('click', 'span', function() {
var $this = $(this);
var $index = $this.index() + 1;
if ($index !== 3) {
yas.givePoint('YB_GDS_RECOMMEND_REVIEW_TAB_C', {PRD_ID: getPrdId(), TAB_ID: $index});
}
});
/* 点击商品详情页底部店铺推荐和最近浏览中的商品时*/
$('.recommend-content .img-list').on('click', 'li', function() {
var $this = $(this);
var relatedID = +$this.find('.goods-id').text();
var option = {
PRD_ID: getPrdId(),
RELATED_ID: relatedID,
TAB_ID: 1
};
yas.givePoint('YB_GDS_RECOMMEND_REVIEW_GOODS_C', option);
});
$('#latest-walk-goods').on('click', '.good', function() {
var $this = $(this);
var relatedID = +$this.find('a').attr('href').split('_')[1];
var option = {
PRD_ID: getPrdId(),
RELATED_ID: relatedID,
TAB_ID: 2
};
yas.givePoint('YB_GDS_RECOMMEND_REVIEW_GOODS_C', option);
});
/* 点击商品详情页底部店铺推荐和最近浏览中的【换一换】按钮时埋点*/
$('.bottom-tab .change').click(function() {
yas.givePoint('YB_GDS_RECOMMEND_REVIEW_CHANGE_C', {PRD_ID: getPrdId(), TAB_ID: 1});
});
};