{wc:templates "index","header"}
<link rel="stylesheet" type="text/css" href="{G_TEMPLATES_STYLE}/css/GoodsList.css"/>
<link rel="stylesheet" type="text/css" href="{G_TEMPLATES_STYLE}/css/header.css"/>
<script>
function showh(){
var height=$("#ddBrandList").innerHeight();	
	if(height==78){
		$("#ddBrandList").css("height","auto");
		$(".list_classMore").addClass("MoreClick");
		$(".list_classMore").html("收起<i></i>");
	}else{
		$("#ddBrandList").css("height",78);
		$(".list_classMore").removeClass("MoreClick");
		$(".list_classMore").html("展开<i></i>");
	};
}
$(function(){	
	$(".list_classMore").click(showh);
});
</script>
<div class="wrap" id="loadingPicBlock">
	<div class="Current_nav"><a href="{WEB_PATH}">首页</a> &gt; {wc:$daohang_title}</div>
	<div id="current" class="list_Curtit">
		<h1 class="fl">{wc:$daohang_title}</h1> 
		<span id="spTotalCount">(共<em class="orange">{wc:$total}</em>件相关商品)</span>
	</div>
	
	{wc:php:start}
		if($fen1){
			$two_cate_list = $this->db->GetList("select cateid,parentid,name from `@#_category` where `parentid` = '$fen1' order by `order` DESC");
			if(!$two_cate_list && $daohang['parentid'])
			$two_cate_list = $this->db->GetList("select cateid,parentid,name from `@#_category` where `parentid` = '$daohang[parentid]' order by `order` DESC");
		}
	{wc:php:end}
	{wc:if !empty($two_cate_list)}
	<div class="list_class">
	<dl>
		<dt>分类</dt>
		<dd id="ddBrandList">
			<ul>            
				{wc:if $daohang['parentid']}
				<li><a href="{WEB_PATH}/goods_list/{wc:$daohang['parentid']}">全部</a></li>
                {wc:else}
                <li><a href="{WEB_PATH}/goods_list/{wc:$fen1}" class="ClassCur" >全部</a></li>
                {wc:if:end}

		
				{wc:loop $two_cate_list $two_cate}
					{wc:if $fen1 == $two_cate['cateid']}
					<li><a href="{WEB_PATH}/goods_list/{wc:$two_cate['cateid']}" class="ClassCur">{wc:$two_cate['name']}</a></li>
					{wc:else}
					<li><a href="{WEB_PATH}/goods_list/{wc:$two_cate['cateid']}">{wc:$two_cate['name']}</a></li>
					{wc:if:end}
				{wc:loop:end}
			</ul>
		</dd>
	</dl>
	</div>	
	{wc:if:end}

	<div class="list_class">
	<dl>
		<dt>品牌</dt>
		{wc:if count($brand)>17}
		<dd id="ddBrandList" style="height:78px">
		{wc:else}
		<dd id="ddBrandList">
		{wc:if:end}
			<ul>
            	{wc:if !$fen2}
				<li><a href="{WEB_PATH}/goods_list" class="ClassCur" >全部</a></li>
                {wc:else}
                <li><a href="{WEB_PATH}/goods_list">全部</a></li>
                {wc:if:end}
				{wc:loop $brand $brand2}
                {wc:if $brand2['id']==$fen2}
				<li><a class="ClassCur"  href="{WEB_PATH}/goods_list/{wc:$brand2['cateid']}e{wc:$brand2['id']}" title="{wc:$brand2['name']}">{wc:$brand2['name']}</a></li>
                {wc:else}
                <li><a  href="{WEB_PATH}/goods_list/{wc:$brand2['cateid']}e{wc:$brand2['id']}" title="{wc:$brand2['name']}">{wc:$brand2['name']}</a></li>
                 {wc:if:end}
				{wc:loop:end}
			</ul>
		</dd>
	</dl>

	{wc:if count($brand)>17}	
	<a class="list_classMore" href="javascript:;">展开<i></i></a>
	{wc:if:end}	
	</div>
	    <div class="list_Sort">
		    <dl>
			    <dt>排序</dt>
			    <dd>
                <a href="{WEB_PATH}/goods_list/{wc:$cate_band}/10" {wc:if $select=='10'}class="SortCur"{wc:if:end}>即将揭晓</a>
                <a href="{WEB_PATH}/goods_list/{wc:$cate_band}/20" {wc:if $select=='20'}class="SortCur"{wc:if:end}>人气</a>
                <a href="{WEB_PATH}/goods_list/{wc:$cate_band}/30" {wc:if $select=='30'}class="SortCur"{wc:if:end}>剩余人次</a>
                <a href="{WEB_PATH}/goods_list/{wc:$cate_band}/40" {wc:if $select=='40'}class="SortCur"{wc:if:end}>最新</a>
                {wc:if $select=='50'}
                <a href="{WEB_PATH}/goods_list/{wc:$cate_band}/60" class="Price_Sort SortCur">价格 <i></i></a>
                {wc:else}
                    {wc:if $select=='60'}
                   		<a href="{WEB_PATH}/goods_list/{wc:$cate_band}/50" class="Price_Sort SortCur">价格 <s></s></a>
                    {wc:else}
                    	<a href="{WEB_PATH}/goods_list/{wc:$cate_band}/50" class="Price_Sort">价格 <s></s></a>
                    {wc:if:end}
                {wc:if:end}
                </dd>
		    </dl>
	    </div>
	<div class="listContent">
	<ul class="item" id="ulGoodsList">		
		{wc:loop $shoplist $shop}
		<li class="goods-iten" >
			<div class="pic">
				<a href="{WEB_PATH}/goods/{wc:$shop['id']}" target="_blank" title="{wc:$shop['title']} ">
					{wc:if isset($shop['t_new_goods'])}						
							<i class="goods_xp"></i>					
					{wc:if:end}					
					{wc:if isset($shop['t_max_qishu'])}							
							<i class="goods_rq"></i>							
					{wc:if:end}
					
					{wc:if $shop['pos']!='0'}
					<i class="goods_tj"></i>
					{wc:if:end}
					<img alt="{wc:$shop['title']}" src="{G_UPLOAD_PATH}/{wc:$shop['thumb']}">
				</a>
				<p name="buyCount" style="display:none;"></p>
			</div>
			<p class="name">
				<a href="{WEB_PATH}/goods/{wc:$shop['id']}" target="_blank" title="{wc:$shop['title']} ">{wc:$shop['title']}</a>
			</p>
			<p class="money">价值：<span class="rmbgray">{wc:$shop['money']}</span></p>
			<div class="Progress-bar">
				<p title="已完成{wc:fun:percent($shop['canyurenshu'],$shop['zongrenshu'])}"><span style="width:{wc:fun:width($shop['canyurenshu'],$shop['zongrenshu'],213)}px;"></span></p>
				<ul class="Pro-bar-li">
					<li class="P-bar01"><em>{wc:$shop['canyurenshu']}</em>已参与人次</li>
					<li class="P-bar02"><em>{wc:$shop['zongrenshu']}</em>总需人次</li>
					<li class="P-bar03"><em>{wc:$shop['zongrenshu']-$shop['canyurenshu']}</em>剩余人次</li>
				</ul>
			</div>
			<div class="gl_buybtn">
				<div class="go_buy">
					<a href="javascript:;" title="立即云购" class="go_Shopping fl">立即云购</a>
					<a href="javascript:;" title="加入购物车" class="go_cart fr">加入购物车</a>
				</div>
			</div>
			
			<div class="Curbor_id" style="display:none;">{wc:$shop['id']}</div>
			<div class="Curbor_yunjiage" style="display:none;">{wc:$shop['yunjiage']}</div>
			<div class="Curbor_shenyu" style="display:none;">{wc:$shop['shenyurenshu']}</div>
		</li>
		{wc:loop:end}
	</ul>
	{wc:if $total>$num}
	<div class="pagesx">{wc:page:two}</div>
	{wc:if:end}
	</div>	  
