<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="<?php echo ODZ_CHARSET;?>">
	<title></title>
	<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
	<meta content="telephone=no" name="format-detection" />
		<link rel="stylesheet" type="text/css" href="<?php echo $mocuzdir?>css/style.css">
	<script type="text/javascript" src="<?php echo $mocuzdir?>js/jquery-1.8.3.min.js"></script>
</head>

<body>
	<!-- 跳转窗口 -->
	<div class="share_jmp_box">
		<div class="jmp_box_center">
			<img src="<?php echo $mocuz;?>assets/images/icon.png" alt="" class="jmp_box_icon">
			<p class="jmp_box_name"><?php echo $sitename;?></p>
			<p class="jmp_box_text"><?php echo $sharecontent;?></p>
			<ul class="jmp_box_ul">
				<li>
					<p>我已下载</p>
					<button class="open_app" onclick="openApp()">打开APP</button>
				</li>

				<li>
					<p>我未下载</p>
					<button class="download_app" onclick="downloadApp('<?php echo $ios_downloadurl;?>','<?php echo $android_downloadurl;?>')">下载APP</button>
				</li>
			</ul>
		</div>
	</div>
	<!-- 提示引导窗口 -->
	<div class="share_guide_box">
		<img src="<?php echo $mocuzdir?>images/guide_url.png" alt="">
	</div>
</body>
<script type="text/javascript">

if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
	var ua = window.navigator.userAgent.toLowerCase();
	if(ua.match(/MicroMessenger/i) == 'micromessenger'){
	$('.share_guide_box').show(); //显示导航- 在浏览器中打开
	}else{
    var loadDateTime = new Date();
    window.setTimeout(function() {
      var timeOutDateTime = new Date();
      if (timeOutDateTime - loadDateTime < 5000) {
        window.location = "<?php echo $ios_downloadurl;?>";
      } else {
        window.close();
      }
    },
    3000);
    window.location = "<?php echo $httphost;?>://myhost/open?tid=<?php echo $tid?>=<?php echo $type?>";
	}
  } else if (navigator.userAgent.match(/android/i)) {
		      var ua = window.navigator.userAgent.toLowerCase();
			// 在微信中打开
			if(ua.match(/MicroMessenger/i) == 'micromessenger'){
				$('.share_guide_box').show(); //显示导航- 在浏览器中打开
			}else{
				 window.setTimeout(function() {
				        window.location = "<?php echo $ios_downloadurl;?>";
				    },
				    3000);
				 window.location = "<?php echo $httphost;?>://myhost/open?tid=<?php echo $tid?>=<?php echo $type?>";
				
			}
     //  setTimeout(function() {

	    // },
	    // 3000);

       

    
  }
// $(function(){  
// 	checkBrowser();
// 	$('.share_guide_box,.share_guide_box img').click(function(){
// 		$('.share_guide_box').hide();
// 	})
// 	setTimeout(openApp,300);
// }); 
	// 检查浏览器
	function checkBrowser(){

		var ua = window.navigator.userAgent.toLowerCase();
		// 在微信中打开
		if(ua.match(/MicroMessenger/i) == 'micromessenger'){
			$('.share_guide_box').show(); //显示导航-在浏览器中打开
			$('.share_jmp_box').show();
		}else{
			$('.share_jmp_box').show();  //显示跳转界面
		}
	}  

	//打开APP
	function openApp(){
		var ua = window.navigator.userAgent.toLowerCase();
		if(/iphone|ipad|ipod/.test(ua)){
			window.location="<?php echo $httphost;?>://myhost/open?tid=<?php echo $tid?>";
      	}else{
      		window.location="<?php echo $httphost;?>://myhost/open?tid=<?php echo $tid?>";
		}
	}	
	//下载APP	
	function downloadApp(ios_downloadurl,android_downloadurl){

		var ua = window.navigator.userAgent.toLowerCase();
		if(/iphone|ipad|ipod/.test(ua)){
        	window.location=ios_downloadurl;
      	}else{
      		window.location=android_downloadurl;
		}
	}


</script>
</html>