<{import file="mheader.html" title="商品收藏"}>  
<style type="text/css">
.lbox{ padding-top:20px 0 0 15px; float:left;}
.lcon{ width:1030px; float:left; }
.cgbox{ width:215px; height:215px; position: relative; border:1px solid #efefef; padding:25px 10px; margin:0 20px 15px 0; float:left;}
.cgbox:hover{ border:1px solid #ddd; }
.cgbox .img{ width:215px; height:160px; text-align:center; overflow:hidden; float:left; }
.cgbox .img img{ width:160px;}
.cgbox .ttl{ width:200px; height:20px; overflow:hidden; padding:10px 10px 0 10px; float:left;}
.cgbox .ttl a{ line-height:20px; color:#333; }
.cgbox .pr{ width:205px; padding:5px 0 0 5px; text-align:center; float:left;}
.cgbox .pr span{ padding:0 10px 0 0; color:#333; font-weight:bold; font-family: Verdana; font-size:16px; }
.cgbox .pr i{ font-style:inherit; background:#f00; color:#fff; border-radius:30px; width:12px; height:12px; line-height:12px; text-align:center; }
.cgbox .pr s{ margin-top:3px; color:#999; float:left; }
.cgbox .cancel{ width:236px; display:none; position:absolute; top:0; right:0; padding:0 0 0 5px; float:left;}
.cgbox .cancel a{ padding:2px 12px; background:#666; border:1px solid #666; color:#fff; float:right; } 
.cgbox:hover .cancel{ display:block; }
</style>
<{import file="collect/tab.html"}>
<div class="lbox">
	<{uqcms m="collect" v="data" c="goods:page=smarty.get.page&page_size=32"}>
	<{if $data.list}>
		<div class="lcon"> 
			<{foreach item=i from=$data.list}>	
				<div class="cgbox">
					<{if $i.status}>
						<div class="img">
							<a href="<{$__URI__}>goods/<{$i.gid}><{$__HTML__}>" target="_blank">
								<img src="<{$__IMG__}><{$i.images|img_size:160x160}>">
							</a>
						</div>
					<{else}>
						<div class="img"><img src="<{$__PUBLIC__}>images/shixiao.png"></div>
					<{/if}> 
					<div class="ttl"><a href="<{$__URI__}>goods/<{$i.gid}><{$__HTML__}>" target="_blank"><{$i.title}></a></div>
					<div class="pr">
						<span>￥<{$i.price}></span> 
						<{if $i.new_price}>
							<{if $i.price > $i.new_price}>
								<i>减</i> 
							<{/if}> 
						<{/if}>
					</div>
					<div class="cancel"><a href="javascript:;" class="collect_goods" data-gid="<{$i.gid}>">取消收藏</a></div> 
				</div>
			<{/foreach}>
		</div>
		<{if $data.page}><div class="page" style="text-align:center;"><{$data.page}></div><{/if}>
	<{else}>
		<div class="bfb">
			<div class="nomsg"><i></i><span>您还没有收藏产品~</span></div>
		</div>
	<{/if}>
</div>
<{import file="mfooter.html"}>
<script type="text/javascript">
$(function(){ 
	$(".collect_goods").click(function(){
		$this = $(this);
		gid = $this.attr('data-gid');
		$.post(URI+"ajax/collect_goods",{gid:gid},function(result){  
			var data = jQuery.parseJSON(result);  
			if(data.error == '0'){
				if(data.status == '2'){ 
					location.reload();
				}else if(data.status == '1'){ 
					$this.html('已经收藏');
				}else if(data.status == '0'){
					$this.html('收藏产品');
				}
			}else{
				alert(data.msg);
			} 
		}); 
	});
});
</script>