<!DOCTYPE HTML>
<html>
<head>
    <meta charset="UTF-8">
    <title>{$title}</title>
    <meta name="keywords" content="{$keywords}" />
    <meta name="description" content="{$description}" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="format-detection" content="telephone=no, email=no">
    <meta name="apple-mobile-web-app-title" content="{$site_name}" />
    <meta name="generator" content="openwbs {$version}" />
    <meta name="author" content="openwbs team" />
    <meta name="copyright" content="2019-2039 OpenWBS Inc." />
    <!--#include file="include.css.html"-->
    <link rel="stylesheet" href="../css/om.store.css?v={$version_sn}" />
</head>
<body>
<!--头部-->
<header class="om-store-header">
    <div class="om-store-seller">
        <div class="om-store-logo"><img src="{$store:store_logo}" /></div>
        <div class="om-store-name">
            <h1 class="name">{$store:store_name}</h1>
            <h3 class="subname">{$store:store_desc}</h3>
        </div>
    </div>
    <div class="om-store-menu">
        <ul><li class="current"><a href="{$store:store_url}">首页</a></li><li><a href="{$site_hurl}category/">全部商品</a></li></ul>
    </div>
</header>

<section class="mbody">
    <div class="om-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 class="om-idx-star-goods">
        <div class="header">
            <h2 class="title">{%=OW.DB.getFieldValueBySQL("SELECT [name] FROM "& DB_PRE &"position WHERE pos_id=4")%}</h2>
        </div>
        <div class="section">
            {goods top="30" position_id="4"}
            <ul class="om-goods-vertilist">
                {goods:loop}
                <li class="li[goods:i]">
                    <a href="[goods:link]">
                    <div class="thumb"><img src="[goods:thumbnail]" alt="[goods:title]" title="[goods:title]" /></div>
                    <div class="info">
                        <h3 class="title">[goods:title]</h3>
                        <div class="subtitle">[goods:subtitle]</div>
                        <div 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></div>
                    </div>
                    </a>
                </li>
                {/goods:loop}
            </ul>
            {/goods}
        </div>
    </div>
    
    <div id="ow_floor">
        {cate is_shop="1" parent_id="0"}
        {cate:loop}
        <div class="om-idx-floor-goods" name="floor_goods">
            <h2 class="floor-hd"><span class="floor-num">[cate:i]F</span><a class="floor-name" href="[cate:link]" target="_blank">[cate:name]</a></h2>
            <div class="floor-bd">
                <ul class="om-goods-vertilist">
                    {goods top="30" recommend_cate_id="[cate:cate_id]"}
                    {goods:loop}
                    <li class="li[goods:i]">
                        <a href="[goods:link]">
                        <div class="thumb"><img src="[goods:thumbnail]" alt="[goods:title]" title="[goods:title]" /></div>
                        <div class="info">
                            <h3 class="title">[goods:title]</h3>
                            <div class="subtitle">[goods:subtitle]</div>
                            <div 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></div>
                        </div>
                        </a>
                    </li>
                    {/goods:loop}
                    {/goods}
                </ul>
            </div>
        </div>
        {/cate:loop}
        {/cate}
    </div>
    
    <div class="om-idx-new-goods" id="ow_new_goods">
        <div class="header">
            <h2 class="title">{%=OW.DB.getFieldValueBySQL("SELECT [name] FROM "& DB_PRE &"position WHERE pos_id=5")%}</h2>
        </div>
        <div class="section" id="newgoods">
            <div class="case-wrapper">
                {goods top="30" position_id="5"}
                <ul class="om-new-goods" name="slither">
                    {goods:loop}
                    <li class="li[goods:i]">
                        <a href="[goods:link]">
                        <div class="thumb"><img src="[goods:thumbnail]" alt="[goods:title]" title="[goods:title]" /></div>
                        <div class="info">
                            <h3 class="title">[goods:title]</h3>
                            <div class="subtitle">[goods:subtitle]</div>
                            <div 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></div>
                        </div>
                        </a>
                    </li>
                    {/goods:loop}
                </ul>
                {/goods}
            </div>
        </div>
    </div>
    
    <div class="om-idx-news">
        <h2 class="header"><span class="om-more"><a href="{$site_hurl}news/">查看更多</a></span>新闻资讯</h2>
        {content top="10" model="news" position_id="1"}
        <div class="section">
            <ul class="om-news-list">
            {content:loop}
                {if:OW.int("[content:i]")=1}
                <li class="li[content:i] first"><a href="[content:link]"><div class="thumb"><img src="[content:thumbnail]" alt="[content:title]" title="[content:title]"></div><h3 class="title"><span>[content:title]</span></h3></a></li>
                {else}
                <li class="li[content:i]"><a href="[content:link]"><div class="thumb"><img src="[content:thumbnail]" alt="[content:title]" title="[content:title]"></div><h3 class="title">[content:title]</h3></a></li>
                {/if}
            {/content:loop}
            </ul>
        </div>
        {/content}
    </div>
    
</section>
<!--底部-->
<% if OS.isWeixinShare then %>
<%=OS.getWXShareTicket%>
<script type="text/javascript">
OW.uid = OW.int(OW.cookie.getCookie("uid"));
wx.config({
   debug:false,appId:'<%=OS.wxShareAppid%>',timestamp:'<%=OS.wxShareTimestamp%>',nonceStr:'<%=OS.wxShareNonceStr%>',signature:'<%=OS.wxShareSignature%>',jsApiList:['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareQZone']
});
wx.ready(function(){
	var wxTitle = '{$title}',
	wxDesc      = '{$description}'
	wxLink      = '{$store:store_url}' + OW.iif(OW.uid>0,"?rid="+ OW.uid +"",""),
	wxImgUrl    = '<%=OW.validImageUrl("{$config(share_default_img)}")%>',
	errmsg      = "<%=OS.weixinAccessTokenErrmsg%>";
	wx.onMenuShareTimeline({title:wxTitle,link:wxLink,imgUrl:wxImgUrl});
	wx.onMenuShareAppMessage({title:wxTitle,desc:wxDesc,link:wxLink,imgUrl:wxImgUrl});
	wx.onMenuShareQQ({title:wxTitle,desc:wxDesc,link:wxLink,imgUrl:wxImgUrl});
	wx.onMenuShareQZone({title:wxTitle,desc:wxDesc,link:wxLink,imgUrl:wxImgUrl});
});
</script>
<% end if %>
<!--#include file="store.footer.html"-->
<script type="text/javascript">
$(document).ready(function(){
	$("div[name='floor_goods']").each(function(){
		var goodsNum = $(this).find("li").length;
		if(goodsNum==0){
			$(this).remove();
		};
	});
	$("ul[name='slither']").each(function(){
		var ulWidth = 0,parDivWidth = OW.int($(this).parent().css("width"));
		$(this).find("li").each(function(){
			ulWidth = ulWidth + OW.int($(this).width()) + OW.int($(this).css("padding-left")) + OW.int($(this).css("padding-right"));
		});
		if(ulWidth==0){
			$(this).hide();
		}else{
			ulWidth = ulWidth + 10;
		};
		if(ulWidth<=parDivWidth){ulWidth=parDivWidth+10;};
		$(this).width(ulWidth);
	});
	//新品
	var $newgoods = $("#newgoods");
	if($newgoods.find("li").length==0){
		$("#ow_new_goods").hide();
	}
	//积分价格
	$(".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($(".om-idx-news").find("li").length==0){$(".om-idx-news").hide();}
});
</script>
</body>
</html>
