<{import 
	file="header.html"
	title=$UQCMS.site_title
	keyword=$UQCMS.site_keywords
	describe =$UQCMS.site_describe
	css="public,index"
}> 
<div class="banner_bar" style="background:#f2f2f2;"> 
	<div class="banner">	
		<div class="spdcenter"> 
			<div id="focus">
				<ul>
					<{ads alias="index_focus_img" data="focus_img"}>
					<{foreach item=i from=$focus_img}>
						<li><a href="<{$i.link}>" target="_blank"><img style="float:left;" src="<{$__IMG__}><{$i.content}>"/></a></li>
					<{/foreach}>
				</ul> 
			</div> 
		</div>
		<div class="mbl">
			<div class="alogin"> 
				<{if $smarty.session.user.uid}>
					<div class="img">
						<img src="<{if $smarty.session.user.avatar}><{$__IMG__}><{$smarty.session.user.avatar|img_size:80x80}><{else}><{$__PUBLIC__}>images/avatar.png<{/if}>" width="80"/>
						<span>Hi，你好</span>
					</div>
					<div class="con">
						<p>
							<a href="<{$__URI__}>member/index">会员中心</a>
							<a href="<{$__URI__}>member/logout">退出</a>
						</p>
					</div>
				<{else}>
					<div class="img">
						<img src="<{$__PUBLIC__}>images/avatar.png" width="80"/>
						<span>Hi，你好</span>
					</div>
					<div class="con"> 
						<p>
							<a href="<{$__URI__}>member/login?returnUrl=<{$UQCMS.request_url}>">登陆</a>
							<a href="<{$__URI__}>member/register?returnUrl=<{$UQCMS.request_url}>">注册</a>
						</p>
					</div>
				<{/if}>
			</div>
			<div class="newtab">
				<div class="name"><span>商城动态</span></div>
				<div class="con">
					<div class="con1"> 
					<{uqcms m="help" v="ntc" c="get_list:alias=notice&page_size=5"}>
					<{if $ntc}>
						<{foreach item=i from=$ntc.list}>
							<a href="<{$__URI__}>help/<{$i.id}><{$__HTML__}>" target="_blank"><{$i.title|truncate:"12":"..."}></a>
						<{/foreach}>
					<{/if}>	 
					</div> 
				</div>
			</div>
			
			<div class="quick">
				<div class="name"><span>快捷入口</span></div>
				<div class="con">
					<a href="<{$__URI__}>collect/index"><em><img src="<{$__APP__}>public/images/qk_collect.png"></em><i>我的收藏</i></a>
					<a href="<{$__URI__}>order/index"><em><img src="<{$__APP__}>public/images/qk_order.png"></em><i>我的订单</i></a>
					<a href="<{$__URI__}>seller/index"><em><img src="<{$__APP__}>public/images/qk_seller.png"></em><i>商家入驻</i></a>
				</div> 
			</div>
			
		</div> 
	</div> 
</div>

<!--整点秒杀-->
<{uqcms m="promote" v="sps" c="seckill:limit=5"}>
<{if $sps.list}>
<div class="main_bar" style="background:#f2f2f2;position: relative;">
	<div class="main">  
		<div class="seckill">
			<div class="name">
				<div class="l"><a href="<{$__URI__}>goods/seckill" target="_blank">整点秒杀</a></div>
				<{if $sps.next_time > 0}>
					<div class="next_time" data-time="<{$sps.next_time}>">
						<div class="name2">距离下一波还有</div>
						<div class="djs_box" data-diff="<{$sps.next_diff}>"></div>
					</div>
				<{/if}>
			</div>
			<div class="con">
				<{foreach item=i key=key from=$sps.list}>
					<div class="skbox" <{if $key == 0}>style="border-left:none;"<{/if}>>
						<div class="img"><a href="<{$__URI__}>goods/<{$i.gid}><{$__HTML__}>" target="_blank"><img data-original="<{$__IMG__}><{$i.images|img_size:150x150}>" class="lazy"/></a></div>
						<div class="ttl"><a href="<{$__URI__}>goods/<{$i.gid}><{$__HTML__}>" target="_blank"><{$i.title}></a></div>
						<div class="pr">
							<div class="l"><i>￥</i><span><{$i.price}></span></div>
							<div class="r"><s>￥<{$i.market_price}></s></span></div>
						</div>
					</div>
				<{/foreach}>
			</div>
		</div>
	</div> 
</div>
<{/if}>

<!--中部活动-->
<{ads alias=pc_index_active data="index_act"}>	
<{if $index_act}>
	<div class="main_bar" style="position: relative;background:#f2f2f2;">
		<div class="main">  
			<div class="act">  
				<{foreach item=i from=$index_act}> 
					<{if $i.type == '2'}>
						<a href="<{$i.link}>" target="_blank"><img src="<{$__IMG__}><{$i.content|img_size:230x500}>"/></a>  
					<{/if}> 
				<{/foreach}>
			</div>
		</div>
	</div>
<{/if}>

<!--品牌列表-->
<{uqcms m="theme" v="brand" c="brand:page_size=16"}>
<{if $brand.list}>
	<div class="main_bar" style="position: relative;background:#f2f2f2;">
		<div class="main"> 
			<div class="brand">
				<div class="name">
					<div class="l"><a href="javascript:;" target="_blank">品牌专卖</a></div> 
				</div>
				<div class="con"> 
					<div class="bd">
						<{foreach item=i key=key from=$brand.list}> 
							<a href="<{$__URI__}>goods/index?brand=<{$i.id}>" target="_blank">
								<i><img src="<{$__IMG__}><{$i.images|img_size:100x0}>"/></i>
							</a>
						<{/foreach}>
					</div> 
				</div>
			</div> 
		</div> 
	</div>
