<!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"-->
</head>
<body>
<!--#include file="include.header.html"-->
<div class="om-header" id="header">
    <div class="om-header-container-subpage">
        <a class="goback" href="{$site_url}"><i></i></a>
        <div class="search">
            <i class="icon-search"></i>
            <div class="search-input"><input type="text" name="search" maxlength="20" cleardefault="no" autocomplete="off" placeholder="搜索商品名称"  value="" /></div>
        </div>
        <div class="user"><a class="unlogin" href="{$login_url}"><i></i></a></div>
    </div>
    {if:OW.int("{$cate:children}")>0}
    <div class="om-top-nav om-top-nav-cate">
        {cate is_shop="1" parent_id="{$cate:cate_id}"}
        <ul name="slither">
            <li class="li0">{$cate:name}</li>{cate:loop}<li class="li[cate:i]"><a href="[cate:link]">[cate:name]</a></li>{/cate:loop}
        </ul>
        {/cate}
    </div>
    {/if}
</div>

<section class="mbody">
    <div class="om-filter-line">
        <span class="type-filter" id="btn_type_filter"><em>商品筛选<i>+</i></em></span>
        <span class="order"><a href="javascript:;" class="order-by-all" name="orderby" orderby="0-0"><i>默认排序</i></a><a href="javascript:;" class="order-by-sales" name="orderby" orderby="2-0"><i>销量</i></a><a href="javascript:;" class="order-by-price" name="orderby" orderby="1-0"><i>价格</i></a><a href="javascript:;" class="order-by-views" name="orderby" orderby="3-0"><i>人气</i></a><a href="javascript:;" class="order-by-views" name="orderby" orderby="4-1"><i>时间</i></a></span>
    </div>
    <div class="om-content-type" id="om_content_type_section" style="display:none;">
        <div class="section">
            {typeattr type_cate_id="{$cate:type_cate_id}"}
            {typeattr:loop}
            <div class="type-line" i="[typeattr:i]">
                <div class="type-attr">[typeattr:type_attr_name]</div>
                <div class="type-value">
                    <ul class="type-value-list">
                        <li><a class="all" href="[typeattr:link]" name="typeattr" type_attr_id="[typeattr:type_attr_id]" target="_self">全部</a></li>
                        {ctype type_attr_id="[typeattr:type_attr_id]"}
                        {ctype:loop}
                        <li><a href="[ctype:link]" name="ctype" type_id="[ctype:type_id]" target="_self">[ctype:type_name]</a></li>
                        {/ctype:loop}
                        {/ctype}
                    </ul>
                </div>
            </div>
            {/typeattr:loop}
            {/typeattr}
        </div>
    </div>
    
    <div class="om-shop-cate-goods" id="list">
        <% V("orderby")=OW.iif(OW.trim("{$cate:orderby}")="sequence ASC","a.sequence ASC",OW.trim("{$cate:orderby}")) %>
        {goods top="20000" cate_id="{$cate:cate_id}" list_by_type="{$cate:list_by_type}" orderby="{$cate:orderby}"}
        <div class="section">
            <ul class="om-goods-horizlist">
                {goods:loop}
                <li>
                    <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>
                        {if:OW.isNotNul("[goods:subtitle]")}<div class="subtitle">[goods:subtitle]</div>{/if}
                        <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>
        </div>
        <div class="footer">
            <div class="pager">[goods:pages pagesize="40" pagetpl="{prev}{current}{next}"]</div>
        </div>
        {/goods}
    </div>
    
</section>
<!--底部-->
<!--#include file="include.footer.html"-->
<style type="text/css">
.om-footer{ display:none!important;}
</style>
<script type="text/javascript">
$(document).ready(function(){
	//栏目菜单
	$("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);
	});
	//商品筛选
	$("#btn_type_filter").toggle(
		function(){
			$(this).find("em").html("商品筛选<i>-</i>");
			$("#om_content_type_section").slideDown(100);
		},function(){
			$(this).find("em").html("商品筛选<i>+</i>");
			$("#om_content_type_section").slideUp(100);
		}
	);
	if($("#om_content_type_section").find(".type-line").length==0){
		$("#om_content_type_section").hide();
		$("#btn_type_filter").hide();
	};
	OW.client.typeInit({section:$("#om_content_type_section")});
	//商品排序
	OW.listOrderBy({obj:$("a[name='orderby']")});
	//无商品
	if($("#list").find("li").length==0){
		$("#list").html('<div class="om-none-goods-tip">暂无商品</div>');
	};
	//积分价格
	$(".price").each(function(){
		var price = OW.parseMoney($(this).find(".money > b").html());
		if(!price>0){
			$(this).find(".money").hide();
			$(this).find(".point > i").hide();
		};
	});
});
</script>
<% 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      = OW.currentURL() + OW.iif(OW.uid>0,"?rid="+ OW.uid +"",""),
	wxImgUrl    = '<%=OW.validImageUrl("{$config(share_default_img)}")%>';
	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 %>
</body>
</html>
