<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{$title}</title>
<meta name="keywords" content="{$keywords}" />
<meta name="description" content="{$description}" />
<meta name="generator" content="openwbs {$version}" />
<meta name="author" content="openwbs team" />
<meta name="copyright" content="2008-2020 OpenWBS Inc." />
<!--#include file="include.css.html"-->
<link rel="stylesheet" href="../css/ow.index.css?v={$version_sn}" />
</head>
<body>
<!--头部-->
<div class="ow-toper-hero">{ad id="4" type="html"}</div>
<!--#include file="include.header.html"-->
<div class="ow-all-category" id="allcates">
    <div class="ow-main-banner">{ad id="1" type="html"}</div>
    <div class="cates">
        <div class="cates-section">
            {cate is_shop="1" parent_id="0"}
            <ul>
            {cate:loop}
             <li class="n1 li[cate:i]" cate_id="[cate:cate_id]"><a href="[cate:link]">[cate:name]<em>[cate:subname]</em><i class="glyphicon glyphicon-chevron-right"></i></a>
                 <div class="subnav subnav[cate:i]">
                     <ul cate_id="[cate:cate_id]">
                     {cate2 parent_id="[cate:cate_id]"}
                     {cate2:loop}
                     <li><a href="[cate2:link]">[cate2:name]</a></li>
                     {/cate2:loop}
                     {/cate2}
                     </ul>
                 </div>
             </li>
            {/cate:loop}
            </ul>
            {/cate}
            <div class="subcates" id="subcates"></div>
        </div>
    </div>
    <script type="text/javascript">
	$(document).ready(function(){
		var $allcates = $("#allcates"),
		$subcates     = $("#subcates");
		$("#allcates li.n1").hover(
			function(){
				$(this).addClass("hover");
				var subNum = $(this).find("div.subnav").find("li").length;
				if(subNum>0){
					$subcates.attr("cate_id",$(this).attr("cate_id"));
					$subcates.html($(this).find("div.subnav").html()).show();
					if(subNum>10){
						$subcates.addClass("subcates-big");
					}else{
						$subcates.removeClass("subcates-big");
					};
				};
			},
			function(){
				$(this).removeClass("hover");
				$subcates.hide();
			}
		);
		$subcates.hover(
			function(){
				var cateId = $(this).attr("cate_id");
				$allcates.find("li[cate_id='"+cateId+"']").addClass("hover");
				$(this).show();
			},
			function(){
				var cateId = $(this).attr("cate_id");
				$allcates.find("li[cate_id='"+cateId+"']").removeClass("hover");
				$(this).hide();
			}
		);
	});
    </script>
</div>
<div class="ow-notice" id="ow_notice">{$notice}</div>

