<extend name="Public/bases" />
<block name="css">
  <link href="__CSS__/{:C('DEFAULT_THEME')}/download.css" rel="stylesheet" >
	<style>
		.right_click {display:none;position:absolute;top:0.1rem;right:0.48rem;width:4.4rem;height:1.8rem;z-index: 20;}
	</style>
</block>
<block name="body">
	<div class="trunk-box">
		<div class="wrap">
			<img src="__IMG__/img_guide@3x.png" id="right_click" class="right_click">
			<div class="one">
				<div class="pic">
					<span class="table font"><span class="table-cell">&nbsp;</span></span>
					<img src="<gt name='sitebase.sites_app_logo' value='0'>{:get_cover($sitebase['sites_app_logo'],'path')}<else />{:get_cover(C('APP_DOWN_LOGO'),'path')}</gt>">
				</div>
				<h2 class="name"><notempty name="sitebase.site_app_name">{$sitebase.site_app_name}<else />{:C('APP_NAME')}</notempty></h2>
				<p class="version">版本:<notempty name="sitebase.site_app_version">{$sitebase.site_app_version}<else />{$version_name}</notempty></p>
			</div>
			<!-- <div class="two"> -->

			<!-- </div> -->
			<div class="three">
				<span class="table">
					<span class="table-cell">
						<div class="download-butn">
							<eq name="system" value="1">
									<a href="itms-services://?action=download-manifest&url={$data.plist_url}" class="butn" id="jsdownload"><img src="__IMG__/wap/download_icon_ios.png" class="icon"><span>iPhone版下载</span></a>
									<else/>
									<a href="{$data.file_url}" class="butn" id="jsdownload"><img src="__IMG__/wap/download_icon_android.png" class="icon"><span>Android版下载</span></a>
							</eq>
							<p class="size">大小:{$data.file_size}</p>
						</div>
					</span>
				</span>
			</div>

		</div>
	</div>


</block>

<block name="script">
	<script>
		window.onload = function(){
				/*var oneh = parseFloat($('.one').height());
				var twoh = parseFloat($('.two').height());
				var three = $('.three');
				if($(window).height()-oneh-twoh>parseFloat(three.height())) {
					three.css({'position':'absolute'});
				}*/

        var b = document.getElementById('right_click');
		if(is_weixin() && is_android()){
			b.style.display = 'block';
		}

        var a = document.getElementById('jsdownload');
        a.addEventListener('click', function(){
			if(is_weixin()) {
				if(is_android()) {
					alert('请用安卓浏览器下载');return false;
				}
			}
          var html = '<span class="iconbox"><i class="icon-down"></i></span><span class="textbox">正在下载<i>.</i><i>.</i><i>.</i></span>';
          var name = a.className;
          if (name.indexOf('disabled')<0) {
            name += ' disabled';
            a.className = name;

            a.innerHTML = html;
          }

        });

      }

	function is_weixin(){
		var ua = navigator.userAgent.toLowerCase();
		return ua.match(/MicroMessenger/i)=="micromessenger";
	}

	function is_android() {
		var ua = navigator.userAgent.toLowerCase();
		return ua.indexOf('android') > -1 || ua.indexOf('linux') > -1
	}
	</script>
</block>