
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>我的{wc:fun:_cfg('web_name_two')}记录 - {wc:$webname}触屏版</title>
    <meta content="app-id=518966501" name="apple-itunes-app" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no, maximum-scale=1.0"/>
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
	<link rel="stylesheet" type="text/css" href="{G_TEMPLATES_CSS}/aui/foot.css" />
    <link href="{G_TEMPLATES_CSS}/mobile/comm.css" rel="stylesheet" type="text/css" /><link href="{G_TEMPLATES_CSS}/mobile/member.css" rel="stylesheet" type="text/css" /><script src="{G_TEMPLATES_JS}/mobile/jquery190.js" language="javascript" type="text/javascript"></script><script id="pageJS" data="{G_TEMPLATES_JS}/mobile/userbuylist.js" language="javascript" type="text/javascript"></script>
</head>
<body>
<div class="h5-1yyg-v1" id="loadingPicBlock">
    
<!-- 栏目页面顶部 -->


<!-- 内页顶部 -->
<header class="header">
<div class="n-header-wrap">
<div class="backbtn">
<a href="javascript:;" onclick="history.go(-1)" class="h-count white">
</a>
</div>
<div class="h-top-right ">
<a href="{WEB_PATH}/mobile/home" class="h-search white"></a>
</div>
<div class="n-h-tit"><h1 class="header-logo">我的{wc:fun:_cfg('web_name_two')}记录</h1></div>
</div>
</header>
<style>
.add{
float:right;
margin-right:100px;
margin-top:-20px;
}
.xq{
float:right;
margin-right:50px;
margin-top:-20px;

}
</style>


    <div id="navBox" class="g-snav">
		    
    </div>
    <section class="clearfix g-Record-lst">
	<div class="goodsNav">
             <ul id="divGoodsNav" style="background-color: rgb(37, 202, 168);display: block;">
       	 	   <center><a href="#"><img src="images/zhuijia.png" alt="" height="150PX" width="320PX"></a></center>
           </ul>
        </div>
        <ul class="z-minheight">
		{wc:loop $record $rt}
        {wc:php:start}
        	$jiexiao = get_shop_if_jiexiao($rt['shopid']);
        {wc:php:end}
		{wc:if $jiexiao['q_uid']}
	        
			<li onclick="location.href='{WEB_PATH}/mobile/home/userbuydetail/{wc:$rt['id']}'">
			<a class="fl z-Limg">
			<span class="z-Imgbg z-ImgbgC02"></span>
			<em class="z-Imgtxt">已揭晓</em>
			<img src="{G_UPLOAD_PATH}/{wc:$jiexiao['thumb']}" alt="" border="0"></a>
			<div class="u-sgl-r "><p class="z-sgl-tt">
			<a class="gray6">第({wc:$rt['shopqishu']})期 {wc:$rt['shopname']}</a></p>
			<p>获得者：{wc:fun:get_user_name($jiexiao['q_user'])}</p>
			<p>揭晓时间：<em class="gray6">{wc:fun:date("Y-m-d H:i:s",$jiexiao['q_end_time'])}</em></p></div>
			<b class="z-arrow"></b><a class="xq" onclick="location.href='{WEB_PATH}/mobile/home/userbuydetail/{wc:$rt['id']}'">详情</a></li>

		{wc:else}
			<li><a class="fl z-Limg"><span class="z-Imgbg z-ImgbgC01"></span><em class="z-Imgtxt">进行中...</em><img src="{G_UPLOAD_PATH}/{wc:$jiexiao['thumb']}" alt="" border="0"></a><div class="u-sgl-r "><p class="z-sgl-tt"><a class="gray6">第({wc:$rt['shopqishu']})期 {wc:$rt['shopname']}</a></p><p>已参与<em class="orange">{wc:$rt['gonumber']}</em>人次</p><div class="Progress-bar"><p class="u-progress"><span style="width:1%;" class="pgbar"><span class="pging"></span></span></p><ul class="Pro-bar-li"><li class="P-bar01"><em>{wc:$rt['gonumber']}</em>已参与</li></ul></div></div><b class="z-arrow"></b><a class="add" onClick="javascript:addshop();" codeid="{wc:$rt['shopid']}" href="javascript:;">追加</a><a class="xq" onclick="location.href='{WEB_PATH}/mobile/home/userbuydetail/{wc:$rt['id']}'">详情</a></li>

			{wc:if:end}
		{wc:loop:end}	
        </ul>
		
    </section>
    <script type="text/javascript">

	function search(){
		var value = document.getElementById("sname").value;
		window.location.href="{WEB_PATH}/mobile/user/search/?&name="+value; 
	}
	//打开页面加载数据
