{wc:templates "index","header"}
<link rel="stylesheet" type="text/css" href="{G_TEMPLATES_STYLE}/css/LotteryDetail.css"/>
<!--<link rel="stylesheet" type="text/css" href="{G_TEMPLATES_STYLE}/css/header.css"/>-->
<div class="Current_nav">
	<a href="{WEB_PATH}">首页</a> <span>&gt;</span> 
	<a href="{WEB_PATH}/goods_list/{wc:$item['cateid']}">
	{wc:$category['name']}
	</a> <span>&gt;</span> 
	<a href="{WEB_PATH}/goods_list/{wc:$item['cateid']}e{wc:$item['brandid']}">
	{wc:$brand['name']}
	</a> <span>&gt;</span>揭晓详情 
</div>
<div class="show_content">
	<!-- 商品期数 -->
	<div id="divPeriodList" class="show_Period" style="max-height:99px;">
		<div class="period_Open"><a class="gray02" click="off" id="btnOpenPeriod" href="javascript:void(0);">展开<i></i></a></div>
		{wc:$loopqishu}
	</div>
    <script>
		$("#btnOpenPeriod").click(function(){
				var ui_obj = $("#divPeriodList > ul");
				if($(this).attr("click")=='off'){
					$("#divPeriodList").css("max-height",ui_obj.length*33+"px");
					$(this).attr("click","on");
					$(this).html("收起<s></s>");

				}else{
					$("#divPeriodList").css("max-height","99px");
					$(this).attr("click","off");
					$(this).html("展开<i></i>");
				}
		});
	</script>
	<!-- 商品信息 -->
	<div class="Pro_Details">
		<h1><span>(第{wc:$item['qishu']}期)</span><span >{wc:$item['title']}</span><span style="{wc:$item['title_style']}">{wc:$item['title2']}</span></h1>
		<div class="Pro_Detleft">
			<div class="Pro_Detimg">
				<div class="Pro_pic"><a href="{WEB_PATH}/goods/{wc:$item['id']}" title="{wc:$item['title']}"><img width="398" height="398" src="{G_UPLOAD_PATH}/{wc:$item['thumb']}"></a></div>
			</div>
			{wc:if $itemzx}
			<div class="Result_LConduct">
				<dl>
					<dt><span>第{wc:$itemzx['qishu']}期</span>正在进行</dt>
					<dd>
						<div class="Result_Progress-bar">
							<p><span style="width:{wc:fun:width($itemzx['canyurenshu'],$itemzx['zongrenshu'],208)}px;"></span></p>
							<ul class="Pro-bar-li">
								<li class="P-bar01"><em>{wc:$itemzx['canyurenshu']}</em>已参与人次</li>
								<li class="P-bar02"><em>{wc:$itemzx['zongrenshu']}</em>总需人次</li>
								<li class="P-bar03"><em>{wc:$itemzx['shenyurenshu']}</em>剩余人次</li>
							</ul>
						</div>
						<p><a href="{WEB_PATH}/goods/{wc:$itemzx['id']}" target="_blank" class="Result_LConductBut">查看详情</a></p>
					</dd>
				</dl>
			</div>
			{wc:if:end}
		</div>
		<div class="Pro_Detright">
			<p class="Det_money">价值：<span class="rmbgray">{wc:$item['money']}</span></p>
			
			<div class="Announced_Frame">
				<div class="Announced_FrameT">揭晓结果</div>
				<div class="Announced_FrameCode">
					<ul class="Announced_FrameCodeMal">	
                    	{wc:loop $q_user_code_arr  $q_code_num}
                        <li class="Code_{wc:$q_code_num}">{wc:$q_code_num}<b></b></li>
                        {wc:loop:end}
					</ul>
				</div>
				<div class="Announced_FrameGet">
					<dl>
						<dd class="gray02">
							<p>恭喜<a href="{WEB_PATH}/uname/{wc:fun:idjia($item['q_uid'])}" target="_blank" class="blue" title="Warm">
                            	{wc:fun:get_user_name($q_user)} </a> 获得本期商品
                            </p>
							<p style="color:#618D03;font-weight:bold;">用户ID：{wc:fun:idjia($item['q_uid'])}<span style="font-weight:normal;">-ID为用户唯一不变标识</span></p>
							<p>揭晓时间：{wc:fun:microt($item['q_end_time'])}</p>
							<p>{wc:fun:_cfg('web_name_two')}时间：{wc:fun:microt($user_shop_time)}</p>
						</dd>
					</dl>
				</div>
				
                <!--补丁3.1.5_b.0.1-->  
                <div class="Announced_FrameBut">
					<a href="javascript:;"  class="Announced_But">本期详细计算结果</a>
					<a href="javascript:;"  class="Announced_But">看看有谁参与了</a>
					<a href="javascript:;" class="Announced_But">看看有谁晒单</a>
				</div>
                <!--补丁3.1.5_b.0.1-->  
                
				<div class="Announced_FrameBm"></div>
			</div>
			<div class="MaCenter">
				<p>商品获得者本期总共{wc:fun:_cfg('web_name_two')}了<em class="orange">{wc:$user_shop_number}</em>人次</p>
                    <div id="userRnoId" class="MaCenterH"><dl>
                        <dt>{wc:fun:microt($user_shop_time)}
                        <dd>
                            {wc:fun:yunma($user_shop_codes,"b")}
                        </dd>
                    </dl>
                </div>
			</div>
			<div id="divOpen" class="MaOff" style=""><span>展开查看全部<s></s></span></div>
		</div>
	</div>
