<{import 
	file="mheader.html" 
	title="订单列表"
}> 
<link rel="stylesheet" type="text/css" href="<{$__APP__}>public/mcss/order.css?v=<{$js_version}>">
<style type="text/css">
.order_del{ background:url(<{$__PUBLIC__}>images/icon/del.png) no-repeat; text-indent:-9999px;}
</style>
<div class="tab2"><span>订单列表</span></div>
<div class="lbox">  
	<div class="con_tab">
		<a href="<{$__URI__}>order/index" <{if $smarty.get.status ==''}>class="ch"<{/if}>>全部</a> 
		<a href="<{$__URI__}>order?status=1" <{if $smarty.get.status == '1'}>class="ch"<{/if}>>待付款</a> 
		<a href="<{$__URI__}>order?status=2" <{if $smarty.get.status == '2'}>class="ch"<{/if}>>待发货</a> 
		<a href="<{$__URI__}>order?status=3" <{if $smarty.get.status == '3'}>class="ch"<{/if}>>待收货</a> 
		<a href="<{$__URI__}>order?status=4" <{if $smarty.get.status == '4'}>class="ch"<{/if}>>待评价</a> 
	</div>
	<div class="sch"> 
		<form action="">
			<input type="text" name="key" value="<{$smarty.get.key}>" placeholder="关键字或订单号" class="input"/>
			<input type="submit" class="submit" value="搜索"/>
		</form>	
	</div>
	<table width="100%">
		<thead>
			<tr style="background:#f8f8f8;">
				<th>商品名</th>
				<th width="80">单价</th>
				<th width="60">数量</th>
				<th width="120">商品操作</th>
				<th width="80">实付款</th>
				<th width="100">交易状态</th>
				<th width="100">交易操作</th> 
			</tr> 
		</thead> 
		<tbody class="table_line">
			<tr><td colspan="7">&nbsp;</td></tr>
		</tbody>
		<{uqcms m="order" v="data" c="order_list:user_type=1&page=smarty.get.page&page_size=smarty.get.page_size&status=smarty.get.status&key=smarty.get.key"}>
		<{if $data.list}>
			<{foreach item=i from=$data.list}>	
				<tbody style="border:1px solid #efefef;">
					<tr class="order_tr_top">
						<td colspan="7">
							<span class="order_span" style="padding-right:10px; padding-left:20px;"> 订单号：<{$i.order_no}></span>
							<span class="order_span" style="padding-right:10px;"><{$i.addtime}></span> 
							<a class="order_span" href="<{$__URI__}>shop/<{$i.shop.id}><{$__HTML__}>" target="_blank"><{$i.shop.name}></a>
							<{if $i.order_status == '0' || $i.order_status == '4' || $i.order_status == '5'}>
								<a href="javascript:;" class="order_del delete" data-id="<{$i.order_no}>">删除</a>
							<{/if}> 
						</td>
					</tr>
				<{foreach key=k item=g from=$i.glist}>
					<tr class="order_tr">
						<td style="border-top:1px solid #efefef;">
							<div class="gcon">
								<div class="img">
									<a href="<{$__URI__}>goods/<{$g.gid}><{$__HTML__}>" class="order_img" target="_blank">
										<img src="<{$__IMG__}><{$g.images|img_size:80x80}>">
									</a>
								</div>
								<div class="desc">
									<div class="ttl">
										<a href="<{$__URI__}>goods/<{$g.gid}><{$__HTML__}>" 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><{$g.buy_num}></td> 
						<td style="border-right:1px solid #efefef;">
							<{if $i.order_status >= '2'}> 
								<{if $g.is_after_sale == '1' || $i.order_status == '2'}><!--一经发货无售后--> 
									<a href="<{$__URI__}>order/refund_detail?service_id=<{$g.service_id}>">
										<{if $g.service_status != '0'}>
											<span style="color:#f00;"><{$g.service_status_cn}></span>
										<{else}>
											售后服务
										<{/if}>	
									</a>
								<{else}>
									<span style="color:#d2d2d2;">无售后</span>	
								<{/if}>
							<{/if}>
						</td>
						<{if $k == '0'}>
							<td style="border:1px solid #efefef;" rowspan="<{$i.span}>" valign="top">
								<p class="total_price">￥<{$i.total_price}></p>
								<{if $i.express_price > '0.00'}><p style="font-size:12px; color:#999;">运费 <{$i.express_price}></p><{/if}> 
								<{if $i.coupon_price > 0}><p style="font-size:12px; color:#999;">优惠 -<{$i.coupon_price}></p><{/if}>
							</td>
							<td style="border:1px solid #efefef;" rowspan="<{$i.span}>" valign="top"> 
								<span style="padding:2px 10px;"><{$i.order_status_cn}></span><br> 
								<a href="<{$__URI__}>order/detail?oid=<{$i.order_no}>" style="color:#f00; line-height:26px;" target="_blank">订单详情</a>
							</td>
							<td style="border:1px solid #efefef;" rowspan="<{$i.span}>" valign="top">  
								<p style="padding:5px 0 0 0; text-align:center;">
									<{if $i.order_status == '1'}>
					<a href="<{$__URI__}>order/pay?order_no=<{$i.order_no}>" target="_blank" class="button_do">付款</a><br>
					<a href="javascript:;" class="cancel_order" onClick="cancel_order('取消订单','<{$__URI__}>order/cancel_order?oid=<{$i.order_no}>')">取消订单</a>
									<{elseif $i.order_status == '2'}>
										<span>等待发货</span>
									<{elseif $i.order_status == '3'}>
										<a href="<{$__URI__}>order/detail?oid=<{$i.order_no}>" class="button_do">确认收货</a><br>
									<{elseif $i.order_status == '4'}>
										<a href="<{$__URI__}>order/comment?oid=<{$i.order_no}>" class="cmt">商品评价</a>
									<{elseif $i.order_status == '5'}>	
										<a href="javascrip:;">交易结束</a> 
									<{/if}>
								</p>
							</td> 
						<{/if}>
					</tr>
				<{/foreach}> 
				</tbody>  
				<tbody class="table_line"><tr><td colspan="7">&nbsp;</td></tr></tbody>
			<{/foreach}>
				<{if $data.page}>
				<tbody class="table_line">
					<tr><td colspan="7"><div class="page"><{$data.page}></div></td></tr>
				</tbody>
				<{/if}>
			<{else}>
				<tbody class="table_line">
					<tr><td colspan="7"><div class="nomsg"><i></i><span>最近没有订单哦~</span></div></td></tr>
				</tbody>
			<{/if}>  
		</tfoot> 
	</table>
</div>
<{import file="mfooter.html"}> 
<script type="text/javascript"> 
function cancel_order(name, url){
	ajax_dialog(name, url, 350); 
}
_delete('<{$__URI__}>order/del'); 
</script>