Authored by 郝肖肖

Merge branch 'feature/downEventYas' into release/5.2

var $ = require('yoho-jquery'),
loading = require('../../plugin/loading'),
tip = require('../../plugin/tip'),
... ... @@ -21,13 +20,15 @@ inviteObj = {
// 变量
inter: 0, // 定时器变量
ischeckCode: false, // 是否成功发送验证码
actId: $('.invite-group input[name="actId"]').val(), // 活动id
shareUid: $('.invite-group input[name="shareUid"]').val(), // 分享者id
openId: $('.invite-group input[name="openId"]').val(), // 微信openId
actId: $('.invite-group input[name="actId"]').val(), // 活动id
shareUid: $('.invite-group input[name="shareUid"]').val(), // 分享者id
openId: $('.invite-group input[name="openId"]').val(), // 微信openId
nums: $('.invite-group input[name="nums"]').val() // 发送优惠券的次数
},
init: function() {
var $el = this.el, that = this, isreceiveBtn = false;
var $el = this.el,
that = this,
isreceiveBtn = false;
// 设置大背景,因为body只能后来设置,前期设置page里面
if ($('.invite-page').length > 0) {
... ... @@ -91,7 +92,7 @@ inviteObj = {
// 下载app
$el.$downloadBtn.click(function() {
that.downLoadApp();
window.downLoadApp();
});
// 领取福利
... ... @@ -109,7 +110,8 @@ inviteObj = {
// 发送已注册用户参与活动的优惠券
ischeckOldUserCoupon: function(mobile) {
var that = this, $el = this.el;
var that = this,
$el = this.el;
$.ajax({
url: '/activity/invite/checkOldUserCoupon',
... ... @@ -317,15 +319,6 @@ inviteObj = {
$('.invite-dialog-bg').remove();
$el.$inviteDialog.hide();
that.clearGrayInfo();
},
// 下载app
downLoadApp: function() {
var appUrl = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445';
setTimeout(function() {
window.location = appUrl;
}, 200);
}
};
... ...
... ... @@ -204,7 +204,7 @@ $.extend({
// 单击下载按钮 - 接受微信商城或者第三方来源的数据埋点信息
if (queryString().union_type) {
setCookie('unionTypeYas', queryString().union_type);
setCookie('unionTypeYas', queryString().union_type, {path: '/'});
}
}());
... ... @@ -307,6 +307,31 @@ if ($footer.find('.user-name').text().length === 11) {
$footer.find('.user-name').html(phoneHidden($footer.find('.user-name').text()));
}
// 浮层下载APP
function downLoadApp() {
var appUrl = 'http://union.yoho.cn/union/downapp.html';
var clickedAt = new Date();
setTimeout(function() {
var mkt = queryString().union_type || cookie('unionTypeYas') || false;
if ((new Date()) - clickedAt < 2000) {
if (mkt) {
appUrl += '?union_type=' + mkt;
}
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_DOWNLOAD_C',
param: JSON.stringify({C_ID: _ChannelVary[cookie('_Channel')] || 1, TO_URL: appUrl})
}, true);
}
window.location = appUrl;
}
}, 500);
}
// 为您优选埋点 http://redmine.yoho.cn/issues/10117
function givePoint(parameter) {
var CID = 1;
... ... @@ -398,3 +423,5 @@ window.queryString = queryString();
window.givePoint = givePoint;
window._ChannelVary = _ChannelVary;
window.downLoadApp = downLoadApp;
... ...
... ... @@ -7,37 +7,10 @@
var $ = require('yoho-jquery'),
Hammer = require('yoho-hammer');
var floatLayerBtnHammer,
C_ID;
var floatLayerBtnHammer;
require('../common');
C_ID = window._ChannelVary[window.cookie('_Channel')] || 1;
function downLoadApp() {
var appUrl = 'http://union.yoho.cn/union/downapp.html';
var clickedAt = new Date();
setTimeout(function() {
var mkt = window.queryString.mkt_code || window.cookie('mkt_code') || false;
if ((new Date()) - clickedAt < 2000) {
if (mkt) {
appUrl += '?union_type=' + mkt;
}
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_DOWNLOAD_C',
param: JSON.stringify({C_ID: C_ID, TO_URL: appUrl})
}, true);
}
window.location = appUrl;
}
}, 500);
}
$('#float-layer-close').on('touchend', function() {
$('#float-layer-app').hide();
window.setCookie('_float-layer-app', 'id490655927',
... ... @@ -55,7 +28,7 @@ $('#float-layer-close').on('touchend', function() {
if ($('#float-layer-btn') && $('#float-layer-btn')[0]) {
floatLayerBtnHammer = new Hammer($('#float-layer-btn')[0]);
floatLayerBtnHammer.on('tap', function(e) {
downLoadApp('bottom');
window.downLoadApp('bottom');
e.srcEvent.stopPropagation();
});
... ...
... ... @@ -24,30 +24,6 @@ function getQueryString(name) {
return null;
}
function downLoadApp() {
var appUrl = 'http://union.yoho.cn/union/downapp.html';
var clickedAt = new Date();
setTimeout(function() {
var mkt = window.queryString.union_type || window.cookie('unionTypeYas') || false;
if ((new Date()) - clickedAt < 2000) {
if (mkt) {
appUrl += '?union_type=' + mkt;
}
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_DOWNLOAD_C',
param: JSON.stringify({C_ID: window._ChannelVary[window.cookie('_Channel')] || 1, TO_URL: appUrl})
}, true);
}
window.location = appUrl;
}
}, 500);
}
$('#float-layer-close').on('touchend', function(e) {
$('#float-layer-app').hide();
window.setCookie('_float-layer-app', 'id490655927',
... ... @@ -65,7 +41,7 @@ $('#float-layer-close').on('touchend', function(e) {
if ($('#float-layer-btn') && $('#float-layer-btn')[0]) {
floatLayerBtnHammer = new Hammer($('#float-layer-btn')[0]);
floatLayerBtnHammer.on('tap', function(e) {
downLoadApp('bottom');
window.downLoadApp('bottom');
e.srcEvent.stopPropagation();
});
... ...