...
|
...
|
@@ -195,7 +195,12 @@ function reMarginFooter(fixedElement) { |
|
|
'cdn.yoho.cn/yas-jssdk/1.0.15/yas-debug.js', '_yas');
|
|
|
|
|
|
(function() {
|
|
|
var uid = getUid();
|
|
|
var uid = getUid(),
|
|
|
hasParentBp = false, // 判断是否有父级埋点,如果有,点击子埋点,不处罚父埋点。
|
|
|
basicBpDataLength = 3;
|
|
|
|
|
|
var sendBpData,
|
|
|
bindBpEvent;
|
|
|
|
|
|
uid = uid === 0 ? '' : uid;
|
|
|
|
...
|
...
|
@@ -203,31 +208,68 @@ function reMarginFooter(fixedElement) { |
|
|
|
|
|
if (window._yas) {
|
|
|
window._yas(1 * new Date(), '1.0.15', 'yohobuy_m', uid, '', '');
|
|
|
$(document).on('click', 'a.buriedpoint', function(e) {
|
|
|
var bpIdArr = $(this).attr('data-bp-id').split('_');
|
|
|
var jsonData = {
|
|
|
page: bpIdArr[0],
|
|
|
floor: bpIdArr[1],
|
|
|
data: bpIdArr[2]
|
|
|
};
|
|
|
|
|
|
window._yas.sendCustomInfo(jsonData, Boolean(parseInt(bpIdArr[3])));
|
|
|
document.location.href = $(this).attr('href');
|
|
|
|
|
|
// 发送埋点数据
|
|
|
sendBpData = function(bpIdArr) {
|
|
|
var jsonData = {};
|
|
|
|
|
|
if (bpIdArr && (bpIdArr && bpIdArr.length > basicBpDataLength)) {
|
|
|
jsonData = {
|
|
|
page: bpIdArr[0],
|
|
|
floor: bpIdArr[1],
|
|
|
data: bpIdArr[2]
|
|
|
};
|
|
|
|
|
|
window._yas.sendCustomInfo(jsonData, Boolean(parseInt(bpIdArr[3]) || 1));
|
|
|
}
|
|
|
};
|
|
|
|
|
|
// 绑定埋点点击事件
|
|
|
bindBpEvent = function() {
|
|
|
hasParentBp = false;
|
|
|
$(document).off('click').on('click', '.buriedpoint', function(e) {
|
|
|
var databpid = $(this).attr('data-bp-id') || '',
|
|
|
bpIdArr = databpid.split('_');
|
|
|
|
|
|
if (!hasParentBp && bpIdArr && bpIdArr.length >= basicBpDataLength) {
|
|
|
sendBpData(bpIdArr);
|
|
|
} else {
|
|
|
hasParentBp = false;
|
|
|
}
|
|
|
if ($(e.target).closest('.buriedpoint').length >= 1) {
|
|
|
hasParentBp = true;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
bindBpEvent();
|
|
|
|
|
|
// 对异步加载的埋点,绑定埋点事件
|
|
|
$(document).on('rebindBpEvent', bindBpEvent);
|
|
|
|
|
|
// 处理无法直接绑定的埋点
|
|
|
$(document).on('shouldSendBpData', function(e, dataPbId) {
|
|
|
var bpIdArr;
|
|
|
|
|
|
if (dataPbId && (dataPbId.length && dataPbId.length > 0)) {
|
|
|
hasParentBp = false;
|
|
|
bpIdArr = dataPbId.split('_');
|
|
|
sendBpData(bpIdArr);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}());
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
/*$(document).ready(function() {
|
|
|
setTimeout(function() {
|
|
|
var arr = document.querySelectorAll('a.buriedpoint'),
|
|
|
var arr = document.querySelectorAll('.buriedpoint').find('a'),
|
|
|
i;
|
|
|
|
|
|
for (i = 0; i < arr.length; i++) {
|
|
|
arr[i].setAttribute('onclick', 'return false');
|
|
|
}
|
|
|
}, 2000);
|
|
|
});
|
|
|
|
|
|
});*/
|
|
|
$header.on('touchstart', 'a', function() {
|
|
|
$header.find('a').removeClass('highlight');
|
|
|
$(this).addClass('highlight');
|
...
|
...
|
|