<extend name="Public/bases2" />
<block name="css">
  <link href="__CSS__/game.css" rel="stylesheet" > 
  <link href="__CSS__/trade.css" rel="stylesheet" > 
	<style>.confirm_btn.disabled {background:#bbb} .xgdisabled {background:#c1c3c1;}</style>
	<script src="__JS__/lwx.js"></script>
</block>
<block name="body" >
    <!--头部-->
    <div class="zmarg_btm59">
		  
	<header class="header trade-header">
      <div class="">
		<a href="javascript:history.back(-1);" class="go_back">
			<span class="table">
				<span class="table-cell">
					<img class="img_goback" src="__IMG__/trade/btn_normal_back@3x.png" alt="" height="" width="">
				</span>
			</span>
		</a>
        <h1 class="trade_caption">商品详情</h1>
      </div>
    </header>
      <div class="xg_main clearfix">
			<div class="t-list gd-t-list">
				<div class="content gift-content pad_b0">
				
				<empty name="data">
					<div class="no_data">
						<div class="nodata_content">
							<img class="nodata_img" src="__IMG__/trade/icon_shangpin@3x.png" alt="" height="" width="">
							<p class="nodata_txt">暂无此商品,逛逛其他地方吧~</p>
						</div>
					</div>
				<else />
				
					<div class="xg_version">
						<div class="media">
							  <div class="media-left  media-middle">
									<a href="javsccript:;" class="a_version">
									  <img class="media-object img_version" src="__IMG__/trade/pic_1@3x.png" alt="">
									</a>
							  </div>
							  <div class="media-body">
									<h4 class="media-heading font_h">{$data.game_name}</h4>
									<p class="meader_txt">
										<span>{$data.game_size}</span>
										<span>{$data.game_type_name}</span>
									</p>
							  </div>
							  <!--<div class="media-right  media-middle">-->
									<!--<a href="{:U('Game/detail',array('id'=>$data['game_id']))}" class="a_download">下载</a>-->
							  <!--</div>-->
						</div>
					</div>
					<div class="border_div"></div>
					<div class="trumpt">
						<div class="trumpt_top z_clearfix">
							<div class="trumpt_tl">
								<div class="trump_line">
									<span class="tl_t_tit">上架:</span>
									<span class="span_des">{$data.online_time|date='m-d H:i',###}</span>
								</div>
								<div class="trump_line">
									<span class="tl_t_tit">小号:</span>
									<span class="span_des">{$data.small_account}</span>
								</div>
								<div class="trump_line">
									<span class="tl_t_tit">区服:</span>
									<span class="span_des">{$data.server_name}</span>
								</div>
							</div>
							<div class="trumpt_tr">
								<div class="trump_line price">售价</div>
								<div class="trump_line price_num">¥{$data.price}</div>
								<div class="trump_line">&nbsp;</div>
							</div>
						</div>
						<div class="border_div1"></div>
						<div class="trumpt_botm">
							<span class="trump_des">此小号已创建{$data.day}天,累充{$data.accumulation}</span>
							<a class="trump_abtn"><switch name="data.status"><case value="3">信息已审核</case><case value="4">已出售</case><case value="1">已出售</case></switch></a>
						</div>
					</div>
					<div class="border_div"></div>
						<div class="screenshot">
						<h3 class="screenshot_h">{$data.title}</h3>
						<p class="screenshot_p">{$data.content}</p>
						<div id="screenshotbox" class="clearfix">
						<volist name=":explode(',',$data['screenshot'])" id="vo">
						<p class="p_img"><img class="" src="{$vo|get_cover='path'}" height="" width=""></p>
						</volist>
						</div>
						<div class="div_ftf">
							<div class="table">
								<div class="table-cell">

									<a class="confirm_btn disabled">角色已出售</a>

								</div>
							</div>
						</div>	
				</empty>
					
				</div>
			</div>
	  
      </div>
    </div>
	

    </div>
		
		<div class="popmsg pop-dialog"></div>
		<div class="popwin pop-window" style="background:#FFF;"><div class="pop-page"><div class="pop-wrap"></div></div></div>
		<script src="__JS__/pop.lwx.min.js"></script>
<script>	
	$(function() {
		var first = $('#screenshotbox .p_img:eq(0) img');
		if(first && first.width()<first.height()) {
			$('#screenshotbox .p_img').css({width:'50%',float:'left'}).find('img').css({width:'98%'});
			$('#screenshotbox .p_img:nth-child(2n)').css({'text-align':'right'});
		}
	
		$('.zmarg_btm59').css('margin-bottom',0);
		$('.content').css({'min-height':($(window).height()-$(".header").height()-$(".foot-nav").height()-16)});
		$(".no_data").css({'height':($('.content').height())});
		
		$("body").delegate('.jsdown','click',function(){
			var url = $(this).attr('url');
			var pmsg = $(".popmsg").pop();
			$.ajax({
				url:url,
				type:"get",
				dataType:"json",
				data:{},
				success:function(result){
					if(result.status == 0){
						pmsg.msg(result.info);
					}else{
						location.href=result.url;
						return false;
					}
				},
				error:function(){
					alert("服务器异常");
				}
			})
		});
		
	});
	</script>
		

	<script>
	$(function() {
		var pmsg = $(".popmsg").pop();
		$('#buy_btn').on('click',function() {
			var that = $(this);
			if(that.hasClass('nodisabled')) {return false;}
			that.addClass('nodisabled');
			$.ajax({
				type:'post',
				dataType:'json',
				data:{id:'{$data["id"]}'},
				url:'{:U("checkLogin")}',
				success:function(data) {
					if(parseInt(data.status)==1) {
						window.location.href = '{:U("Trade/buy_good",array("id"=>$data["id"]))}';
					} else {
						$('.trade-header').hide();
						$('html').css({overflow:'hidden'});
						var pwin = $(".popwin").pop().open(800,data.html);
						that.removeClass('nodisabled');
					}
				},
				error:function(){
					pmsg.msg('服务器故障,请稍后再试');
					that.removeClass('disabled');
				},
			});
			
			return false;
		});
		

		

		
	});
</script>

</block>