Authored by zhangxiaoru

下载浮层地址可配置

@@ -14,7 +14,8 @@ var _weChatInterface = '//m.yohobuy.com/life/getSignPackage', @@ -14,7 +14,8 @@ var _weChatInterface = '//m.yohobuy.com/life/getSignPackage',
14 14
15 15
16 require('../common'); 16 require('../common');
17 -require('../common/footer'); 17 +
  18 +// require('../common/footer');
18 19
19 // 根据ua判断页头 20 // 根据ua判断页头
20 (function uaHeader() { 21 (function uaHeader() {
@@ -482,3 +483,33 @@ $('.s-dialog').on('click', function() { @@ -482,3 +483,33 @@ $('.s-dialog').on('click', function() {
482 483
483 $('.dialog-content').addClass('s-dialog-content'); 484 $('.dialog-content').addClass('s-dialog-content');
484 }); 485 });
  486 +
  487 +$('#float-layer-close').on('touchend', function() {
  488 + $('#float-layer-app').hide();
  489 + window.setCookie('_float-layer-app', 'id490655927',
  490 + {
  491 + domain: '.yohobuy.com'
  492 + });
  493 + window.setCookie('_float-layer-app-close', 1,
  494 + {
  495 + domain: '.yohobuy.com',
  496 + expires: 1
  497 + });
  498 + return false;
  499 +});
  500 +
  501 +if ($('#float-layer-btn') && $('#float-layer-btn')[0]) {
  502 + var floatLayerBtnHammer = new Hammer($('#float-layer-btn')[0]);
  503 + floatLayerBtnHammer.on('tap', function(e) {
  504 + var downUrl = 'http://union.yoho.cn/union/downapp.html?union_type=367';
  505 +
  506 + window.downLoadApp(downUrl);
  507 + e.srcEvent.stopPropagation();
  508 + });
  509 +
  510 + if (typeof window.cookie === 'function' && !window.cookie('_float-layer-app')) {
  511 + $('#float-layer-app').show();
  512 + } else {
  513 + $('#float-layer-app').hide();
  514 + }
  515 +}
@@ -308,8 +308,8 @@ if ($footer.find('.user-name').text().length === 11) { @@ -308,8 +308,8 @@ if ($footer.find('.user-name').text().length === 11) {
308 } 308 }
309 309
310 // 浮层下载APP 310 // 浮层下载APP
311 -function downLoadApp() {  
312 - var appUrl = 'http://union.yoho.cn/union/downapp.html'; 311 +function downLoadApp(downUrl) {
  312 + var appUrl = downUrl || 'http://union.yoho.cn/union/downapp.html';
313 var clickedAt = new Date(); 313 var clickedAt = new Date();
314 314
315 setTimeout(function() { 315 setTimeout(function() {
@@ -28,7 +28,7 @@ $('#float-layer-close').on('touchend', function() { @@ -28,7 +28,7 @@ $('#float-layer-close').on('touchend', function() {
28 if ($('#float-layer-btn') && $('#float-layer-btn')[0]) { 28 if ($('#float-layer-btn') && $('#float-layer-btn')[0]) {
29 floatLayerBtnHammer = new Hammer($('#float-layer-btn')[0]); 29 floatLayerBtnHammer = new Hammer($('#float-layer-btn')[0]);
30 floatLayerBtnHammer.on('tap', function(e) { 30 floatLayerBtnHammer.on('tap', function(e) {
31 - window.downLoadApp('bottom'); 31 + window.downLoadApp();
32 e.srcEvent.stopPropagation(); 32 e.srcEvent.stopPropagation();
33 }); 33 });
34 34