</div>
<script type="text/javascript">

$(function(){
	$("#ulGoodsList li a.go_cart").click(function(){ 
		var sw = $("#ulGoodsList li a.go_cart").index(this);
		var src = $("#ulGoodsList li .pic a img").eq(sw).attr('src');				
		var $shadow = $('<img id="cart_dh" style="display:none; border:1px solid #aaa; z-index:99999;" width="200" height="200" src="'+src+'" />').prependTo("body");  			
		var $img = $("#ulGoodsList li .pic").eq(sw);
		$shadow.css({ 
			'width' : 200, 
			'height': 200, 
			'position' : 'absolute',      
			"left":$img.offset().left+16, 
			"top":$img.offset().top+9,
			'opacity' : 1    
		}).show();
		var $cart = $("#btnMyCart");
		$shadow.animate({   
			width: 1, 
			height: 1, 
			top: $cart.offset().top,    
			left: $cart.offset().left, 
			opacity: 0
		},500,function(){
			Cartcookie(sw,false);
		});	
		
	});
	$("#ulGoodsList li a.go_Shopping").click(function(){	
		var sw = $("#ulGoodsList li a.go_Shopping").index(this);

		Cartcookie(sw,true); 
	});	
});
//存到COOKIE
function Cartcookie(sw,cook){
	var shopid = $(".Curbor_id").eq(sw).text(),
		shenyu = $(".Curbor_yunjiage").eq(sw).text(),
		money = $(".Curbor_shenyu").eq(sw).text();
	var Cartlist = $.cookie('Cartlist');
	if(!Cartlist){
		var info = {};
	}else{
		var info = $.evalJSON(Cartlist);
	}
	if(!info[shopid]){
		var CartTotal=$("#sCartTotal").text();
			$("#sCartTotal").text(parseInt(CartTotal)+1);
			$("#btnMyCart em").text(parseInt(CartTotal)+1);
	}	
	info[shopid]={};
	info[shopid]['num']=1;
	info[shopid]['shenyu']=shenyu;
	info[shopid]['money']=money;
	info['MoenyCount']='0.00';
	$.cookie('Cartlist',$.toJSON(info),{expires:30,path:'/'});
	if(cook){
		window.location.href="{WEB_PATH}/member/cart/cartlist";
	}
}  

</script>
{wc:templates "index","footer"}