<div id="mbody">
    <div class="idx-hero-sub">
        <div class="wrapper">
            <div class="idx-service4">
                <ul>
                    <li class="li1"><a href="{$site_url}?news/"><i class="glyphicon glyphicon-list-alt"></i><span>新闻公告</span></a></li>
                    <li class="li2"><a href="{$site_url}?coupon/"><i class="glyphicon glyphicon-barcode"></i><span>优惠券</span></a></li>
                    <li class="li3"><a href="{$site_url}ow-ucenter/"><i class="glyphicon glyphicon-user"></i><span>会员中心</span></a></li>
                    <li class="li4"><a href="{$site_url}ow-ucenter/?ctl=orders"><i class="glyphicon glyphicon-shopping-cart"></i><span>订单查询</span></a></li>
                    <li class="li5"><a href="{$site_url}ow-ucenter/?ctl=point"><i class="glyphicon glyphicon-copyright-mark"></i><span>我的积分</span></a></li>
                    <li class="li6"><a href="{$site_url}ow-ucenter/?ctl=system_msg"><i class="glyphicon glyphicon-envelope"></i><span>我的消息</span></a></li>
                </ul>
            </div>
            <div class="idx-hero-promo">
                <ul><%=OW.echoAdImg("3","<li i=""{$i}""><a href=""{$link}"" target=""_blank""><img src=""{$url}"" alt=""{$name}"" title=""{$name}""></a></li>")%></ul>
            </div>
        </div>
    </div>
    <div class="clear"></div>
    
    {if:OW.int("{$config(is_goods_sales_broadcast)}")>0}
    <div class="ow-goods-sales-broadcast">
        <dl><dt>最新商品销售实时播报：</dt><dd><ul class="marquee" id="marquee"><%=OS.getGoodsSalesBroadcast(10)%></ul></dd></dl>
    </div>
    <div class="clear"></div>
    <script type="text/javascript" src="../js/jquery.marquee.js"></script>
    <script type="text/javascript">  
    $(document).ready(function(){$("#marquee").marquee({yScroll:"bottom",scrollSpeed:10,pauseSpeed:2000,pauseOnHover:true});  }); 
    </script>
    {/if}
    <div class="ow-rich-text">{ow:home-pc-richtext}</div>
    
    <!--秒杀活动-->
    {activity type="1" is_show_index="1"}
    {activity:loop}
    <div class="idx-activity-goods wrapper" id="os_activity_goods">
        <div class="header">
            <h2 class="title">[activity:title]</h2><span class="subtitle">[activity:subtitle]</span>
        </div>
        <div class="section">
            {goods activity_id="[activity:activity_id]"}
            <ul class="ow-goods-horizlist">
                {goods:loop}
                <li class="li[goods:i] {if:OW.int("[goods:i]") mod 2 = 0}even{/if}" name="goods">
                    <div class="thumb" name="goods"><a href="[goods:link]"><img src="[goods:thumbnail]" alt="[goods:title]" title="[goods:title]" /></a></div>
                    <div class="info">
                        <h3 class="title"><a href="[goods:link]">[goods:ctitle]</a></h3>
                        {if:OW.isNotNul("[goods:subtitle]")}<p class="subtitle">[goods:subtitle]</p>{/if}
                        <div class="price"><i class="icon-text icon-text-seckill">秒杀价</i><span class="money"><em>{$moneysb}</em><b><%=OW.parsePrice(OS.getGoodsMinSeckillPrice("[goods:gid]"))%></b></span></div>
                        <div class="buy"><a class="btnbuy" href="[goods:link]">立即抢购</a></div>
                    </div>
                </li>
                {/goods:loop}
            </ul>
            {/goods}
        </div>
    </div>
    {/activity:loop}
    {/activity}
    <!--拼团活动-->
    {activity type="2" is_show_index="1"}
    {activity:loop}
    <div class="idx-activity-goods wrapper" id="os_activity_goods">
        <div class="header">
            <h2 class="title">[activity:title]</h2><span class="subtitle">[activity:subtitle]</span>
        </div>
        <div class="section">
            {goods activity_id="[activity:activity_id]"}
            <ul class="ow-goods-horizlist">
                {goods:loop}
                <li class="li[goods:i] {if:OW.int("[goods:i]") mod 2 = 0}even{/if}" name="goods">
                    <div class="thumb" name="goods"><a href="[goods:link]"><img src="[goods:thumbnail]" alt="[goods:title]" title="[goods:title]" /></a></div>
                    <div class="info">
                        <h3 class="title"><a href="[goods:link]">[goods:ctitle]</a></h3>
                        {if:OW.isNotNul("[goods:subtitle]")}<p class="subtitle">[goods:subtitle]</p>{/if}
                        <div class="price">
                            <i class="icon-text icon-text-seckill">拼团价</i><span class="money"><em>{$moneysb}</em><b><%=OW.parsePrice(OS.getGoodsMinSeckillPrice("[goods:gid]"))%></b></span>
                            <span class="sub">[goods:groupbuy_num]人成团</span>
                        </div>
                        <div class="buy"><a class="btnbuy" href="[goods:link]">立即拼团</a></div>
                    </div>
                </li>
                {/goods:loop}
            </ul>
            {/goods}
        </div>
    </div>
    {/activity:loop}
    {/activity}
    
    <div class="idx-star-goods" id="ow_star_goods">
        <div class="wrapper">
            <div class="header">
                <h2 class="title">{%=OW.DB.getFieldValueBySQL("SELECT [name] FROM ow_position WHERE pos_id=4")%}</h2>
                <div class="more"><a class="prev" href="javascript:;"><i class="glyphicon glyphicon-chevron-left"></i></a><a class="next" href="javascript:;"><i class="glyphicon glyphicon-chevron-right"></i></a></div>
            </div>
            <div class="section">
                <div class="section-wrapper">
                    {goods top="30" position_id="4"}
                    <ul>
                        {goods:loop}
                        <li class="li[goods:i]" name="goods">
                            <div class="thumb"><a href="[goods:link]" title="[goods:title]" target="_blank"><img src="[goods:thumbnail]" alt="[goods:title]" title="[goods:title]"></a></div>
                            <div class="info">
                                <h3 class="title"><a href="[goods:link]" title="[goods:title]" target="_blank">[goods:ctitle]</a></h3>
                                {if:OW.isNotNul("[goods:subtitle]")}<p class="subtitle">[goods:subtitle]</p>{/if}
                                <p class="price">{if:OW.int("[goods:point_set]")=1}<span class="point"><b>[goods:point_pay_amount]</b><em>积分</em><i>+</i></span>{/if}<span class="money"><em>{$moneysb}</em><b><%=OW.parsePrice("[goods:price]")%></b></span></p>
                            </div>
                        </li>
                        {/goods:loop}
                    </ul>
                    {/goods}
                </div>
                
            </div>
        </div>
    </div>
    
    <!--楼层-->
    <div class="idx-floor" id="ow_floor">
        {cate is_shop="1" parent_id="0"}
        {cate:loop}
        <div class="shop-floor shop-floor-[cate:i]">
            <div class="header">
                <h2 class="title"><span class="floor-num">[cate:i]F</span><a class="floor-name" href="[cate:link]" target="_blank">[cate:name]</a></h2>
                <ul class="subcate">{cate2 top="10" parent_id="[cate:cate_id]"}{cate2:loop}<li class="spacer spacer-[cate2:i]"></li><li class="link"><a href="[cate2:link]" target="_blank">[cate2:name]</a></li>{/cate2:loop}{/cate2}</ul>
            </div>
            <div class="section">
                <div class="shop-floor-goods">
                    <ul class="clearfix" name="floor_goods">
                        <li class="hero" name="goods"><div id="ow_ad_[cate:cate_id]" type="image" data='[cate:ad_image_data]' style="height:330px; width:228px; margin:auto;" ad_height="330px" ad_width="228px" full_screen="0" switch_time="6"></div><script type="text/javascript">$(document).ready(function(){OW.ad.parse("[cate:cate_id]");});</script></li>
                        {goods top="30" recommend_cate_id="[cate:cate_id]"}
                        {goods:loop}
                        <li name="goods">
                            <div class="thumb"><a href="[goods:link]" title="[goods:title]" target="_blank"><img src="[goods:thumbnail]" alt="[goods:title]" title="[goods:title]"></a></div>
                            <div class="info">
                                <h3 class="title"><a href="[goods:link]" title="[goods:title]" target="_blank">[goods:ctitle]</a></h3>
                                {if:OW.isNotNul("[goods:subtitle]")}<p class="subtitle">[goods:subtitle]</p>{/if}
                                <p class="price">{if:OW.int("[goods:point_set]")=1}<span class="point"><b>[goods:point_pay_amount]</b><em>积分</em><i>+</i></span>{/if}<span class="money"><em>{$moneysb}</em><b><%=OW.parsePrice("[goods:price]")%></b></span></p>
                            </div>
                        </li>
                        {/goods:loop}
                        {/goods}
                    </ul>
                </div>
            </div>
        </div>
        {/cate:loop}
        {/cate}
    </div>
    
    <!--为你推荐-->
    <div class="idx-recomd-goods" id="ow_recomd_goods">
        <div class="wrapper">
            <div class="header">
                <h2 class="title">{%=OW.DB.getFieldValueBySQL("SELECT [name] FROM ow_position WHERE pos_id=5")%}</h2>
                <div class="more"><a class="prev" href="javascript:;"><i class="glyphicon glyphicon-chevron-left"></i></a><a class="next" href="javascript:;"><i class="glyphicon glyphicon-chevron-right"></i></a></div>
            </div>
            <div class="section">
                <div class="section-wrapper">
                    {goods top="30" position_id="5"}
                    <ul>
                        {goods:loop}
                        <li class="li[goods:i]" name="goods">
                            <div class="thumb"><a href="[goods:link]" title="[goods:title]" target="_blank"><img src="[goods:thumbnail]" alt="[goods:title]" title="[goods:title]"></a></div>
                            <div class="info">
                                <h3 class="title"><a href="[goods:link]" title="[goods:title]" target="_blank">[goods:ctitle]</a></h3>
                                {if:OW.isNotNul("[goods:subtitle]")}<p class="subtitle">[goods:subtitle]</p>{/if}
                                <p class="price">{if:OW.int("[goods:point_set]")=1}<span class="point"><b>[goods:point_pay_amount]</b><em>积分</em><i>+</i></span>{/if}<span class="money"><em>{$moneysb}</em><b><%=OW.parsePrice("[goods:price]")%></b></span></p>
                            </div>
                        </li>
                        {/goods:loop}
                    </ul>
                    {/goods}
                </div>
                
            </div>
        </div>
    </div>
    
    <!--企业新闻-->
    <div class="ow-idx-news" id="ow_news">
        <div class="wrapper">
            <h2 class="header">{%=OW.DB.getFieldValueBySQL("SELECT [name] FROM ow_category WHERE cate_id=2 AND "& OW.DB.auxSQL &"")%}</h2>
            <div class="cates">
                {cate top="6" parent_id="2"}
                <ul>
                    {cate:loop}<li name="tab" tab="[cate:i]"><a href="[cate:link]">[cate:name]</a></li>{/cate:loop}
                </ul>
                {/cate}
            </div>
            <div class="section clearfix">
                {content top="10" position_id="1" model="news"}
                <ul>
                    {content:loop}
                    <li class="li[content:i]" name="item">
                        <div class="thumb"><a href="[content:link]"><img src="[content:thumbnail]" alt="[content:title]" title="[content:title]"></a></div>
                        <div class="info">
                            <h3 class="title"><a href="[content:link]">[content:title]</a></h3>
                            <div class="summary"><%=OW.leftString("[content:summary]",36)%><span class="raquo"><a href="[content:link]" target="_blank">»</a></span></div>
                            <div class="datetime" name="datetime" datetime="[content:update_time]">[content:update_time]</div>
                        </div>
                    </li>
                    {/content:loop}
                </ul>
                {/content}
            </div>
        </div>
    </div>
    <div class="clear"></div>
    
    <!--友情链接-->
    <div class="ow-flinks" id="ow-flinks-section">
        <div class="wrapper">
            <div class="flinks">
            <span class="heading">友情链接：</span>
            {link table="db_links"}
                {link:loop}<a href="[link:url]" i="[link:i]" name="link" onclick="OW.link.count([link:link_id])" target="_blank">[link:name]</a>{/link:loop}
            {/link}
            </div>
        </div>
    </div>

