Authored by 周少峰

Merge branch 'release/5.4' into 'gray'

点击埋点,不延时判断



See merge request !65
... ... @@ -160,12 +160,14 @@ const index = (req) => {
page: req.query.page || 1
});
let cateId = req.query.cateId || '';
let apiMethod = [
headerModel.requestHeaderData(channel),
api.recShop(shopParams),
api.recBrand(params),
api.recList(Object.assign({}, params)),//获取品类
api.recList(recParams)//获取商品数据
api.recList(Object.assign({}, params)), // 获取品类
api.recList(recParams)// 获取商品数据
];
return Promise.all(apiMethod).then(result => {
... ... @@ -260,14 +262,17 @@ const index = (req) => {
_.forEach(group.sub, subSort =>{
let cateObj = {
cateId: subSort.category_id,
url: publicHandler.handleFilterUrl(params, {sort: subSort.relation_parameter.sort}),
url: publicHandler.handleFilterUrl(params, {
sort: subSort.relation_parameter.sort,
cateId: subSort.category_id
}),
name: subSort.category_name,
active: false
};
if (ctyList.length < 20) {
//默认选中判断
if (req.query.sort === subSort.relation_parameter.sort) {
// 默认选中判断
if (cateId === subSort.category_id) {
cateObj.active = true;
}
ctyList.push(cateObj);
... ... @@ -283,7 +288,7 @@ const index = (req) => {
if (result[4].code === 200 && result[4].data) {
// 列表数据
Object.assign(respData.newProduct, _proListHandler(result[4].data,
Object.assign({}, recParams, {channel: channel})));
Object.assign({}, recParams, {channel: channel, cateId: cateId})));
}
// 数据为空,不显示页面模块
... ... @@ -321,6 +326,7 @@ const getRecList = (req) => {
Object.assign(params, {
sort: req.query.sort || '',
cateId: req.query.cateId || '',
page: req.query.page || 1
});
... ...
... ... @@ -122,6 +122,7 @@ function givePoint(op, parameter, flag) {
}
}, 100);
}
exports.givePoint = givePoint;
exports.givePoint = givePoint; // 页面初始化,yas.js 加载完成后埋点
exports.yasEvent = yasEvent; // 直接埋点
exports.getFilterValue = getFilterValue;
... ...
... ... @@ -77,7 +77,7 @@ $('.help-navigation .nav li').on('click', function() {
};
}
yas.givePoint('YB_HELP_MENU_C', yasParams);
yas.yasEvent('YB_HELP_MENU_C', yasParams);
});
module.exports = problemBox;
... ...
... ... @@ -19,7 +19,7 @@ $(function() {
// 公告栏某一公告点击埋点
$('.notice a').on('click', function() {
yas.givePoint('YB_HELP_NOTICE_C', {
yas.yasEvent('YB_HELP_NOTICE_C', {
POS_ID: $(this).data('index'),
POS_NM: $(this).find('.notice-txt').html()
});
... ... @@ -28,7 +28,7 @@ $(function() {
// 帮助中心右侧新手指南某一位置点击埋点
$('.new-guide a').on('click', function() {
yas.givePoint('YB_HELP_GUIDE_C', {
yas.yasEvent('YB_HELP_GUIDE_C', {
POS_ID: $(this).data('index'),
POS_NM: $(this).find('p').html()
});
... ... @@ -36,7 +36,7 @@ $(function() {
// 帮助中心右侧自助服务某一位置点击埋点
$('.self-service a').on('click', function() {
yas.givePoint('YB_HELP_SERVICE_C', {
yas.yasEvent('YB_HELP_SERVICE_C', {
POS_ID: $(this).data('index'),
POS_NM: $(this).find('p').html()
});
... ... @@ -44,7 +44,7 @@ $(function() {
// 帮助中心右侧常见问题某一位置点击埋点
$('.problem a').on('click', function() {
yas.givePoint('YB_HELP_QUESTION_C', {
yas.yasEvent('YB_HELP_QUESTION_C', {
POS_ID: $(this).index() + 1,
POS_NM: $(this).data('ask')
});
... ...
... ... @@ -42,7 +42,7 @@ var helpSearch = {
// 热搜词埋点
$('.search-box .keyword a').on('click', function() {
yas.givePoint('YB_HELP_SEARCH_C', {
yas.yasEvent('YB_HELP_SEARCH_C', {
POS_ID: 2,
POS_NM: '热搜词 ',
KEYWORD: $(this).html()
... ... @@ -50,7 +50,7 @@ var helpSearch = {
});
},
searchYas: function(keyword) { // 搜索框埋点
yas.givePoint('YB_HELP_SEARCH_C', {
yas.yasEvent('YB_HELP_SEARCH_C', {
POS_ID: 1,
POS_NM: '搜索框',
KEYWORD: keyword
... ...
... ... @@ -209,11 +209,11 @@ $(document).on('pjax:complete', function() {
$('html,body').scrollTop($('#new-product-floor').offset().top);
lazyLoad($('img.lazy'));
yas.givePoint('YB_SHOW_NEW_ARRIVAL', loadData);
yas.yasEvent('YB_SHOW_NEW_ARRIVAL', loadData);
});
$('#new-product-floor').on('click', '.catagory-navs li', function() {
var $li = $(this);
$('#new-product-floor').on('click', '.catagory-navs li > a', function() {
var $li = $(this).parent();
if (!$li.hasClass('active')) {
$li.addClass('active').siblings().removeClass('active');
... ... @@ -372,7 +372,7 @@ $(function() {
I_INDEX: parseInt(index, 10) + 1
};
yas.givePoint('YB_NEW_ARRIVAL_FLR_C', option);
yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', option);
});
/* 为您推荐点击埋点*/
... ... @@ -390,7 +390,7 @@ $(function() {
SHOP_ID: $slider.data('shopid').toString()
};
yas.givePoint('YB_NEW_ARRIVAL_FLR_C', option);
yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', option);
});
/* 新品牌入驻点击埋点*/
... ... @@ -408,7 +408,7 @@ $(function() {
SHOP_ID: $slider.data('shopid').toString()
};
yas.givePoint('YB_NEW_ARRIVAL_FLR_C', option);
yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', option);
});
/* 精彩抢先看左侧点击埋点*/
... ... @@ -423,7 +423,7 @@ $(function() {
I_INDEX: parseInt(index, 10) + 1
};
yas.givePoint('YB_NEW_ARRIVAL_FLR_C', option);
yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', option);
});
/* 精彩抢先看右侧点击埋点*/
... ... @@ -438,7 +438,7 @@ $(function() {
I_INDEX: parseInt(index, 10) + 1 + $lookSlider.length
};
yas.givePoint('YB_NEW_ARRIVAL_FLR_C', option);
yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', option);
});
/* 最新上架商品点击埋点*/
... ... @@ -458,7 +458,7 @@ $(function() {
}
$.extend(goodData, getProData($(this).closest('.good-info')));
yas.givePoint('YB_NEW_ARRIVAL_FLR_C', goodData);
yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', goodData);
});
/* 最新上架商品点击埋点*/
... ... @@ -493,6 +493,6 @@ $(function() {
goodData.KEYWORD = $(this).html();
}
$.extend(goodData, getProData($good));
yas.givePoint('YB_NEW_ARRIVAL_FLR_C', goodData);
yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', goodData);
});
});
... ...