Authored by hongweigao

登陆埋点

... ... @@ -116,22 +116,22 @@
</li>
<li class="third-party-login">
<a href="{{weixinLogin}}">
<a href="{{weixinLogin}}" data-type="4">
<span class="icon weixin"></span>
</a>
<a href="{{qqLogin}}">
<a href="{{qqLogin}}" data-type="1">
<span class="icon qq"></span>
</a>
<a href="{{weiboLogin}}">
<a href="{{weiboLogin}}" data-type="2">
<span class="icon weibo"></span>
</a>
<a href="{{alipayLogin}}">
<a href="{{alipayLogin}}" data-type="3">
<span class="icon alipay"></span>
</a>
<a href="{{doubanLogin}}">
<a href="{{doubanLogin}}" data-type="6">
<span class="icon douban"></span>
</a>
<a href="{{renrenLogin}}">
<a href="{{renrenLogin}}" data-type="7">
<span class="icon renren"></span>
</a>
</li>
... ...
... ... @@ -97,214 +97,220 @@ if (window.cookie('_UID')) {
});
}
/** ***** 埋点 *******/
if (mChannel !== '') {
/** ***** 埋点 *******/
// banner埋点
$('.slide-wrapper > ul li > a').click(function() {
var floorId = $('#bannerFloorId').html(),
url = $(this).attr('href'),
index = parseInt($(this).parent().index(), 10) + 1;
// banner点击埋点
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: floorId,
F_NAME: '焦点图',
F_URL: url,
F_INDEX: 1,
I_INDEX: index
});
$('.slide-wrapper > ul li > a').click(function() {
var floorId = $('#bannerFloorId').html(),
url = $(this).attr('href'),
index = parseInt($(this).parent().index(), 10) + 1;
// banner点击埋点
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: floorId,
F_NAME: '焦点图',
F_URL: url,
F_INDEX: 1,
I_INDEX: index
});
});
});
//最新速报
//左1+中6
$('.new-report .report-list li > a').click(function() {
var $header = $('.new-report .floor-header');
var floorId = $header.attr('floorid'),
floorName = $header.find('.floor-title').html(),
url = $(this).attr('href'),
index = parseInt($(this).parent().index(), 10) + 1;
// banner点击埋点
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: floorId,
F_NAME: floorName,
F_URL: url,
F_INDEX: 2,
I_INDEX: index
// 最新速报
// 左1+中6
$('.new-report .report-list li > a').click(function() {
var $header = $('.new-report .floor-header');
var floorId = $header.attr('floorid'),
floorName = $header.find('.floor-title').html(),
url = $(this).attr('href'),
index = parseInt($(this).parent().index(), 10) + 1;
// banner点击埋点
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: floorId,
F_NAME: floorName,
F_URL: url,
F_INDEX: 2,
I_INDEX: index
});
});
});
//右1
$('.new-report .last-item > a').click(function() {
var $header = $('.new-report .floor-header');
var floorId = $header.attr('floorid'),
floorName = $header.find('.floor-title').html(),
url = $(this).attr('href');
// banner点击埋点
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: floorId,
F_NAME: floorName,
F_URL: url,
F_INDEX: 2,
I_INDEX: 8
// 右1
$('.new-report .last-item > a').click(function() {
var $header = $('.new-report .floor-header');
var floorId = $header.attr('floorid'),
floorName = $header.find('.floor-title').html(),
url = $(this).attr('href');
// banner点击埋点
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: floorId,
F_NAME: floorName,
F_URL: url,
F_INDEX: 2,
I_INDEX: 8
});
});
});
//logo列表
$('.logo-brand > ul li > a').click(function () {
if ($(this).hasClass('iconfont')) {
return;
}
var $header = $('.new-report .floor-header');
var floorId = $header.attr('floorid'),
floorName = $header.find('.floor-title').html(),
url = $(this).attr('href'),
content = $(this).html();
// logo列表
$('.logo-brand > ul li > a').click(function() {
if ($(this).hasClass('iconfont')) {
return;
}
var $header = $('.new-report .floor-header');
var floorId = $header.attr('floorid'),
floorName = $header.find('.floor-title').html(),
url = $(this).attr('href'),
content = $(this).html();
var index = $(this).closest('li').prevAll('li:not(.logo-brand-switch, .brand-more)').length + 9;
var index = $(this).closest('li').prevAll('li:not(.logo-brand-switch, .brand-more)').length + 9;
if(content.indexOf("MORE") >= 0) {
index = 0;
}
// 话题楼层的广告位
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: floorId,
F_NAME: floorName,
F_URL: url,
F_INDEX: 2,
I_INDEX: index
if (content.indexOf('MORE') >= 0) {
index = 0;
}
// 话题楼层的广告位
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: floorId,
F_NAME: floorName,
F_URL: url,
F_INDEX: 2,
I_INDEX: index
});
});
});
//广告位
$('.floor-ad > a').click(function() {
var $header = $('.floor-ad').prev().prev();
var floorId = $header.attr('floorid'),
floorName = $header.find('.floor-title').html(),
url = $(this).attr('href');
// 话题楼层的广告位
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: floorId,
F_NAME: floorName,
F_URL: url,
F_INDEX: 3,
I_INDEX: 8
// 广告位
$('.floor-ad > a').click(function() {
var $header = $('.floor-ad').prev().prev();
var floorId = $header.attr('floorid'),
floorName = $header.find('.floor-title').html(),
url = $(this).attr('href');
// 话题楼层的广告位
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: floorId,
F_NAME: floorName,
F_URL: url,
F_INDEX: 3,
I_INDEX: 8
});
});
});
//左一右六埋点
//左一
$('.tpl-leftPic > a').click(function () {
var $topic = $(this).closest('.topic'),
$header = $topic.prev(),
url = $(this).attr('href');
var num = $('.topic').length;
for (var i = 0; i < num; i++) {
if($header.hasClass('floor-header')) {
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: $header.attr('floorid'),
F_NAME: $header.find('.floor-title').html(),
F_URL: url,
F_INDEX: 5,
I_INDEX: (i * 7) + 1
});
break;
}else {
$header = $header.prev();
}
}
});
//右六
$('.tpl-types > ul li > a').click(function () {
var $topic = $(this).closest('.topic'),
$header = $topic.prev(),
url = $(this).attr('href');
var index = parseInt($(this).parent().index(), 10) + 1;
var num = $('.topic').length;
for (var i = 0; i < num; i++) {
if($header.hasClass('floor-header')) {
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: $header.attr('floorid'),
F_NAME: $header.find('.floor-title').html(),
F_URL: url,
F_INDEX: 5,
I_INDEX: (i * 7) + 1 + index
});
break;
}else {
$header = $header.prev();
// 左一右六埋点
// 左一
$('.tpl-leftPic > a').click(function() {
var $topic = $(this).closest('.topic'),
$header = $topic.prev(),
url = $(this).attr('href');
var num = $('.topic').length;
for (var i = 0; i < num; i++) {
if ($header.hasClass('floor-header')) {
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: $header.attr('floorid'),
F_NAME: $header.find('.floor-title').html(),
F_URL: url,
F_INDEX: 5,
I_INDEX: (i * 7) + 1
});
break;
} else {
$header = $header.prev();
}
}
}
});
});
//7个品类
$('.seven-product .tpl-products > ul li > a').click(function () {
var floorId = $(this).closest('.tpl-products').attr('floorid'),
url = $(this).attr('href'),
index = parseInt($(this).parent().index(), 10) + 1;
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: floorId,
F_NAME: '品类楼层',
F_URL: url,
F_INDEX: 5,
I_INDEX: index
// 右六
$('.tpl-types > ul li > a').click(function() {
var $topic = $(this).closest('.topic'),
$header = $topic.prev(),
url = $(this).attr('href');
var index = parseInt($(this).parent().index(), 10) + 1;
var num = $('.topic').length;
for (var i = 0; i < num; i++) {
if ($header.hasClass('floor-header')) {
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: $header.attr('floorid'),
F_NAME: $header.find('.floor-title').html(),
F_URL: url,
F_INDEX: 5,
I_INDEX: (i * 7) + 1 + index
});
break;
} else {
$header = $header.prev();
}
}
});
});
//最新上架
//more链接
$('.commodity .floor-header .header-navs li > a').click(function () {
var $header = $(this).closest('.floor-header'),
name = $header.find('.floor-title').html(),
url = $(this).attr('href'),
menu = $(this).html(),
index = parseInt($(this).parent().index(), 10) + 1;
if(menu === 'MORE') {
index = 0;
}
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: $header.attr('floorid'),
F_NAME: name,
F_URL: url,
F_INDEX: 6,
I_INDEX: index
// 7个品类
$('.seven-product .tpl-products > ul li > a').click(function() {
var floorId = $(this).closest('.tpl-products').attr('floorid'),
url = $(this).attr('href'),
index = parseInt($(this).parent().index(), 10) + 1;
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: floorId,
F_NAME: '品类楼层',
F_URL: url,
F_INDEX: 5,
I_INDEX: index
});
});
});
//商品列表
$('.commodity .goods-container').on('click', '.good-info .good-detail-img > a,' +
'.good-info .good-detail-text > a', function () {
var $header = $('.commodity .floor-header'),
name = $header.find('.floor-title').html(),
url = $(this).attr('href'),
index = parseInt($(this).closest('.good-info').index(), 10) + 1;
var $navs = $('.commodity .floor-header .header-navs li');
var navsNum = $navs.length;
$navs.each(function () {
var $a = $(this).find('a');
if($a.html() === 'MORE') {
navsNum -= 1;
// 最新上架
// more链接
$('.commodity .floor-header .header-navs li > a').click(function() {
var $header = $(this).closest('.floor-header'),
name = $header.find('.floor-title').html(),
url = $(this).attr('href'),
menu = $(this).html(),
index = parseInt($(this).parent().index(), 10) + 1;
if (menu === 'MORE') {
index = 0;
}
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: $header.attr('floorid'),
F_NAME: name,
F_URL: url,
F_INDEX: 6,
I_INDEX: index
});
});
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: $header.attr('floorid'),
F_NAME: name,
F_URL: url,
F_INDEX: 6,
I_INDEX: index + navsNum
// 商品列表
$('.commodity .goods-container').on('click', '.good-info .good-detail-img > a,' +
'.good-info .good-detail-text > a', function() {
var $header = $('.commodity .floor-header'),
name = $header.find('.floor-title').html(),
url = $(this).attr('href'),
index = parseInt($(this).closest('.good-info').index(), 10) + 1;
var $navs = $('.commodity .floor-header .header-navs li');
var navsNum = $navs.length;
$navs.each(function() {
var $a = $(this).find('a');
if ($a.html() === 'MORE') {
navsNum -= 1;
}
});
yas.givePoint('YB_JK_PAV_FLR_C', {
F_ID: $header.attr('floorid'),
F_NAME: name,
F_URL: url,
F_INDEX: 6,
I_INDEX: index + navsNum
});
});
});
}
... ...
... ... @@ -32,6 +32,7 @@
*/
var $ = require('yoho-jquery');
var yas = require('../../common/data-yas');
// 密码输入帐号
var $accountInput1 = $('#account1'),
... ... @@ -1222,7 +1223,32 @@ $qrCodeOverLayer.on('click', '#qrcode-refresh-btn', function() {
/** ************************************************************************/
// click登录
$('#login-btn').on('click', loginAsync);
$('#login-btn').on('click', function() {
//登陆埋点
var type = 0;
if (currentLogin.type() === 'sms') {
type = 5;
}
// banner点击埋点
yas.givePoint('YB_MY_LOGIN_C', {
LOGI_TYPE: type
});
loginAsync();
});
//第三方登陆埋点
$('.third-party-login > a').click(function () {
var type = $(this).data('type');
// banner点击埋点
yas.givePoint('YB_MY_LOGIN_C', {
LOGI_TYPE: type
});
});
// enter登录
$('input.va').on('keypress', function(e) {
... ...