<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<base href="{{kg['server']['WEB_URL']}}">
	<meta name="keywords" content="{{kg['web']['keyword']}}" />
	<meta name="description" content="{{kg['web']['description']}}" />
	<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">
	<title>{{kg['web']['title']}}</title>
	<link rel="stylesheet" href="{{kg['tpl_url']}}css/uniform/css/uniform.default.min.css" type="text/css" media="print, screen">
	<link rel="stylesheet" href="/tools/amazeui/css/amazeui.css" type="text/css" media="print, screen">
	<link rel="stylesheet" href="{{kg['tpl_url']}}css/cloud-admin.css" type="text/css" media="print, screen">
	<link rel="stylesheet" href="{{kg['tpl_url']}}css/default.css" type="text/css" media="print, screen">
	<link rel="stylesheet" href="{{kg['tpl_url']}}font-awesome/css/font-awesome.min.css" type="text/css" media="print, screen">
	<link rel="stylesheet" href="{{kg['tpl_url']}}css/checkout.css" type="text/css" media="print, screen">
	<script src="{{kg['server']['HTTP_HOST']}}/tools/ueditor/ueditor.parse.js"></script>
	<script src="{{kg['tpl_url']}}js/jquery-3.0.0.min.js"></script>
	<script src="{{kg['tpl_url']}}js/jquery.cookie.min.js"></script>
	<script src="{{kg['tpl_url']}}js/bootstrap.min.js"></script>
	<script src="{{kg['tpl_url']}}js/js.js"></script>
	<script src="{{kg['tpl_url']}}js/common.js"></script>
	<script src="{{kg['tpl_url']}}js/checkout.js"></script>
</head>