</div>


<!--底部-->
<!--#include file="include.footer.html"-->
<script type="text/javascript">
$(document).ready(function(){
	var $owNotice = $("#ow_notice");
	if(OW.trim($owNotice.html())!=""){
		var notShow = OW.int(OW.cookie.getCookie("ownoticenotshow"));
		if(notShow==0){
			var $dialog = new OWDialog({
				id:'d_ow_notice',
				title:"【网站公告】",
				content:'<div class="ow-notice-dialog">'+$owNotice.html()+'<div>',
				padding:"0px",
				ok:false,
				cancel:function(){OW.cookie.setCookie("ownoticenotshow","1",1000*60*60*24*10);},
				cancelValue:"关闭，不再提示！",
				close:false
			});
		};
	}else{
		$owNotice.remove();
	};
	var $idxHeroSub = $(".idx-hero-sub"),
	$idxHeroPromo   = $(".idx-hero-promo");
	if($idxHeroPromo.find("img").length==0){
		$idxHeroSub.hide();
	};
	//推荐商品
	var $starGoods = $("#ow_star_goods"),
	starGoodsNum   = $starGoods.find("li[name='goods']").length;
	if(starGoodsNum==0){
		$starGoods.hide();
	}else{
		$(function(){
			var $grid = $starGoods,
			$gridul = $grid.find('ul'),
			$gridli = $gridul.find('li'),
			liLen   = $gridul.find('li').length,
			liWidth = $gridul.find('li:eq(0)').outerWidth(true),
			$prev   = $grid.find('.prev'),
			$next   = $grid.find('.next'),
			viewNum    = 4,
			mendianNow = 0;
			$gridul.width(liLen*liWidth-15);
			if(starGoodsNum>4){
				$next.click(function(){if(mendianNow<liLen-viewNum){mendianNow++; $gridul.animate({left:-liWidth*mendianNow},500);}else{mendianNow = 0; $gridul.animate({left:0},500);}});
				$prev.click(function(){if(mendianNow>0){mendianNow--; $gridul.animate({left:-liWidth*mendianNow},500);}else{mendianNow = liLen-viewNum; $gridul.animate({left:-liWidth*(liLen-viewNum)},500);}});
				var slideTimer = setInterval(function(){
					if(mendianNow<liLen-viewNum){mendianNow++; $gridul.animate({left:-liWidth*mendianNow},500);}else{mendianNow = 0; $gridul.animate({left:0},500);}
				},5000);
				$grid.hover(function(){clearInterval(slideTimer);},function(){
					slideTimer = setInterval(function(){
						if(mendianNow<liLen-viewNum){mendianNow++; $gridul.animate({left:-liWidth*mendianNow},500);}else{mendianNow = 0; $gridul.animate({left:0},500);}
					},5000);
				});
			}else{
				$prev.remove();
				$next.remove();
			};
		});
	};
	//推荐商品
	var $recomdGoods = $("#ow_recomd_goods"),
	recomdGoodsNum   = $recomdGoods.find("li[name='goods']").length;
	if(recomdGoodsNum==0){
		$recomdGoods.hide();
	}else{
		$(function(){
			var $grid = $recomdGoods,
			$gridul = $grid.find('ul'),
			$gridli = $gridul.find('li'),
			liLen   = $gridul.find('li').length,
			liWidth = $gridul.find('li:eq(0)').outerWidth(true),
			$prev   = $grid.find('.prev'),
			$next   = $grid.find('.next'),
			viewNum    = 4,
			mendianNow = 0;
			$gridul.width(liLen*liWidth-15);
			if(recomdGoodsNum>4){
				$next.click(function(){if(mendianNow<liLen-viewNum){mendianNow++; $gridul.animate({left:-liWidth*mendianNow},500);}else{mendianNow = 0; $gridul.animate({left:0},500);}});
				$prev.click(function(){if(mendianNow>0){mendianNow--; $gridul.animate({left:-liWidth*mendianNow},500);}else{mendianNow = liLen-viewNum; $gridul.animate({left:-liWidth*(liLen-viewNum)},500);}});
				var slideTimer = setInterval(function(){
					if(mendianNow<liLen-viewNum){mendianNow++; $gridul.animate({left:-liWidth*mendianNow},500);}else{mendianNow = 0; $gridul.animate({left:0},500);}
				},5000);
				$grid.hover(function(){clearInterval(slideTimer);},function(){
					slideTimer = setInterval(function(){
						if(mendianNow<liLen-viewNum){mendianNow++; $gridul.animate({left:-liWidth*mendianNow},500);}else{mendianNow = 0; $gridul.animate({left:0},500);}
					},5000);
				});
			}else{
				$prev.remove();
				$next.remove();
			};
		});
	};
	//楼层
	var $owFloor = $("#ow_floor");
	$owFloor.find("li.hero").each(function(){
		if($(this).find("img").length==0){
			$(this).remove();
		};
	});
	$("ul[name='floor_goods']").each(function(){
		var goodsNum = $(this).find("li[name='goods']").length;
		if(goodsNum==0){
			$(this).parent().parent().parent().remove();
		};
		if(goodsNum==1){
			if($(this).find("li.hero").length==1){
				$(this).parent().parent().parent().remove();
			};
		};
		if(goodsNum>5){
			$(this).find("li[name='goods']:eq(5),li[name='goods']:eq(10),li[name='goods']:eq(15),li[name='goods']:eq(20),li[name='goods']:eq(25),li[name='goods']:eq(30)").css("margin-left","0px");
		};
		if($(this).find("li[name='goods']").length>30){
			$(this).find("li:last").remove();
		};
	});
	//积分价格
	$(".price").each(function(){
		var price = OW.parseMoney($(this).find(".money > b").html());
		if(!price>0){
			$(this).find(".money").hide();
			$(this).find(".point > i").hide();
		};
	});
	//新闻
	if($("#ow_news").find("li[name='item']").length==0){$("#ow_news").hide();};
	var opt = {y:"年前",m:"个月前",w:"周前",d:"天前",h:"小时前",n:"分钟前",s:"秒前"}
	$("div[name='datetime']").each(function(){
		var timeText = OW.timeAgoTip(opt,$(this).attr("datetime"),"<%=SYS_TIME%>");
		$(this).html(timeText);
	});
	//友情链接
	var $flinks = $("#ow-flinks-section");
	if($flinks.find("a[name='link']").length==0){
		$flinks.hide();
	};
});
</script>
</body>
</html>