</div>


	<!-- 计算结果 所有参与记录 晒单 -->
	<div id="calculate" class="ProductTabNav">
	    <div id="divMidNav" class="DetailsT_Tit">
	        <div class="DetailsT_TitP">		     
                <ul>
			        <li class="Product_DetT DetailsTCur"><span class="DetailsTCur">计算结果</span></li>
			        <li class="All_RecordT"><span class="">所有参与记录</span></li>
			        <li class="Single_ConT"><span class="">晒单</span></li>
		        </ul>
		    </div>
	    </div>
	</div>
<!--商品详情 开始-->   
<div id="divCalResult" class="Product_Content">	
	<div class="ygRecord" name="div_tab">
	<div class="yghelp">
                1、取该商品最后购买时间前网站所有商品的最后100条购买时间记录
                <br>
                2、每个时间记录按时、分、秒、毫秒依次排列取数值
                <br>
                3、将这100个数值之和除以该商品总参与人次后取余数，余数加上10000001 即为“幸运夺宝码”。
                {wc:if !$item['q_content']}
                <br>
                <b>由于网站还未满100条购买记录。所以按照   10000001 + (揭晓时间求和结果*100/参与人数) 的余数   即为“幸运夺宝码”。</b>
                {wc:if:end}
            </div>
            
            {wc:if $item['q_content']}
	            <ul class="Record_title">
	                <li class="time">夺宝时间</li>
	                <li class="nem">会员账号</li>
	                <li class="name">商品名称</li>
	                <li class="much">夺宝人次</li>
	            </ul>
				<div class="RecordOnehundred"><h4>截止该商品揭晓购买时间【{wc:fun:microt($item['q_end_time'])}】最后100条全站购买时间记录</h4>
				<div class="FloatBox b_red2"></div>	
	               {wc:loop $item['q_content'] $record}
	               {wc:php:start}
	               		$record_time = explode(".",$record['time']);
	                    $record['time'] = $record_time[0];
	               {wc:php:end}		
				   <ul class="Record_content bb_pink">
						<li class="time"><b>{wc:fun:date("Y-m-d",$record['time'])}</b>{wc:fun:date("H:i:s",$record['time'])}.{wc:$record_time[1]}</li>
						<li class="timeVal">{wc:$record['timeadd']}</li>
						<li class="nem"><a class="gray02" href="{WEB_PATH}/uname/{wc:fun:idjia($record['uid'])}" target="_blank">{wc:fun:get_user_name($record['uid'])}</a></li>
						<li class="name"><a class="gray02" href="{WEB_PATH}/goods/{wc:$record['shopid']}" target="_blank">（第{wc:$record['shopqishu']}期）{wc:$record['shopname']}</a></li>
						<li class="much">{wc:$record['gonumber']}人次</li>
					</ul>	
					{wc:loop:end}
				</div>
	                {wc:php:start}
	                	$shop_fmod = fmod($item['q_counttime'],$item['canyurenshu']);
	                {wc:php:end}
	                <div class="RecordOnehundred"><h4> 100条计算结果 </h4>
	           		 <div class="ResultBox bg_red"><h2>计算结果</h2>
						<p class="num4">求和：
							<span class="Fb">{wc:$item['q_counttime']}</span>(上面100条夺宝记录时间取值相加之和)<br>取余：
							<span class="Fb">{wc:$item['q_counttime']}</span>(100条时间记录之和)
							<span class="Fb"> % {wc:$item['canyurenshu']}</span>(本商品总需参与人次)
							<span class="Fb"> =  {wc:$shop_fmod}</span>(余数)<br>结果：
							<span class="Fb">{wc:$shop_fmod}</span>(余数)
							<span class="Fb"> + 10000001 = <em>{wc:$item['q_user_code']}</em></span><br>
                            <span class="Fb"></span>(余数是指整数除法中被除数未被除尽部分， 如7÷3 = 2 ......1，1就是余数。)

						</p>
						<b class="bg_yellow c_red">最终结果：{wc:$item['q_user_code']}</b>
					</div>
			<div style="width:100%;height:30px;clear:bolt;"></div>
	               </div>
            {wc:else}
                        <div class="RecordOnehundred"><h4> 未满100条计算结果 </h4>
                            <div class="ResultBox bg_red"><h2>计算结果</h2>
                                    <p class="num4">求和：
                                        <span class="Fb">{wc:$user_shop_time_add}</span>(揭晓时间求和结果)<br>取余：
                                        <span class="Fb">{wc:$user_shop_time_add}</span>(揭晓时间)
                                        <span class="Fb"> * 100 / {wc:$item['canyurenshu']}</span>(本商品总需参与人次)
                                        <span class="Fb"> = {wc:$user_shop_fmod}</span>(余数)<br>结果：
                                        <span class="Fb">{wc:$user_shop_fmod}</span>(余数)
                                        <span class="Fb"> + 1000001 = <em> {wc:$item['q_user_code']}</em></span>
                                    </p>
                                    <b class="bg_yellow c_red">最终结果：{wc:$item['q_user_code']}</b>
                                </div>  
            					<div style="width:100%;height:30px;clear:bolt;"></div>
                        </div>          
            {wc:if:end}
