<extend name="Public/bases" />
<block name="css">
	<link href="__CSS__/swiper.min.css" rel="stylesheet" >
  <link href="__CSS__/{:C('DEFAULT_THEME')}/game.css" rel="stylesheet" >
</block>
<block name="header">
<div class="header header-detail">
	<section class="wrap">
		<a class="hbtn left return" href="{:U('Game/index',array('account'=>I('account')))}"><span class="table"><span class="table-cell"><img src="__IMG__/wap/detail_nav_btn_return.png"></span></span></a>
		<div class="caption"><span class="table"><span class="table-cell">{$data.game_name}</span></span></div>
	</section>
</div>
<div class="header-space"></div>
</block>
<block name="body">
<div class="trunk-box detail">
	<div class="wrap">
		<div class="base clearfix game-base">
			<div class="item ">
				<div class="pic"><span class="font table"><span class="table-cell">----游戏</span></span><notempty name="data.game_icon"><img src="{:get_cover($data['game_icon'],'path')}" ></notempty></div>
				<div class="but clearfix">
					<span class="table">
						<span class="table-cell">
							<notempty name="data.pc_url">
							<a href="{$data.pc_url}" target="_blank" class="butn qq-butn">玩家交流群</a>
							<else />
							<a href="javascript:;" target="_blank" class="butn qq-butn disabled">玩家交流群</a>
							</notempty>
						</span>
					</span>
				</div>
				<div class="txt">
					<h3 class="name">{:str_replace(array('(安卓版)','(苹果版)'),'',$data['game_name'])}</h3>
					<p class="info"><span>{:set_number_short($data['download_number'])}人下载</span><i></i><span>{$data.game_size|default=0}MB</span></p>
				</div>
			</div>
		</div>

		<div class="content game-cotent">
			<div class="tab clearfix">
				<a href="javascript:;" class="tab-item active"><span>详情</span></a>
				<a href="{:U('Game/open',array('account'=>I('account'),'name'=>I('name'),'source'=>I('source')))}" class="tab-item"><span>开服</span></a>
				<a href="{:U('Game/gift',array('account'=>I('account'),'name'=>I('name'),'source'=>I('source')))}" class="tab-item"><span>礼包</span></a>
			</div>
			<div class="panel">
				<div class="screenshot">
					<div class="screenshot-content">
						<div class="swiper-container">
							<div class="swiper-wrapper">
								<volist name=":explode(',',$data['screenshot'])" id="vo">
									<div class="swiper-slide">
										<a class="pic"><span class="font table"><span class="table-cell">----游戏</span></span><notempty name="vo"><img src="{:get_cover($vo,'path')}" /><else/><img src="__IMG__/logoo.png" ></notempty></a>
									</div>
								</volist>
							</div>
						</div>
					</div>
				</div>
				<div class="desciption">
					<div class="desciption-content">
						<div class="article">
							<p>游戏介绍</p>
							<?php $length = mb_strwidth($data['description'],'utf-8'); ?>
							<gt name="length" value="220">
								<div class="articlesub as1">{:mb_strimwidth($data['description'],0,220,'...','utf-8')}</div>
								<div class="articlesub as2">{$data['description']}</div>
								<a href="javascript:;" class="showarticle"><span>展开</span><i class="icon"></i></a><i class="mark"></i>
							<else />
								<div class="articlesub">{$data['description']}</div>
							</gt>
							<empty name="data.description">暂无游戏介绍</empty>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<notempty name="other">
		<div class="other">
			<div class="other-title">猜你喜欢</div>
			<div class="other-content">
				<ul class="clearfix">
				<volist name="other" id="vo">
					<li>
						<div class="item">
							<div class="pic"><a href="{$vo.jump_url}"><span class="font table"><span class="table-cell">----游戏</span></span><notempty name="vo.game_icon"><img src="{:get_cover($vo['game_icon'],'path')}"></notempty></a></div>
							<div class="txt">
								<a href="{$vo.jump_url}" class="name">{:str_replace(array('(安卓版)','(苹果版)'),'',$vo['game_name'])}</a>
							</div>
						</div>
					</li>
				</volist>
				</ul>
			</div>
		</div>
		</notempty>
		
		
	</div>
</div>
</block>

<block name="footer">
<div class="down-space"></div>
<div class="down">
	<div class="wrap">
		<notempty name="data.download">
			<if condition="$data['game_source'] eq 1">
				<a href="{$data.download}"  class="butn <empty name='data.download'>disabled</empty>">下载游戏</a>
				<else/>
				<a href="javascript:;" date-id="{$data[id]}" date-value="{$data.download}" date-promote="{$data.promote_id}" class="butn goto <empty name='data.download'>disabled</empty>">下载游戏</a>
			</if>
		<else />
		<a href="javascript:;" class="butn disabled">下载游戏</a>
		</notempty>
	</div>
</div>
</block>

<block name="script">
<script src="__JS__/swiper.min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<empty name="data">
<script>layer.msg('未查到此游戏数据');setTimeout(function(){window.location.href="{:U('Game/index',array('account'=>I('account')))}";},1500);</script>
</empty>
<script>
	$(function() {
		var off = $(window).width()<1080?$(window).width()/1080:1;
		
    new Swiper('.swiper-container', {
      slidesPerView: 3,
			spaceBetween:34*off,
			slidesOffsetBefore:48*off,
      pagination: {
        el: '.swiper-pagination',
        clickable: true,
      },
    });

        $('.goto').click(function(){
            var url = $(this).attr("date-value");
            if(url == '')return false;
            var game_id = $(this).attr("date-id");
            var promote_id = $(this).attr("date-promote");
            $.ajax({
                type:'GET',
                dataType:'json',
                url:'{:U("Game/setdownload")}',
                data:{game_id:game_id,promote_id:promote_id},
                success:function(data) {
                },
            });
            window.location.href = url;
        })
		$('.showarticle').click(function() {
			var that = $(this),parent = that.closest('.article');
			var as1 = parent.find('.as1');
			var as2 = parent.find('.as2');
			if (!that.hasClass('close')) {
				as1.hide();
				parent.animate({'height':(parseFloat(as2.height())+24)+'px'});
				that.addClass('close').find('span').text('收起');				
			} else {
				parent.animate({'height':as1.height()},function(){
				as1.show();					
				});
				that.removeClass('close').find('span').text('展开');
			}
			
			return false;
		});
		
	});
    
</script>
</block>