<!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}" />
<link rel="stylesheet" href="../css/ow.store.css?v={$version_sn}" />
</head>
<body>
<!--头部-->
<!--#include file="include.header.html"-->
<div class="ow-store-header">
    <div class="ow-store-seller">
        <div class="ow-store-logo"><img src="{$store:store_logo}" /></div>
        <div class="ow-store-name">
            <h1 class="name">{$store:store_name}</h1>
            <h3 class="subname">{$store:store_desc}</h3>
        </div>
    </div>
    <div class="ow-idx-cates">
        {cate is_shop="1" parent_id="0"}
        <ul name="slither">
            {cate:loop}<li class="li[cate:i]"><a href="[cate:link]">[cate:name]</a></li>{/cate:loop}
        </ul>
        {/cate}
    </div>
</div>
<div id="mbody">
    <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>


<!--底部-->
<!--#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);
	});
});
</script>
</body>
</html>