window.onload=function(){
	glist_json("list/10");
	//购物车数量
	$.getJSON('{WEB_PATH}/mobile/ajax/cartnum',function(data){
		if(data.num){
			$("#btnCart").append('<em>'+data.num+'</em>');
		}
	});
	
}
//获取数据
function glist_json(parm){
	$("#urladdress").val('');
	$("#pagenum").val('');
	$.getJSON('{WEB_PATH}/mobile/mobile/gistajax/'+parm,function(data){
		$("#divGoodsLoading").css('display','none');		
		if(data[0].sum){
			var fg=parm.split("/");
			$("#urladdress").val(fg[0]+'/'+fg[1]);
			$("#pagenum").val(data[0].page);
			for(var i=0;i<data.length;i++){			
			var ul='<ul><li>';
				ul+='<span id="'+data[i].id+'" class="z-Limg"><img src="{G_UPLOAD_PATH}/'+data[i].thumb+'"></span>';
				ul+='<div class="goodsListR">';
				ul+='<h2 id="'+data[i].id+'">'+data[i].title+'</h2>';
				ul+='<div class="pRate">';
				ul+='<div class="Progress-bar" id="'+data[i].id+'">';				
				ul+='<p class="u-progress"><span class="pgbar" style="width:'+(data[i].canyurenshu / data[i].zongrenshu)*100+'%;"><span class="pging"></span></span></p>';
				ul+='<ul class="Pro-bar-li">';
				ul+='<li class="P-bar01"><em>'+data[i].canyurenshu+'</em>已参与</li>';
				ul+='<li class="P-bar02"><em>'+data[i].zongrenshu+'</em>总需人次</li>';
				ul+='<li class="P-bar03"><em>'+data[i].shenyurenshu+'</em>剩余</li>';
				ul+='</ul></div>';
				ul+='<a class="add" onClick="javascript:addshop();" codeid="'+data[i].id+'" href="javascript:;"><s></s></a>';
				ul+='</div></div></li></ul>';
				$("#divGoodsLoading").before(ul);			
			}
			if(data[0].page<=data[0].sum){
				$("#btnLoadMore").css('display','block');
				$("#btnLoadMore2").css('display','none');
				$("#btnLoadMore3").css('display','none');
			}else if(data[0].page>data[0].sum){
				$("#btnLoadMore").css('display','none');
				$("#btnLoadMore2").css('display','none');
				$("#btnLoadMore3").css('display','block');
			}
		}else{
			$("#btnLoadMore").css('display','none');
			$("#btnLoadMore2").css('display','block');	
			$("#btnLoadMore3").css('display','none');			
		}
	});
}
$(document).ready(function(){
	//即将揭晓,人气,最新,价格	
	$("#divGoodsNav li:not(:last)").click(function(){
		var l=$(this).index();
		$("#divGoodsNav li").removeClass().eq(l).addClass('current');
		var parm=$("#divGoodsNav li").eq(l).attr('order');
		$("#divGoodsLoading").css('display','block');
		$(".goodsList ul").remove();
		var glist=glist_json("list/"+parm);
	});
	
	//商品分类
	var dl=$("#divGoodsNav dl"),
		last=$("#divGoodsNav li:last"),
		first=$("#divGoodsNav dd:first");
	$("#divGoodsNav li:last a:first").click(function(){		
		if(dl.css("display")=='none'){
			dl.show();
			last.addClass("gSort");
			first.addClass("sOrange");			
		}else{
			dl.hide();
			last.removeClass("gSort");
			first.removeClass("sOrange");
		}
	});
	$("#divGoodsNav  dd").click(function(){
		var s=$(this).index();
		var t=$("#divGoodsNav .gSort dd a").eq(s).html();
		var id=$("#divGoodsNav .gSort dd a").eq(s).attr('id');
		$("#divGoodsNav .gSort a:first").html(t+'<s class="arrowUp"></s>');
		var l=$("#divGoodsNav .current").index(),
			parm=$("#divGoodsNav li").eq(l).attr('order');
		if(id){			
			$("#divGoodsLoading").css('display','block');
			$(".goodsList ul").remove();
			glist_json(id+'/'+parm);
		}else{
			glist_json("list/"+parm);
			$(".goodsList ul").remove();
		}	
		dl.hide();
		last.removeClass("gSort");
		first.removeClass("sOrange");
	});
	//加载更多
	$("#btnLoadMore").click(function(){		
		var url=$("#urladdress").val(),
			page=$("#pagenum").val();
		glist_json(url+'/'+page);
	});	
	//返回顶部
	$(window).scroll(function(){
		if($(window).scrollTop()>50){
			$("#btnTop").show();
		}else{
			$("#btnTop").hide();
		}
	});
	$("#btnTop").click(function(){
		$("body").animate({scrollTop:0},10);
	});
	//添加到购物车
	$(document).on("click",'.add',function(){
		var codeid=$(this).attr('codeid');
		$.getJSON('{WEB_PATH}/mobile/ajax/addShopCart/'+codeid+'/1',function(data){
			if(data.code==1){
				addsuccess('添加失败');
			}else if(data.code==0){
				addsuccess('添加成功');	
				window.location.href="{WEB_PATH}/mobile/cart/cartlist"; 
			}return false;
		});
	});
	function addsuccess(dat){
		$("#pageDialogBG .Prompt").text("");
		var w=($(window).width()-255)/2,
			h=($(window).height()-45)/2;
		$("#pageDialogBG").css({top:h,left:w,opacity:0.8});
		$("#pageDialogBG").stop().fadeIn(1000);
		$("#pageDialogBG .Prompt").append('<s></s>'+dat);
		$("#pageDialogBG").fadeOut(1000);
		//购物车数量
		$.getJSON('{WEB_PATH}/mobile/ajax/cartnum',function(data){
			
			$(".car").append('<b class="pig" id="pig">'+data.num+'</b>');
		});
	}
	//跳转页面
	var gt='.goodsList span,.goodsList h2,.goodsList .Progress-bar';
	$(document).on('click',gt,function(){
		var id=$(this).attr('id');
		if(id){
			window.location.href="{WEB_PATH}/mobile/mobile/item/"+id;
		}			
	});

});

