<{import file="index/header.html" title="订单列表"}> 
<link rel="stylesheet" type="text/css" href="<{$__APP__}>public/css/order.css">
<div class="tab"><span>我的订单</span></div>
<div class="lbox"> 
	<div class="con_tab">
		<a href="?m=buy" <{if $smarty.get.status ==''}>class="ch"<{/if}>>订单列表</a> 
		<a href="?m=buy&status=1" <{if $smarty.get.status == '1'}>class="ch"<{/if}>>待付款</a> 
		<a href="?m=buy&status=2" <{if $smarty.get.status == '2'}>class="ch"<{/if}>>待发货</a> 
		<a href="?m=buy&status=3" <{if $smarty.get.status == '3'}>class="ch"<{/if}>>待收货</a> 
		<a href="?m=buy&status=4" <{if $smarty.get.status == '4'}>class="ch"<{/if}>>交易结束</a> 
		<{if $smarty.get.a == 'comment'}>
			 <em>|</em><a href="javascript:;" class="ch">购买评论</a>  
		<{/if}> 
	</div> 
	<table width="100%">
		<thead>
			<tr>
				<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=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="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>
							<span class="order_span">店铺：<a href="index.php?m=shop&id=<{$i.shop_id}>" target="_blank"><{$i.shop_name}></a></span>
							<{if $i.otype == '2'}> 
								<span style=" margin:11px 0 0 20px; background:#f00; color:#fff; float:left;">拼团订单</span>
							<{/if}>
							<{if $i.order_status == '0'||$i.order_status == '4'||$i.order_status == '5'}>
								<a href="?m=buy&a=del_order&oid=<{$i.order_no}>" class="order_del" onclick="del()">删除</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="index.php?m=goods&a=detail&id=<{$g.gid}>" class="order_img" target="_blank">
										<img src="<{$__IMG__}><{$g.images|img_size:80x80}>" width="80">
									</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><{$g.buy_num}></td> 
						<td style="border-right:1px solid #efefef;">
							<{if $i.order_status >= 2}>
								<a href="?m=buy&a=refund_detail&service_id=<{$g.service_id}>">维权售后</a>
							<{/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:#999999;">运费 <{$i.express_price}></p><{/if}> 
							<{if $i.promote_price >'0'}><p style="font-size:12px; color:#999999;">优惠 <{$i.promote_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="?m=buy&a=detail&oid=<{$i.order_no}>" style="color: #FF0000; line-height:26px;">订单详情</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="?m=buy&a=pay_trade&oid=<{$i.order_no}>" target="_blank" class="button_do">付款</a><br>
									<a href="javascript:;" class="cancel_order" onClick="cancel_order('取消订单','?m=buy&a=cancel_order&oid=<{$i.order_no}>')">取消订单</a>
								<{elseif $i.order_status == '2'}>
									<span>等待发货</span>
								<{elseif $i.order_status == '3'}>
									<a href="?m=buy&a=detail&oid=<{$i.order_no}>" class="button_do">确认收货</a><br>
								<{elseif $i.order_status == '4'}>
									<a href="?m=buy&a=comment&oid=<{$i.order_no}>">商品评价</a>
								<{elseif $i.order_status == '5'}>	
									<a href="javascrip:;">交易结束</a><br>
									<a href="?m=buy&a=comment&oid=<{$i.order_no}>">查看评价</a> 
								<{elseif $i.order_status == '8'}> 
									<!--拼团，交易成功直接变成6，拼团成功变成2-->
									 <a href="index.php?m=goods&a=share&share_id=<{$i.share_id}>">拼团分享</a> 
								<{else}>
									 <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>
<{include file="index/footer.html"}> 
<script type="text/javascript"> 
function cancel_order(name,url){
	ajax_dialog(name, url, 350, 50); 
} 
</script>