<div class="downLoad clearfix">
<div onclick="jsOpenApp.Close(this);" class="downClose fl"></div>
<img class="fl downLogo" src="/Content/M/New/image/downLogo.png" alt="">
<span class="fl downTxt">下载麦乐购客户端<br>更多优惠,快到碗里来!</span>
<a onclick="jsOpenApp.Open(this);" href="http://www.gou.com/app/" class="fr downBtn" >立即领取</a>
</div>
<script language="javascript">
var jsOpenApp=jsOpenApp||{};
jsOpenApp.Close=function(e){
$(e).parent().hide();
};
jsOpenApp.Open=function(e){
// 通过iframe的方式试图打开APP,如果能正常打开,会直接切换到APP,并自动阻止a标签的默认行为
// 否则打开a标签的href链接
var ifr = document.createElement('iframe');
var u = navigator.userAgent, app = navigator.appVersion;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
var src="";
if (isAndroid) {
$(e).attr("href","http://a.app.qq.com/o/simple.jsp?pkgname=com.mrocker.m6go");
src = "m6gocom://";
} else if (isiOS) {
//如果是IOS系统则指向itunes否则进入统一的app下载页
$(e).attr("href","https://itunes.apple.com/cn/app/qq-2011/id681580740?mt=8");
src = "mailegou://";
}
ifr.src = src;
ifr.style.display = 'none';
document.body.appendChild(ifr);
window.setTimeout(function () {
document.body.removeChild(ifr);
}, 3000);
};
</script>