<{import file="index/header_shop.html" title="订单列表"}> 
<link rel="stylesheet" type="text/css" href="<{$__APP__}>public/css/order.css">
<div class="tab_name"><span>订单列表</span></div>
<style type="text/css">
table thead tr th{ border-top:1px solid #efefef; border-bottom:1px solid #f2f2f2; padding:3px 0; }
.remark{ margin:12px 10px 0; float:right; }

</style>
<div class="filter">
	<a href="?m=goods_order" <{if $smarty.get.status ==''}>class="ch"<{/if}>>全部订单</a>
	<a href="?m=goods_order&status=1" <{if $smarty.get.status == '1'}>class="ch"<{/if}>>未支付订单</a>
	<a href="?m=goods_order&status=2" <{if $smarty.get.status == '2'}>class="ch"<{/if}>>等待发货</a>
	<a href="?m=goods_order&status=3" <{if $smarty.get.status == '3'}>class="ch"<{/if}>>等待收货</a>
	<a href="?m=goods_order&status=4" <{if $smarty.get.status == '4'}>class="ch"<{/if}>>交易完成</a> 
</div> 
<div class="lbox">
<table width="100%">
	<thead>
		<tr>
			<th>商品名</th>
			<th width="80">单价</th>
			<th width="80">数量</th>
			<th width="100">实付款</th>
			<th width="100">状态</th>
			<th width="100">操作</th> 
		</tr> 
	</thead>
	<tbody><tr><td colspan="6" style="height:0px; padding:5px 0;"></td></tr></tbody>
	<{uqcms m="order" v="data" c="order_list:user_type=2&order_id=smarty.get.order_id&page=smarty.get.page&page_size=20&status=smarty.get.status"}>
	<{if $data.list}> 
		<{foreach item=i from=$data.list}>
			<tbody style=" border:1px solid #efefef;">  
				<tr class="order_tr_top">
					<td colspan="6" style="background:#f8f8f8; text-align:left; padding:2px 0;"> 
						<span class="order_span" style="padding-right:20px; padding-left:20px;"> 订单号：<{$i.order_no}></span> 
						<span class="order_span" style="padding-right:0px;">下单时间：<{$i.addtime}></span>
						<{if $i.order_status == '0'|| $i.order_status == '4'||$i.order_status == '5'}> 
							<a href="?m=goods_order&a=del_order&oid=<{$i.order_no}>" class="order_del" onclick="del()">删除</a>
						<{/if}>
						<a href="javascript:;" class="remark" onclick="sp_dg('备注','?m=goods_order&a=remark&oid=<{$i.order_no}>')">备注</a>
					</td>
				</tr>
			<{foreach key=k item=g from=$i.glist}>
				<tr class="order_tr">
					<td> 
						<div class="gcon">
							<div class="img"><a href="index.php?m=goods&a=detail&id=<{$g.gid}>" class="order_img" target="_blank"><img src="<{$__IMG__}><{$g.images|img_size:80x80}>"></a></div>
							<div class="desc">
								<div class="ttl">
									<a href="index.php?m=goods&a=detail&id=<{$g.gid}>" class="order_title" target="_blank"><{$g.title}></a>
								</div>
								<div class="sku">
									<{if $g.sku}>
										<{foreach item=s from=$g.sku}>		
											<span><{$s.0}>：<{$s.1}> &nbsp;&nbsp; </span> 
										<{/foreach}>
									<{/if}>
								</div>
							</div> 
						</div>	
					</td> 
					<td><div class="buy_pr"><span><{$g.price}></span></div></td>
					<td style="border-right:1px solid #efefef;"><{$g.buy_num}></td>
				<{if $k == '0'}> 
					<td style="border-right:1px solid #efefef;" rowspan="<{$i.span}>"> 
						<p><{$i.total_price}></p>
						<{if $i.freight_price > '0.00'}>
							<p style="font-size:12px; color:#999999;">(含运费 <{$i.freight_price}>)</p>
						<{/if}> 
						<{if $i.promote_price >'0'}>
							<p style="font-size:12px; color:#999999;">优惠 <{$i.promote_price}></p>
						<{/if}>
					</td>
					<td rowspan="<{$i.span}>" valign="top" style="border-right:1px solid #efefef;">
						<div class="order_status">
							<span><{$i.order_status_cn}></span>
							<a href="?m=goods_order&a=detail&oid=<{$i.order_no}>">订单详情</a>
						</div> 
					</td>
					<td rowspan="<{$i.span}>" valign="top">
						<p style="padding:5px 0 0 0; text-align:center;">
						<{if $i.order_status == '1'}>
							 <a href="javascript:;">未支付</a>
						<{elseif $i.order_status == '2'}>
							 <a href="?m=goods_order&a=detail&oid=<{$i.order_no}>" class="button_red">发货</a> 
						<{elseif $i.order_status == '3'}>
							<a href="?m=goods_order&a=detail&oid=<{$i.order_no}>">等待收货</a><br>
						<{elseif $i.order_status == '4' || $i.order_status == '5'}>
							<a href="javascrip:;">交易成功</a> 
						<{elseif $i.order_status == '8'}>
							<a href="javascrip:;">拼团中</a> 
						<{else}>
							 <a href="javascrip:;">交易关闭</a>
						<{/if}>
					</p>
					</td> 
				<{/if}>
				</tr> 
			<{/foreach}> 
			</tbody>
		<{/foreach}>
	<tfoot>
		<tr><td colspan="6"><div class="page"><{$data.page}></div></td></tr>
	</tfoot>
	<{else}>
		<tbody><tr><td colspan="6" class="btm"><div class="nomsg"><i></i><span>您还没有订单~</span></div></td></tr></tbody>
	<{/if}>
</table>  
</div>
<{include file="index/footer.html"}> 
<script type="text/javascript"> 
function sp_dg(name,url){
	ajax_dialog(name,url,380); 
} 
</script>