Authored by zhangxiaoru

埋点

... ... @@ -32,7 +32,10 @@ var historyval = writeSearch.getHistoryval();
var chHammer, cHammer, navSwiper;
var C_ID, POS_ID, FLR_INDEX;
var C_ID, POS_ID, FLR_INDEX, prdLoad, querys, prdids = [];
var RECID = (new Date().getTime() + '_H5_YOHOBUY_' + Math.floor(Math.random() * 1000000 + 1000000) +
'_' + Math.floor(Math.random() * 1000000 + 1000000));
require('../../common');
... ... @@ -128,6 +131,42 @@ function inputAction() {
C_ID = window._ChannelVary[window.cookie('_Channel')];
function yasRequest(PRD_ID, PRD_NUM, ACTION_ID) {
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_CHOOSE_FOR_YOU_Y',
param: JSON.stringify({
REC_POSE: 100016,
REC_ID: RECID,
PRD_ID: PRD_ID,
PRD_NUM: PRD_NUM,
C_ID: C_ID,
ACTION_ID: ACTION_ID
})
}, true);
}
}
//猜你想找展示时埋点
$('.want-search').find('li').each(function() {
querys = $(this).find('a').html();
if (querys) {
prdids.push(querys);
}
});
prdLoad = JSON.stringify(prdids).replace(/\[|\]|\"|/g, '');
if(prdLoad) {
setTimeout(function() {
yasRequest(prdLoad, prdids.length, 0);
}, 200);
}
// 热门搜索、最近搜索事件
$('.search-items .search-group').on('click', 'li', function(event) {
var query = '';
... ... @@ -143,9 +182,16 @@ $('.search-items .search-group').on('click', 'li', function(event) {
if ($(this).parents('.search-group').hasClass('history-search')) {
POS_ID = 1;
FLR_INDEX = 1;
} else {
} else if ($(this).parents('.search-group').hasClass('hot-search-new')) {
POS_ID = 2;
FLR_INDEX = 2;
} else {
var PRD_NUM = $(this).index() + 1;
POS_ID = 3;
FLR_INDEX = 3;
yasRequest(query, PRD_NUM, 1);
}
if (window._yas && window._yas.sendCustomInfo) {
... ...