</div>
</div>
	<!-- 购买记录 -->
<div name="div_tab" id="bitem" class="AllRecordCon hide" style="display:none;">
        	{wc:loop $go_record_list $user}
        		<div class="AllRecW AllRecTime"><p>{wc:fun:microtDate($user['time'])}</p> <b></b></div>	
		<div class="AllRecW AllReclist">
			<div class="AllRecL fl">{wc:fun:microt($user['time'])}<i></i></div>
			<div class="AllRecR fl" style="background:#F8F8F8; border:1px solid #F8F8F8">
			<p class="AllRecR_T" style="line-height:15px;"> 
				<span name="spCodeInfo" class="AllRecR_Over">
				<a class="Headpic" href="{WEB_PATH}uname/{wc:fun:idjia($user['uid'])}" target="_blank"><img src="{G_UPLOAD_PATH}/{wc:$user['uphoto']}" border="0" width="20" height="20"></a>
				<a href="{WEB_PATH}uname/{wc:fun:idjia($user['uid'])}" target="_blank" class="blue">{wc:fun:_strcut($user['username'],6)}</a>
				{wc:if $user['ip']}
				({wc:fun:get_ip($user['id'],'ipcity')} IP:{wc:fun:get_ip($user['id'],'ipmac')})
				{wc:if:end}
				夺宝了<em class="Fb orange">{wc:$user['gonumber']}</em>人次
				</span>
			</p>
			</div>
		</div>
		{wc:loop:end}
	</div>
	<!-- 晒单 start-->
	<div name="div_tab" id="divPost"   class="Single_Content" style="display: none;">
		<iframe id="iframea" src="{WEB_PATH}/go/shaidan/itemiframstory/{wc:$itemid}" style="width:1200px; border:none; height:400px;" frameborder="0" scrolling="no"></iframe>
	</div>
	<!-- 晒单 end-->
	</div>
</div>
<script>
$("#btnOpenPeriod").click(function(){
		var ui_obj = $("#divPeriodList > ul");
		if($(this).attr("click")=='off'){
			$("#divPeriodList").css("max-height",ui_obj.length*33+"px");	
			$(this).attr("click","on");
			$(this).html("收起<s></s>");
			
		}else{
			$("#divPeriodList").css("max-height","99px");	
			$(this).attr("click","off");
			$(this).html("展开<i></i>");
		}			
});

function set_iframe_height(fid,did,height){
	$("#"+fid).css("height",height);
}

$(function(){
var fouli=$(".DetailsT_TitP ul li");
var divCalResult =  $("div[name='div_tab']");
	fouli.click(function(){		   
		var index=fouli.index(this);
		fouli.removeClass("DetailsTCur").eq(index).addClass("DetailsTCur");
		var iframe = divCalResult.hide().eq(index).find("iframe");
			if (typeof(iframe.attr("g_src")) != "undefined") {
			  	 iframe.attr("src",iframe.attr("g_src"));
				 iframe.removeAttr("g_src");
			}
			
		divCalResult.hide().eq(index).show();
	});   
	

	$(".Announced_But").click(function(){
		var next_li = $(".DetailsT_TitP ul>li");
		var index = $(this).index()
		next_li.eq(index).click();
        $("html,body").animate({scrollTop:800},1500);
	});

	
	$(window).scroll(function(){
		if($(window).scrollTop()>=941){
			$("#divMidNav").addClass("nav-fixed");
		}else if($(window).scrollTop()<941){
			$("#divMidNav").removeClass("nav-fixed");
		}
	});
});
function divOpen(){
var height=$("#userRnoId").css("height");
	if(height=="90px"){
		$("#userRnoId").css("height","auto");
	}else{
		$("#userRnoId").css("height",90);
	};
}
$(function(){	
	$("#divOpen").click(divOpen);
});

$(".yu_ff").mouseover(function(){
  $(".h_1yyg_eject").show();
})
$(".yu_ff").mouseout(function(){
  $(".h_1yyg_eject").hide();
})

	     $("#m_all_sort").hide();
     $(".m_menu_all").mouseenter(function(){
		    $(".m_all_sort").show();
     })
	 $(".m_menu_all").mouseleave(function(){
		    $(".m_all_sort").hide();
     })
	 $(".m_all_sort").mouseenter(function(){
		    $(this).show();
     })
	 $(".m_all_sort").mouseleave(function(){
		    $(this).hide();
     })
{wc:templates "index","footer"}