Authored by zzzzzzz

下载浮动

{{#showDownloadApp}}
<div class="float-layer hide" id="float-layer-app">
<div class="float-layer" id="float-layer-app">
<div class="float-layer-left">
<span class="yoho-icon iconfont">&#xe60d;</span>
<p>新用户送惊喜礼包</p>
... ... @@ -8,7 +8,7 @@
<i class="close-icon iconfont">&#xe623;</i>
<div class="circle-rightbottom"></div>
</a>
<a href="javascript:void(0);" id="float-layer-btn">
<a href="http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho" id="float-layer-btn">
立即下载
</a>
</div>
... ...
/**
* 底部JS
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/26
*/
var $ = require('yoho-jquery'),
Hammer = require('yoho-hammer');
var floatLayerBtnHammer;
require('../common');
/**
* 获取url参数
*/
function getQueryString(name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return window.unescape(r[2]);
}
return null;
}
function downLoadApp() {
var appUrl = 'http://www.yohoshow.com/about/index/yohobuyqr/';
var clickedAt = new Date();
setTimeout(function() {
var mkt = getQueryString('mkt_code');
if ((new Date()) - clickedAt < 2000) {
if (mkt) {
appUrl += '?union_type=' + mkt;
}
window.location = appUrl;
}
}, 500);
}
$('#float-layer-close').on('touchend', function(e) {
$('#float-layer-app').hide();
window.setCookie('_float-layer-app', 'id490655927',
{
domain: '.yohobuy.com'
});
window.setCookie('_float-layer-app-close', 1,
{
domain: '.yohobuy.com',
expires: 1
});
return false;
});
if ($('#float-layer-btn') && $('#float-layer-btn')[0]) {
floatLayerBtnHammer = new Hammer($('#float-layer-btn')[0]);
floatLayerBtnHammer.on('tap', function(e) {
downLoadApp('bottom');
e.srcEvent.stopPropagation();
});
// if (typeof window.cookie === 'function' && !window.cookie('_float-layer-app')) {
// $('#float-layer-app').show();
// } else {
// $('#float-layer-app').hide();
// }
}
... ...
require('./recommend-for-you-user-center');
require('../common/footer');
/**
* 个人中心首页
... ...
... ... @@ -53,3 +53,76 @@
width: 100%;
}
}
.float-layer {
height: 128px;
background: rgba(68, 68, 68, 0.95);
position: fixed;
width: 100%;
bottom: 0;
left: 0;
z-index: 9999;
padding: 20px 0;
.float-layer-left {
padding-left: 44px;
overflow: hidden;
float: left;
img {
height: 44px;
float: left;
margin-right: 20px;
}
p {
float: left;
font-size: 32px;
height: 88px;
line-height: 88px;
color: white;
}
.yoho-icon {
float: left;
margin-right: 10px;
font-size: 44px;
line-height: 88px;
width: 88px;
height: 88px;
text-align: center;
color: #fff;
border-radius: 20px;
background-image: linear-gradient(#323232, #0f0f0f);
}
}
}
#float-layer-close {
position: absolute;
left: 0;
top: 0;
width: 100px;
height: 100px;
.close-icon {
position: absolute;
left: 0;
top: 0;
color: #C0C0C0;
z-index: 2;
}
}
#float-layer-btn {
position: absolute;
top: 50%;
right: 15px;
font-size: 32px;
padding: 0 10px;
height: 54px;
line-height: 54px;
background: white;
border-radius: 5px;
margin-top: -26px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0.5);
&:link,
&:visited,
&:hover,
&:actived {
color: #000;
}
}
\ No newline at end of file
... ...