<{import file="common.html" title="产品收藏"}>
<style type="text/css"> 
.clist{ width:100%; background:#fff; padding:0 0 50px 0; float:left;} 
.clist .cbox{ width:100%; border-bottom:1px solid #efefef; padding:10px 0; float:left;} 
.clist .cbox .c_l{ width:80px; height:80px; overflow:hidden; margin:0 0 0 10px; text-align:center; float:left;}
.clist .cbox .c_l img{ max-width:80px; max-height:80px; }
.clist .cbox .b_r{ padding:0; width:auto; margin-left:100px;  }
.clist .cbox .b_r .ttl{ width:100%; float:left; }
.clist .cbox .b_r .ttl a{ font-size:13px; color:#333; line-height:22px; }
.clist .cbox .b_r .prgz{ width:100%; float:left; }
.clist .cbox .b_r .prgz span.pr{ color:#f00; font-size:16px; padding:5px 0 3px 0; float:left;}
.clist .cbox .b_r .prgz span.cancel{ padding:5px 10px 0 0; float:right;} 
.clist .cbox .b_r .prgz span.cancel a{ padding:2px 10px; color:#333; border:1px solid #ddd; border-radius:2px; font-size:12px; float:left; } 
</style> 
<div class="cnav">
	<a class="back">&nbsp;</a>关注的产品<a href="javascript:;" class="thome">主页</a>
</div>
<{include file="default/collect/tab.html"}>
<div class="clist">
	<{uqcms m="goods" v="data" c="collect:page=smarty.get.page&page_size=10&page_type=2"}>
	<{if $data.list}>
		<{foreach item=i from=$data.list}>	
			<div class="cbox">  
				<div class="c_l"><a href="?m=goods&a=detail&id=<{$i.gid}>"><img src="<{$__IMG__}><{$i.images|img_size}>" ></a></div>
				<div class="b_r">
					<div class="ttl"><a href="?m=goods&a=detail&id=<{$i.gid}>"><{$i.title}></a></div>
					<div class="prgz">
						<span class="pr">￥<{$i.price}></span>
						<span class="cancel"><a class="collect_goods" href="javascript:;" data-gid="<{$i.gid}>">取消收藏</a></span> 
					</div>
				</div> 
			</div>   
		<{/foreach}> 
		<{$data.page}>
	<{else}>
		<div class="nomsg"><span>暂无关注店铺</span></div>
	<{/if}>		
</div> 
<{include file="default/footer.html"}> 
<script type="text/javascript">
scrollLoad(".clist",".cbox");
$(function(){ 
	$(".collect_goods").click(function(){
		$this = $(this);
		gid = $this.attr('data-gid');
		$.post("index.php?m=ajax&a=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> 