<body>
	<!-- 头部 -->
	{% include 'component_header.tpl' %}
	<!-- 头部end -->
	<div>
		<div class="container" style="padding: 0;">
			<section id="page">
				<!-- 左侧导航栏 -->
				{% include 'component_left.tpl' %}
				<!-- 左侧导航栏end -->
				<!-- 右侧内容 -->
				<div id="main-content">
					<div class="container" style="width: 100%;">
						<div class="row">
							<div id="content" class="col-lg-12">
								<!-- 内容头部位置 -->
								<div class="row">
									<div class="col-sm-12">
										<div class="page-header">
											<ul class="breadcrumb">
												<li><i class="fa fa-home"></i><a href="./">首页</a></li>
												<li><a href="center">会员中心</a></li>
												<li><a href="order">订单管理</a></li>
												<li>我的订单</li>
											</ul>
										</div>
									</div>
								</div>
								<!-- 内容头部位置end -->
								<form action="" method="post">
									<div class="row">
										<div class="col-md-12">
											<div class="box border primary">
												<div class="box-title">
													<h4>收货人信息</h4>
													<div class="tools" style="margin-top: -5px;">
														<a class="btn btn-xs btn-info" href="my_address"><i class="fa fa-plus">&nbsp;</i>添加收货地址</a>
													</div>
												</div>
												<div class="box-body">
													<table class="table table-bordered table-hover table_border_none" id="consignee">
														<thead>
															<tr>
																<th class="center">选择</th>
																<th>收件人名称</th>
																<th>收货地址</th>
																<th>联系电话</th>
																<th>默认地址</th>
																<th>操作</th>
															</tr>
														</thead>
														<tbody>
															<!-- 以下三种情况:一种选中设置默认地址,二种选中没有设置默认地址,三种即没选中也没设置默认地址 -->
															{% for address in kg['address'] %}
															<tr>
																<td class="center">
																	<input type="radio" name="address" value="{{address['id']}}" {% if address['select'] %}checked="checked"{% endif %}style="display: none">
																	<div mode="{{kg['action']}}" class="click_name {% if address['select'] %}click_name_active{% endif %}">{{address['consignee']}}<span class="dg"></span></div>
																</td>
																<td>{{address['consignee']}}</td>
																<td>{{address['areap']}} {{address['areac']}} {{address['aread']}}</td>
																<td>{{address['mobile']}}</td>
																{% if address['default'] %}<td class="default_address"><span class="label label-default">默认地址</span></td>{% else %}<td></td>{% endif %}
																<td>
																	{% if not address['default'] %}<a class="btn btn-xs btn-primary" href="/user/my_address?action=default&id={{address['id']}}"><i class="fa fa-eye">&nbsp;</i>设置默认地址</a>{% endif %}
																	<a class="btn btn-xs btn-info" href="/user/address_update?id={{address['id']}}"><i class="fa fa-pencil-square-o">&nbsp;</i>修改</a>
																	<a class="btn btn-xs btn-danger" href="/user/my_address?action=del&id={{address['id']}}"><i class="fa fa-trash-o">&nbsp;</i>删除</a>
																</td>
															</tr>
															{% endfor %}
														</tbody>
													</table>
												</div>
											</div>
											<div class="box border primary">
												<div class="box-title">
													<h4>商品列表</h4>
													<div class="tools" style="margin-top: -5px;">
														{% if kg['order_id'] and kg['order']['status'] == 0 %}<a class="btn btn-xs btn-info" href="/user/checkout?action=return&id={{kg['order_id']}}" onclick="return confirm('确定要取消该订单并将所有商品放入购物车吗？');">放回购物车</a>{% endif %}
														<a class="btn btn-xs btn-info" href="order">订单管理</a>
													</div>
												</div>
												<div class="box-body clearfix">
													<div class="box_body_bd clearfix">
														<div class="pull-left" style="width: 30%;padding-right: 10px;">
															<div style="padding: 10px;border-top: 1px solid #ddd;border-right: 1px solid #ddd;">
																<div>
																	{% for shipping in kg['shipping'] %}
																	<div mode="{{kg['action']}}" class="current {% if shipping['select'] == 1 %}current_active{% endif %} shipping" shippingid="{{shipping['id']}}" topay="{{shipping['topay']}}" insure="{{shipping['insure_price']}}" freight="{{shipping['freight']}}" description="{{shipping['description']}}">{{shipping['title']}}<span class="dg"></span></div>
																	{% if shipping['select'] == 1 %}
																	<input type="hidden" name="shippingid" value="{{shipping['id']}}" id="shipping-id">
																	{% endif %}
																	{% endfor %}
																</div>
																{% for shipping in kg['shipping'] %}
																{% if shipping['select'] == 1 %}
																<div>
																	<ul style="padding-left: 0;">
																		<li><label id="shipping-description" style="margin: 0;">{{shipping['description']}}</label></li>
																		<li><label style="margin: 0;">保价费用：</label><span id="shipping-insure" style="color: #ff2832;">{{shipping['insure_price']}}</span></li>
																		<li><label style="margin: 0;">手续费：</label><span id="shipping-freight" style="color: #ff2832;">{{shipping['freight']}}</span></li>
																	</ul>
																</div>
																<div class="form-group">
																	<label class="checkbox"><input id="topay" name="topay" value="1" {% if kg['order']['customer'] and shipping['topay'] %}checked="checked"{% endif %} type="checkbox" {% if not shipping['topay'] or kg['action'] %}disabled="disabled"{% endif %} class="" value="">手续费到付</label>
																	<label class="checkbox"><input {% if kg['action'] %}disabled="disabled"{% endif %} id="insure" name="insure" value="1" type="checkbox" {% if kg['order']['vouch'] %}checked="checked"{% endif %} class="" value="">否需要保价</label>
																</div>
																{% endif %}
																{% endfor %}
																<div>
																	<textarea rows="3" cols="5" initattrh="0" name="message" class="autosize form-control textarea-transition" placeholder="请输入订单留言信息" onkeyup="if(value.length&gt;255){value=value.substr(0,255);}"></textarea>
																</div>
																<div>
																	<label  style="margin: 10px 0;">商家回复：</label>
																	<span>暂无回复</span>
																</div>
															</div>
														</div>
														<table class="table table-bordered table-hover table_border_none pull-left" style="width: 70%;margin-bottom: 0;border-bottom: 0;">
															<thead>
																<tr>
																	<th colspan="5" style="border-bottom-width: 0;">
																		<div class="pull-left">
																			<label  style="margin: 0;">订单号：</label>
																			<span style="color: #ff2832;">{{kg['order']['oid']}}</span>
																		</div>
																		<div class="pull-right">
																			<label  style="margin: 0;">{{kg['order']['status_msg']}}</label>
																		</div>
																	</th>
																</tr>
																<tr>
																	<th></th>
																	<th>商品名称 / 选择属性</th>
																	<th>购买单价</th>
																	<th>购买数量</th>
																	<th>金额</th>
																</tr>
															</thead>
															<tbody>
																{% for pid in kg['order']['pid'] %}
																<tr>
																	<td style="width: 80px;">
																		<a href="#" style="border: 1px solid #ddd;padding: 2px;width: 70px;display: block;">
																			<div class="commodity_img">
																				<img src="{{kg['order']['specipic'][loop.index0]}}" onload="kg.img_auto_size(this)" alt="" width="64" height="64">
																			</div>
																		</a>
																	</td>
																	<td>
																		<a class="commodity_name" href="#">{{kg['order']['title'][loop.index0]}}</a>
																		{% for var in kg['order']['speci_param'][loop.index0] %}
																		<div><label style="margin-bottom: 0;">{{var[0]}}：</label><span>{{var[1]}}</span></div>
																		{% endfor %}
																	</td>
																	<td>{{kg['order']['price'][loop.index0]}}</td>
																	<td>{{kg['order']['number'][loop.index0]}}</td>
																	<td>{{kg['order']['subtotal'][loop.index0]}}</td>
																	<div style="display: none">
																		<input type="hidden" name="productid[]" value="{{pid}}">
																		<input type="hidden" name="speci[]" value="{{kg['order']['attribute'][loop.index0]}}">
																		<input type="hidden" name="quantity[]" value="{{kg['order']['number'][loop.index0]}}">
																	</div>
																</tr>
																{% endfor %}
															</tbody>
														</table>
													</div>
													<div class="box_body_bf text-right clearfix">
														<div><label  style="margin: 5px 0;">下单时间：</label><span>{{kg['order']['addtime']}}</span></div>
														<div><label  style="margin:5px 0;">您的帐号可用资金：</label><span>{{kg['user']['money']}} <a href="/user/recharge">(立即充值)</a></span></div>
														<div>
															<span><label  style="margin:5px 0;">商品总金额：</label><span style="color: #ff2832;" id="product-price">{{kg['order']['product_total']}}</span></span>
															<span style="margin-left: 25px;"><label  style="margin:5px 0;">配送手续费：</label><span id="shipping-price" style="color: #ff2832;">{{kg['order']['freight']}}</span></span>
															<span style="margin-left: 25px;"><label  style="margin:5px 0;">促销优惠：</label><span style="color: #ff2832;">0.00</span></span>
														</div>
														<div><label  style="margin:5px 0;">应付总金额：</label><span style="color: #ff2832;" id="count-price">{{kg['order']['amount']}}</span></div>
														<div>
															<label  style="margin:5px 0;">支付方式：</label>
															<input name="payment" id="payment" type="hidden" value="{{kg['order']['payment']}}" />
															{% if not kg['order']['oid'].startswith('NR') %}<a class="pay_method {% if kg['order']['payment'] == 1 %}pay_method_active{% endif %}" href="javascript:;" {% if kg['action'] !='view' %}onclick="$('#payment').val(1);$('.pay_method.pay_method_active').removeClass('pay_method_active');$(this).addClass('pay_method_active');return false;">{% endif %}<span class="dg"></span><img src="{{kg['tpl_url']}}images/kgpay.png" alt="余额支付"></a>{% endif %}
															<a class="pay_method {% if kg['order']['payment'] == 2 %}pay_method_active{% endif %}" href="javascript:;" style="margin: 0 5px;" {% if kg['action'] !='view' %}onclick="$('#payment').val(2);$('.pay_method.pay_method_active').removeClass('pay_method_active');$(this).addClass('pay_method_active');return false;">{% endif %}<span class="dg"></span><img src="{{kg['tpl_url']}}images/wxpay.png" alt="微信支付"></a>
															<a class="pay_method {% if kg['order']['payment'] == 3 %}pay_method_active{% endif %}" href="javascript:;" {% if kg['action'] !='view' %}onclick="$('#payment').val(3);$('.pay_method.pay_method_active').removeClass('pay_method_active');$(this).addClass('pay_method_active');return false;">{% endif %}<span class="dg"></span><img src="{{kg['tpl_url']}}images/alipay.png" alt="支付宝支付"></a>
														</div>
														{% if kg['order']['status'] == 0 %}
														<div style="margin:15px 0 5px 0;">
															<!-- 未达到条件按钮 -->
															<!-- <a href="#" class="btn btn-primary" disabled>下一步</a> -->
															<button type="submit" class="btn btn-primary">下一步</button>
															<input type="hidden" name="action" value="submit">
														</div>
														{% endif %}
													</div>
												</div>
											</div>
										</div>
									</div>
								</form>
								<div class="row">
									<div class="col-sm-12">{% include 'component_footer.tpl' %}</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- 右侧内容end -->
			</section>
		</div>
	</div>
</body>

</html>