<{import file="common.html" title="店铺收藏"}>
<style type="text/css">  
.clist{ width:100%; background:#fff; padding-bottom:50px; float:left;} 
.clist .cbox{ width:100%; border-bottom:1px solid #efefef; padding:10px 0; float:left;} 
.clist .cbox .b_l{ margin:0 0 0 10px; float:left;}
.clist .cbox .b_l .img{ width:80px; height:80px; float:left; }
.clist .cbox .b_l .img img{ max-width:80px; max-height:80px; }
.clist .cbox .b_l .con{ padding-left:5px; float:left; } 
.clist .cbox .b_l .con span.ttl{ width:100%; padding:2px 0 0 0; font-size:14px; float:left; } 
.clist .cbox .b_l .con span.num{ width:100%; color:#666; padding:2px 0 0 0; font-size:13px; float:left;} 
.clist .cbox .b_r{ margin:2px 10px 0 0; float:right; }  
.clist .cbox .b_r a{ padding:4px 10px 3px; background:#fff; 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="shop" 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="b_l">
					<div class="img">
						<a href="wap.php?m=shop&id=<{$i.sp_row.id}>"><img src="<{$__IMG__}><{$i.sp_row.logo|img_size:120x120}>"></a>
					</div>
					<div class="con">
						<span class="ttl"><a href="wap.php?m=shop&id=<{$i.sp_row.id}>"><{$i.sp_row.name}></a></span>  
						<span class="num">关注：<{$i.sp_row.collect}></span>  
					</div>
				</div>
				<div class="b_r"><a class="collect_shop" href="javascript:;" data-spid="<{$i.sp_row.id}>">取消收藏</a>	</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_shop").click(function(){
		$this = $(this);
		spid = $this.attr('data-spid');
		$.post("index.php?m=ajax&a=collect_shop", {spid:spid}, 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> 