<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="x5-orientation" content="portrait">
		<meta name="screen-orientation" content="portrait">
		<link rel="stylesheet" type="text/css" href="/iamberry/common/other/downLoadApp/css/mui.min.css">
		<link rel="stylesheet" type="text/css" href="/iamberry/common/other/downLoadApp/css/style.css" />
	</head>
	<body>
	<div class="loading-bg">
			<div class="mui-loading">
				<div class="mui-spinner">
				</div>
				&nbsp;&nbsp;加载中...
			</div>
	</div>
<div class="lock-wrap">
<div class="lock">
为了更好的体验，请切换竖屏浏览
</div>
</div>
		<div class="mui-content">
			<div style="position: absolute;top: 50%;-webkit-transform: translateY(-50%);transform: translateY(-50%);left: 0;width: 100%;">
			<div>
				<img width="100%" src="/iamberry/common/other/downLoadApp/images/top.png" />
			</div>
			<div style="width: 55%;margin: 0 auto;position: relative;">
				<div class="iphone_btn"></div>
				<div class="android_btn"></div>
			</div>
			<div>
				<img width="100%" src="/iamberry/common/other/downLoadApp/images/bottom.png" />
			</div>
			</div>
		</div>
	<script type="text/javascript" src="/iamberry/common/other/downLoadApp/js/mui.min.js"></script>
	<script src="/iamberry/common/shop/js/jquery-2.1.1.min.js"></script>
	<script src="/iamberry/common/js/utils/wechat-utils-1.0.js"></script>
	<script type="text/javascript">
	window.onlod=function(){
		window.hiddenAllWechatMenu = true;
	}
	mui.ready(function(){
		
		var flag=mui.os.ios;
		console.log(flag);
		var macId=GetQueryString();
		$.ajax({
			"type":"post",
            "url":"/iamberry/wechat/qrcode/binding",
            "data" :"macId="+macId,
            "success" : function(res) {
            	//alert(JSON.stringify(res));
                if(res.status){
					//mui.toast(res.message);
                }else{
                	//mui.toast(res.message);
                }
            }
		});
		
		document.querySelector('.loading-bg').style.display='none';
		var ua = navigator.userAgent.toLowerCase();//获取判断用的对象
        
		var mask = mui.createMask(function() {
			}); //callback为用户点击蒙版时自动执行的回调；
		
		//android下载
		mui('body').on('tap','.android_btn',function(){
			console.log("android下载");
				if (ua.match(/MicroMessenger/i) == "micromessenger") {
                //在微信中打开
                mask.show(); //显示遮罩
                }else{
                location.href="http://app.iamberry.com/imberry/download/iamberry_release.apk";
                //location.href="http://h5.iamberry.com/iamberry/wechat/qrcode/downLoad";
                	//mui.alert('敬请期待');
                }
				
		});
		//iphone下载
		mui('body').on('tap','.iphone_btn',function(){
			console.log("iphone下载");
				if (ua.match(/MicroMessenger/i) == "micromessenger") {
                //在微信中打开
                mask.show(); //显示遮罩
                }else{
                location.href='https://itunes.apple.com/cn/app/bi-bi-meng/id1117339790?mt=8';
                }
		});
	});
	
	
	//获取冲奶机的机器码
	function GetQueryString(){
		//console.log(location.href);
		var str=location.href;
		//console.info(str.indexOf("qrcode/"));
		var destr=str.substring(str.indexOf("qrcode/")+7,location.href.length);
		//console.log(destr);
		return destr;
	}
	
	function toAibeiyuan(){
		location.href='http://www.iamberry.com';
	}
	
	</script>
	</body>
</html>
