<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{{kg['category']['title']}} - KGCMS</title>
<meta name="keywords" content="{{kg['category']['seokey']}}" />
<meta name="description" content="{{kg['category']['seodescr']}}" />
<meta name="copyright" content="KGCMS {{kg['server']['KGCMS_VERSION']}}" />
<!-- 自适应移动端 -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 禁止缩放 -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="{{kg['tpl_url']}}style/cart.css">
<script src="{{kg['tpl_url']}}script/jquery-3.0.0.min.js"></script>
<script src="{{kg['tpl_url']}}script/bootstrap.min.js"></script>
<script src="{{kg['tpl_url']}}script/common.js"></script>
<script src="{{kg['tpl_url']}}script/cart.js"></script>
<script src="{{kg['tpl_url']}}user/layer/layer.js"></script>
</head>
<body>
	<div class="container-fluid ngcon-style">
	{% include 'component_header.tpl' %}
		<div class="row">
			<div class="col-md-3">
				<div class="bs-docs-sidebar hidden-print hidden-xs hidden-sm">
					<ul class="nav bs-docs-sidenav" id="left-nav">
                        {%- for row in  kg['category']['id']|category() %}
                        <li {% if row['id'] == kg['category']['id'] %}class="active"{% endif %}>
                            <a href="{{row['url']}}">
                                <span class="iconfont icon-dian"></span>
                                {{ row['title']}}
                            </a>
                        </li>
                        {%- endfor %}
					</ul>
				</div>
			</div>
			<div class="col-md-9 ngNo-padding">
				<div class="panel panel-default ngNo-margin No-shadow">
					<div class="panel-body ngsty-pan">
                        <h1 class="page-title sty-title">购物车</h1>
                        <hr class="hr-Rsty" style="padding-bottom: 32px;">
                        <form action="/user/checkout" method="post" style="margin-bottom: 0;" id="carts">
                            <input type="hidden" name="action" value="order">
                            <table class="table table-bordered table-hover table_my_cart">
                                <thead>
                                    <tr>
                                        <th class="cart-all_sel" ><input type="checkbox" class="select-checkbox" id="all" name="all" onclick="kg.select_all(this.form)"></th>
                                        <th style="width: 80px;"></th>
                                        <th>商品名称</th>
                                        <th>商品属性选择</th>
                                        <th>库存数</th>
                                        <th>数量</th>
                                        <th>单价</th>
                                        <th>小计</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {% for cart in kg['carts'] %}
                                    <tr>
                                        <td ><input type="checkbox" name="cartid[]" class="select-checkbox select-product" value="{{cart['id']}}"></td>
                                        <td class="cart-user_img" style="width: 80px;">
                                            <a href="#" style="border: 1px solid #ddd;padding: 2px;width: 70px;display: block;">
                                                <div class="commodity_img">
                                                    <img src="{{cart['specipic']}}" onload="kg.img_auto_size(this)" alt="" width="64" height="64"  >
                                                </div>
                                            </a>
                                        </td>
                                        <td class="cart-title"><a class="commodity_name" href="#">{{cart['title']}}</a></td>
                                        <td class="cart-speci">
                                            {% for var in cart['speci_param'] %}
                                            <div><label style="margin-bottom: 0;">{{var[0]}}：</label><span>{{var[1]}}</span></div>
                                            {% endfor %}
                                        </td>
                                        <td class="inventory">{{cart['inventory']}}</td>                                     
                                        <td class="cart-num">
                                            <div class="tb-stock">
                                                <a href="javascript:void(0);" title="减1" class="tb-reduce J_Reduce tb-iconfont am-icon-minus minus" ></a>
                                                <input value="{{cart['quantity']}}" cart-id="{{cart['id']}}" class="quantity" type="text" class="tb-text" maxlength="8" title="请输入购买量" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onafterpaste="this.value=this.value.replace(/[^\d]/g,'')">
                                                <a href="javascript:void(0);" hidefocus="" class="tb-increase J_Increase tb-iconfont am-icon-plus add" title="加1" ></a>
                                            </div>
                                        </td>
                                        <td class="cart-price">{{cart['price']}}</td>
                                        <td class="subtotal">{{cart['subtotal']}}</td>
                                        <td class="cart-remove">
                                            <a type="button" cart-id="{{cart['id']}}" class="btn btn-xs btn-danger btn-delete"><i class="am-icon-trash-o">&nbsp;</i>删除</a>
                                        </td>
                                    </tr>
                                    {% endfor %}
                                    {% if kg['carts'] %}<tr><td class="text-right" colspan="9" style="background-color: #fff;"><label style="margin-bottom: 0;">金额(不含运费)：</label><span style="color: #ff2832;" id="count">0.0</span></td></tr>{% endif %}
                                </tbody>
                            </table>
                        </form>
					</div>
                </div>
                {% if not kg['carts'] %}<div class="no_data">没有相关数据</div>{% endif %}
                <div class="am-cf cart_bf {% if not kg['carts'] %}hide{% endif %}">
                    <div style="text-align: center;">
                        <button type="button" onclick="window.location.href = '/product'" class="btn btn-primary">继续购物</button>
                        <button class="btn btn-danger" id="submit" disabled="" style="margin-left: 50px;">提交订单</button>
                    </div>
                    {{kg['page_html']}}
                </div>
			</div>
		</div>
		{% include 'component_footer.tpl' %}
	</div>
</body>
</html>