Authored by 郝肖肖

潮流优选,楼层banner埋点

... ... @@ -88,10 +88,11 @@ const getResources = (params, options) => {
};
if (res.focus_type * 1 === 1) {
data.focus1 = [];
data.focus1.push(list);
data.focus1 = list;
data.focus1.id = res.template_id;
} else {
data.focus2 = list;
data.focus1.id = res.template_id;
}
break;
... ...
<div class="resources">
<!--banner-->
{{#each result.focus1}}
{{#if result.focus1}}
<div class="banner-top">
<div class="banner-swiper swiper-container">
<ul class="swiper-wrapper">
{{#each data}}
<ul class="swiper-wrapper" data-id={{result.focus1.id}}>
{{#each result.focus1.data}}
{{#if @first}}
<li class="swiper-slide">
<a href="{{url}}">
... ... @@ -27,7 +27,7 @@
</div>
</div>
</div>
{{/each}}
{{/if}}
{{#each result.title_image}}
<div class="header-title">
... ...
... ... @@ -14,6 +14,8 @@ var $footer = $('#yoho-footer'),
var RECID = (new Date().getTime() + '_H5_YOHOBUY_' + Math.floor(Math.random() * 1000000 + 1000000) +
'_' + Math.floor(Math.random() * 1000000 + 1000000));
var _ChannelVary = {boys: 1, girls: 2, kids: 3, lifestyle: 4};
function cookie(name) {
var cookies = document.cookie,
cookieVal,
... ... @@ -307,22 +309,7 @@ function givePoint(parameter) {
}
// 男:1,女:2,潮童:3,创意生活:4
switch (cookie('_Channel')) {
case 'boys':
CID = 1;
break;
case 'girls':
CID = 2;
break;
case 'kids':
CID = 3;
break;
case 'lifestyle':
CID = 4;
break;
default:
CID = 1;
}
CID = _ChannelVary[cookie('_Channel')] || 1;
parameter = $.extend({
REC_POSE: '',
... ... @@ -365,3 +352,5 @@ window.reMarginFooter = reMarginFooter;
window.queryString = queryString();
window.givePoint = givePoint;
window._ChannelVary = _ChannelVary;
... ...
... ... @@ -11,7 +11,8 @@ var plusstar = {},
var windowHeight = $(window).height();
var scrollFn,
scrollTop,
RECPOSE;
RECPOSE,
CID;
require('../common');
... ... @@ -50,7 +51,19 @@ plusstar = {
$(this).find('li').removeClass('focus');
$liDom.addClass('focus');
that.ParentLiDom = $liDom;// 保留当前tab先中的对象
that.tabNav($liDom.data('code'));
// 点击潮流优选上方的TAB按钮时
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_FASHION_HOME_L',
param: JSON.stringify({
C_ID: CID,
TAB_ID: $liDom.index() + 1
})
}, true);
}
});
// start -- 默认选中
... ... @@ -64,9 +77,20 @@ plusstar = {
that.tabNav($liDom.data('code'));
// ent -- 默认选中
that.ParentLiDom = $liDom;// 保留当前tab先中的对象
setTimeout(function() {
that._yas();
}, 1000);
},
_yas: function() {
var that = this;
if (!window._yas || !window._yas.sendCustomInfo) {
return false;
}
// 商品单击埋点
RECPOSE = $liDom.index() === 0 ? 100014 : 100015;
RECPOSE = that.ParentLiDom.index() !== 0 ? 100015 : 100014;
$('.plusstar-resources').bind('click', function(event) {
var $goodInfo = $(event.target).closest('.good-info'),
... ... @@ -83,6 +107,36 @@ plusstar = {
page_num: Math.ceil(index / that.common.pagesize)
});
});
// 潮流优选首页加载时
window._yas.sendCustomInfo({
op: 'YB_FASHION_HOME_L',
param: JSON.stringify({
C_ID: CID,
TAB_ID: that.ParentLiDom.index() + 1
})
}, true);
// 头部banner楼层埋点
$('.plusstar-resources .banner-top').find('ul').bind('click', function(event) {
var $dom = $(event.target).closest('.li'),
index;
index = $dom.index() + 1;
window._yas.sendCustomInfo({
op: 'YB_FASHION_HOME_L',
param: JSON.stringify({
C_ID: CID,
TAB_ID: that.ParentLiDom.index() + 1,
F_ID: $(this).data('id'),
F_NAME: '焦点图',
F_URL: $dom.find('a').attr('href'),
F_INDEX: 1,
I_INDEX: index
})
}, true);
});
},
tabNav: function(code) {
var that = this;
... ... @@ -215,6 +269,9 @@ scrollFn = debounce(function() {
}, 200);
$(function() {
// 男:1,女:2,潮童:3,创意生活:4
CID = window._ChannelVary[window.cookie('_Channel')] || 1;
if (!(window.queryString.app_version || window.queryString.appVersion)) {
$('.tab-nav').css({
position: 'relative'
... ... @@ -233,5 +290,4 @@ $(function() {
$(window).scroll(function() {
scrollFn();
});
});
... ...