<{import file="index/header.html" title="店铺收藏"}> 
<{include file="collect/tab.html"}> 
<style type="text/css"> 
.cslist{ width:1028px; margin-bottom:20px; border:1px solid #efefef; float:left; }
.cslist .cgbox{ width:220px; text-align:center; float:left; }
.cslist .cgbox .img{ width:100%; padding:15px 0 0 0; float:left; }
.cslist .cgbox .img img{ height:70px; }
.cslist .cgbox .rit{ width:100%; float:left; }
.cslist .cgbox .rit .ttl{ width:100%; padding:8px 0 10px 0; float:left; }
.cslist .cgbox .rit .ttl a{ color:#333; border-radius:2px; }
.cslist .cgbox .rit .cancel{}
.cslist .cgbox .rit .cancel a{ border:1px solid #ccc; padding:2px 10px 3px; }

.cslist .gsall{ width:780px; border-left:1px solid #efefef; float:left; }
.cslist .gsall dl{ width:120px; margin:15px 0px 20px 35px; float:left; }
.cslist .gsall dl dt{ width:120px; height:120px; overflow:hidden; }
.cslist .gsall dl dd{ width:100%; padding:5px 0 0 0; float:left; }
.cslist .gsall dl dd.pr{ color:#333; text-align:center; font-size:16px; font-family: verdana; }

</style>
<div class="lbox">
	<{uqcms m="shop" v="data" c="collect:page=smarty.get.page&page_size=10"}>
	<{if $data.list}> 
		<div class="lcon"> 
			<{foreach item=i from=$data.list}>
				<div class="cslist">
					<div class="cgbox">
						<div class="img">
							<a href="index.php?m=shop&id=<{$i.sp_row.id}>" target="_blank"><img src="<{$__IMG__}><{$i.sp_row.logo|img_size:80x80}>"></a>
						</div>
						<div class="rit">
							<div class="ttl"><a href="index.php?m=shop&id=<{$i.sp_row.id}>" target="_blank"><{$i.sp_row.name}></a></div> 
							<div class="cancel"><a class="collect_shop" href="javascript:;" data-spid="<{$i.sp_row.id}>">取消收藏</a></div> 	
						</div>
					</div>
					<div class="gsall">
					<{foreach item=gi from=$i.gs_all}>
						<dl>
							<dt><a href="index.php?m=goods&a=detail&id=<{$gi.id}>" target="_blank"><img src="<{$__IMG__}><{$gi.images|img_size:120x120}>"></a></dt>
							<dd><a href="index.php?m=goods&a=detail&id=<{$gi.id}>" target="_blank"><{$gi.title|truncate:10:""}></a></dd>
							<dd class="pr">¥<{$gi.price}></dd>
						</dl>
					<{/foreach}>	
					</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>
<{include file="index/footer.html"}>
<script type="text/javascript">
$(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>