</script>
{wc:templates "mobile/index","footer"}
<script language="javascript" type="text/javascript">
  var Path = new Object();
  Path.Skin="{G_TEMPLATES_STYLE}";  
  Path.Webpath = "{WEB_PATH}";
  Path.imgpath = "{G_WEB_PATH}/statics";
  
var Base={head:document.getElementsByTagName("head")[0]||document.documentElement,Myload:function(B,A){this.done=false;B.onload=B.onreadystatechange=function(){if(!this.done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){this.done=true;A();B.onload=B.onreadystatechange=null;if(this.head&&B.parentNode){this.head.removeChild(B)}}}},getScript:function(A,C){var B=function(){};if(C!=undefined){B=C}var D=document.createElement("script");D.setAttribute("language","javascript");D.setAttribute("type","text/javascript");D.setAttribute("src",A);this.head.appendChild(D);this.Myload(D,B)},getStyle:function(A,B){var B=function(){};if(callBack!=undefined){B=callBack}var C=document.createElement("link");C.setAttribute("type","text/css");C.setAttribute("rel","stylesheet");C.setAttribute("href",A);this.head.appendChild(C);this.Myload(C,B)}}
function GetVerNum(){var D=new Date();return D.getFullYear().toString().substring(2,4)+'.'+(D.getMonth()+1)+'.'+D.getDate()+'.'+D.getHours()+'.'+(D.getMinutes()<10?'0':D.getMinutes().toString().substring(0,1))}
Base.getScript('{G_TEMPLATES_JS}/mobile/Bottom.js?v='+GetVerNum());
</script>
 
</div>
</body>
</html>
