<!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"-->
</head>
<body>
<!--头部-->
<!--#include file="include.header.html"-->
<div id="shopbody">
    <div class="ow-breadcrumb">
        <div class="wrapper">
            {if:OW.int("{$cate:root_id}")>0}
                <h1>{%=OW.DB.getFieldValueBySQL("SELECT [name] FROM ow_category WHERE cate_id={$cate:parent_id}")%}</h1>
            {else}
                <h1>{$cate:name}</h1>
            {/if}
            {$breadcrumb}
        </div>
    </div>
    {if:OW.int("{$cate:children}")>0}
        <div class="ow-shop-subcate">
            <ul>
            {cate is_shop="1" parent_id="{$cate:cate_id}"}
                {cate:loop}
                <li {if:OW.trim("{$cate:cate_id}")=OW.trim("[cate:cate_id]")}class="current"{/if}><a href="[cate:link]">[cate:name]</a></li>
                {/cate:loop}
            {/cate}
            </ul>
        </div>
    {else}
        <div class="ow-shop-subcate">
            <ul>
            {cate is_shop="1" parent_id="{$cate:parent_id}"}
                {cate:loop}
                <li {if:OW.trim("{$cate:cate_id}")=OW.trim("[cate:cate_id]")}class="current"{/if}><a href="[cate:link]">[cate:name]</a></li>
                {/cate:loop}
            {/cate}
            </ul>
        </div>
    {/if}
    <div class="ow-goods-type-section">
        <div class="wrapper">
        <div class="type-header">商品筛选</div>
        <div class="type-section" id="type_section">
            {typeattr type_cate_id="{$cate:type_cate_id}"}
            {typeattr:loop}
            <div class="type-line type-line[typeattr:i]" i="[typeattr:i]">
                <div class="type-attr">[typeattr:type_attr_name]：</div>
                <div class="type-value">
                    <ul class="type-value-list">
                    <li><a 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>
    <div class="ow-shop-categoods-section">
        <div class="ow-goods-orderby">
            <span class="order"><a href="javascript:;" class="order-by-all" name="orderby" orderby="0-0">默认排序</a><a href="javascript:;" class="order-by-sales" name="orderby" orderby="2-0">销量</a><a href="javascript:;" class="order-by-price" name="orderby" orderby="1-0">价格低到高</a><a href="javascript:;" class="order-by-price" name="orderby" orderby="1-1">价格高到底</a><a href="javascript:;" class="order-by-views" name="orderby" orderby="3-0">人气</a><a href="javascript:;" class="order-by-views" name="orderby" orderby="4-0">时间升</a><a href="javascript:;" class="order-by-views" name="orderby" orderby="4-1">时间降</a></span>
        </div>
        <div class="categoods-section">
            <% 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}"}
            <ul class="ow-goods-list clearfix" name="goods">
                {goods:loop}
                <li class="li[goods:i]" gid="[goods:gid]" is_book="[goods:is_book]">
                    <div class="thumb" name="thumbnail"><a href="[goods:link]" target="_blank"><img name="thumbnail" src="[goods:thumbnail]" alt="[goods:title]" title="[goods:title]"></a></div>
                    <div class="info">
                        <h3 class="title"><a href="[goods:link]" 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>
            <div class="clear"></div>
            <div class="pager">[goods:pages pagesize="40"]</div>
            {/goods}
        </div>
    </div>
</div>

<!--底部-->
<!--#include file="include.footer.html"-->
<script type="text/javascript">
$(document).ready(function(){
	//商品筛选
	OW.client.typeInit({section:$("#type_section")});
	//商品排序
	OW.listOrderBy({obj:$("a[name='orderby']")});
	//如果没有筛选则隐藏筛选框
	var $goodsTypeSection = $(".ow-goods-type-section");if(!$goodsTypeSection.find("li").length>0){$goodsTypeSection.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();
		};
	});
	//分页
	$(".pager").find("a").each(function(){
		var url = $(this).attr("href") +"#list";
		$(this).attr("href",url);
	});
});
</script>
</body>
</html>