<{/if}> 

<!--楼层列表-->
<div class="main_bar loulist" style=" position: relative;background:#f2f2f2;">
	<div class="main"> 
		<{uqcms m="theme" v="data" c="index_floor:page_size=8"}>
		<{foreach item=g from=$data}>
			<{if $g.goods}>
			<div class="detail">
				<div class="name">
					<h2 class="f<{$g.lou}>"><{$g.lou}>F <a href="<{$__URI__}>goods?cid=<{$g.cid}>" class="more"><{$g.cname}></a></h2> 
				</div>
				<div class="con">
					<div class="l">
						<div class="top lbbtm">
							<{ads alias=$g.ad_cid data="1f_ad"}>	
							<{foreach item=i from=$1f_ad}> 
								<{if $i.type == '2'}>
									<a href="<{$i.link}>" target="_blank"><img src="<{$__IMG__}><{$i.content|img_size:230x500}>"/></a> 
								<{/if}> 
							<{/foreach}>
						</div>
						<div class="hc"> 
							<{foreach item=c key=ck from=$g.cats}> 
								<a href="<{$__URI__}>goods?cid=<{$c.cid}>" title="<{$c.name}>"><{$c.name}></a>
							<{/foreach}> 
						</div>
					</div>
					<div class="c">
						<{foreach item=i from=$g.goods}> 
							<dl>
								<dt><a href="<{$__URI__}>goods/<{$i.id}><{$__HTML__}>" target="_blank"><img data-original="<{$__IMG__}><{$i.images|img_size:180x180}>" alt="<{$i.title}>" class="lazy"></a></dt>
								<dd><a class="ttl" href="<{$__URI__}>goods/<{$i.id}><{$__HTML__}>" title="<{$i.title}>"  target="_blank"><{$i.title|truncate:17:''}></a></dd>
								<dd class="pr"><span>¥ <{$i.price}></span></dd>
							</dl>
						<{/foreach}>
					</div>
					
				</div>
			</div> 
			<{/if}>
		<{/foreach}>
	</div> 
</div> 
<div class="sch_hidden_bar">
	<div class="sch_hidden">
		<div class="slogo"><a href=""><img src="<{$__IMG__}><{$UQCMS.site_logo}>"/></a></div>
		<form action="<{$__URI__}>" method="get">
			<div class="sch"> 
				<input type="hidden" name="m" value="goods"/>
				<input type="text" size="55" name="key"/>
				<input type="submit" id="ssx_submit" value="搜索"/>
			</div>
		</form>
		<div class="tcart"><a href="<{$__URI__}>cart" target="_blank"><span></span><i>购物车</i></a></div>
	</div>
</div>
<{import file="footer.html"}>
<script type="text/javascript">
lazyload();
// 优惠券领取 
$(document).on('click', 'a.coupon_receive', function(){ 
	id = $(this).attr('data-id');
	$.post('<{$__URI__}>ajax/coupon_receive',{id:id},function(result){
		data = jQuery.parseJSON(result);
		if(data.error == '0'){
			alert('领取成功');
		}else if(data.error == '4'){
			sys_login(function(){
				$.post('<{$__URI__}>ajax/coupon_receive',{id:id},function(result){
					data = jQuery.parseJSON(result);
					if(data.error == '0'){
						alert('领取成功');
					}else{
						alert(data.msg);
					}
				});
			});
		}else{
			alert(data.msg);
		}
	});
});
 
<{if $sps.next_time > 0}>
	countDown('.djs_box');
<{/if}>
/*首页轮播*/
span_ch = '<h4>';
$("#focus ul li").each(function(i){ 
	if(i == 0){
		span_ch += '<span class="ch"></span>';
	}else{
		span_ch += '<span></span>';
	} 
});
span_ch += '</h4>';
$("#focus ul").append(span_ch);
 
var curIndex = 0; 
var autoChange;
autoChange = setInterval(function(){ 
	changeTo(); 
},3000);

$("#focus h4 span").hover(function(){
	clearInterval(autoChange);
	curIndex = $(this).index();
	changeTo(curIndex);
},function(){
	autoChange = setInterval(function(){ 
		changeTo(); 
	},2000);
});

function changeTo(){ 
	if(curIndex > $("#focus li").length-1){ 
		curIndex = 0;
		next=0;
	} 
	// 改变大图
	$("#focus li").eq(curIndex).stop().fadeTo(300,0.9).siblings('li').stop().fadeTo(300, 0); 
	// 改变按钮
	$("#focus h4 span").eq(curIndex).siblings().removeClass('ch');
	$("#focus h4 span").eq(curIndex).addClass('ch'); 
	curIndex ++; 
}

$(function() { 
	$(".newtab .name a").hover(function(){
		$(this).addClass("ch").siblings('a').removeClass("ch");  
		var $index=$(this).index(); 
      	$(".newtab .con .con1").eq($index).show().siblings('.newtab .con .con1').hide();  
	});
	// 滚动到中部，显示顶部搜索 
	$(window).scroll(function(e){ 
		st = $(document).scrollTop();
		if(st > 300){ 
			$(".sch_hidden_bar").show();
		}else{
			$(".sch_hidden_bar").hide();
		}
	}); 
	// 倒计时
	SysSecond = parseInt($(".next_time").attr("data-time")); 
	SetRemainTime();
	InterValObj = window.setInterval(SetRemainTime, 1000);  
}); 
</script>