<{import file="index/header_shop.html" title="订单详情"}> 
<link type="text/css" rel="stylesheet" href="<{$__APP__}>public/css/order_detail.css">
<style type="text/css">
.process ul li{ width:190px; }
.odStatus{ width:625px;}
</style>
<{uqcms m="order" v="row" c="get_detail:order_no=smarty.get.oid&is_shop=true"}>
<div class="lbox"> 
	<div class="process">
		<ul>
			<li class="step <{if $row.order.order_status >= 1}>step1<{else}>step0<{/if}>">
				<div class="ttl">买家下单</div>
				<div class="number">√</div>
				<div class="meta"><{if $row.order.addtime}><{$row.order.addtime}><{/if}></div>
			</li>
			<li class="step <{if $row.order.order_status >= 2}> step1<{else}>step0<{/if}>">
				<div class="ttl">已经付款</div>
				<div class="number">√</div>
				<div class="meta"><{if $row.order.pay_time}><{$row.order.pay_time}><{/if}></div>
			</li>
			<li class="step <{if $row.order.order_status >= 3}> step1<{else}>step0<{/if}>">
				<div class="ttl">卖家发货</div>
				<div class="number">√</div>
				<div class="meta"><{if $row.order.deliver_time}><{$row.order.deliver_time}><{/if}></div>
			</li>
			<li class="step <{if $row.order.order_status >= 4}> step1<{else}>step0<{/if}>">
				<div class="ttl">等待收货</div>
				<div class="number">√</div>
				<div class="meta"><{if $row.order.receipt_time}><{$row.order.receipt_time}><{/if}></div>
			</li>
			<li class="step <{if $row.order.order_status >= 5}> step1<{else}>step0<{/if}>">
				<div class="ttl">互相评价</div>
				<div class="number">√</div>
				<div class="meta"><{if $row.order.comment_time}><{$row.order.comment_time}><{/if}></div>
			</li>
		</ul>
	</div> 
	<div class="oStatus"> 
		<div class="adrbox">
			<div class="gname"><span>订单信息</span></div>
			<div class="gcon address">
				<div class="addD"><h3>订单编号：</h3> <span><{$row.order.order_no}></span> </div> 
				<div class="addD"><h3>收货姓名：</h3> <span><{$row.express.name}></span> </div> 
				<div class="addD">
					<h3>收货信息： </h3>
					<span><{$row.express.prov_cn}> <{$row.express.city_cn}> <{$row.express.dist_cn}> , <{$row.express.address}> </span>
				</div> 
				<{if $row.express.zip != '' }>
					<div class="addD"><h3>地址邮编：</h3> <span> <{$row.express.zip}></span></div>
				<{/if}>
				<div class="addD"><h3>联系电话：</h3> <span><{$row.express.mobile}></span> </div> 
				<div class="addD"><h3>买家留言：</h3> <span><{$row.order.message}></span> </div> 
			</div>
		</div> 
		<div class="odStatus"> 
		<{if $row.order.order_status == 1}>
			<div class="statusNm"><h3>商品已拍下，等待买家付款</h3></div>
		<{elseif $row.order.order_status == 2 || $row.order.order_status == 3}> 
			<div class="statusNm">
				<{if $row.order.order_status == 3}>
					<h3>等待买家收货</h3>
				<{else}>
					<h3><{$row.order.order_status_cn}></h3>
				<{/if}>
			</div>
			<div class="statusDo"> 
				<form action="?m=goods_order&a=send_goods" method="post" id="form">
					<input type="hidden" name="oid" value="<{$row.order.order_no}>"/>
					<div class="kdBox">
						<table class="edit_table">
							<tr>
								<td width="80">选择快递：</td>
								<td> 
									<select name="kd_code">
										<option value="0">--选择快递--</option>
									<{uqcms m="express" v="exp_data" c="get_config"}> 
									<{foreach item=i from=$exp_data}>		
										<option value="<{$i.code}>" <{if $i.code == $row.express.kd_code}> selected="selected"<{/if}>><{$i.name}></option>
									<{/foreach}>			 
									</select>
								</td>
							</tr>
							<tr class="kd_code">
								<td>快递单号：</td>
								<td><input type="text" name="kd_number" size="28" value="<{$row.express.kd_number}>"/></td>
							</tr>
							<tr>
								<td></td>
								<td><input type="submit" name="submit" class="submit" value="发货"></td>
							</tr>
						</table>
					</div>	
				 </form> 
			</div>
		<{elseif $row.order.order_status == 4}>
			<div class="statusNm"><h3>买家已经收货</h3></div>
			<div class="statusDo"></div>	
		<{elseif $row.order.order_status == 5}>		
			<div class="statusNm"><h3>交易结束</h3></div>
			<div class="statusDo"><span>交易成功</span></div>  
		<{elseif $row.order.order_status == '8'}>		
			<div class="statusNm"><h3>拼团中</h3></div>
			<div class="statusDo"><span>等待拼团操作中，请等待。</span></div>  
		<{else}>
			<div class="statusNm"><h3>交易关闭</h3></div>
			<div class="statusDo"><span>取消原因：<{$row.order.cancel_reason}></span></div> 
		<{/if}>
	
			<{if $row.order.order_status == '4'}> 
				<div class="wl"> 
					<span>快递信息</span>
					<dl>
						<dt>快递公司：</dt>
						<dd><{if $row.express.kd_name}><{$row.express.kd_name}><{else}>--<{/if}></dd>
					</dl>
					<dl>
						<dt>运单号码：</dt>
						<dd><{if $row.express.kd_number}><{$row.express.kd_number}><{else}>--<{/if}></dd>
					</dl>
					<{if $row.express.kd_code == 'uqcms'}>
						<dl><div class="exp_pro">商家自行配送</div></dl> 
					<{else}>		
						<dl><div class="exp_pro"><ul>加载中...</ul></div></dl> 
					<{/if}>
				</div>
			<{/if}>		
		</div>
	</div>
	 
	<div class="gcon"> 
		<table class="ltable">
			<thead>
				<tr>
					<th>商品</th>
					<th width="100">单价（元）</th>
					<th width="100">数量</th> 
					<th width="100">总价（元）</th>
				</tr>
			</thead>
			<tbody>
				<{foreach item=i from=$row.glist}>
					<tr>
						<td style="text-align:left;"> 
							<div class="box_content">
								<div class="img">
									<a href="index.php?m=goods&a=detail&id=<{$i.gid}>" target="blank">
										<img src="<{$__IMG__}><{$i.images|img_size:80x80}>" width="80"/>
									</a>
								</div>
								<div class="desc">
									<div class="ttl"><a href="index.php?m=goods&a=detail&id=<{$i.gid}>" target="blank"><{$i.title}></a></div>
									<div class="sku">
										<{if $i.sku}>
											<{foreach item=s from=$i.sku}>		
												<span><{$s.0}> : <{$s.1}> &nbsp;&nbsp; </span> 
											<{/foreach}>
										<{/if}>
									</div>
								</div> 
							</div>		
						</td>
						<td><{$i.price}></td>
						<td><{$i.buy_num}></td> 
						<td><{$i.total_price}></td> 
					</tr>
				<{/foreach}>
			</tbody> 
		</table> 
		<div class="total_price">
			<div class="srit">
				<{if $row.order.discount_price}>
					<dl><dt>优&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;惠：</dt> <dd>￥<{$row.order.discount_price}></dd></dl>
				<{/if}>	
				<{if $row.order.express_price > 0}>
					<dl><dt>快&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;递：</dt><dd>￥<{$row.order.express_price}></dd></dl>
				<{/if}>
				<dl><dt class="total">实际付款：</dt><dd class="total">￥<{$row.order.total_price}></dd></dl> 
			</div> 
		</div> 
		
	</div> 
</div>
<{include file="index/footer.html"}> 
<{if $row.order_status == '4'}> 
<script type="text/javascript" src="<{$__PUBLIC__}>js/jquery.nicescroll.js"></script>
<script type="text/javascript">
	get_express_pro('<{$row.express.kd_code}>','<{$row.express.kd_number}>');
	function get_express_pro(code,number){ 
		$.get('index.php?m=ajax&a=express&code='+code+'&nu='+number,function(data){ 
			html = '';
			$.each(data.result, function(i,value){ 
				html += '<li><div class="con"><p class="msg">'+value.msg+'</p><p class="time">'+value.time+'</p></div><i></i></li>';
			});
			$('.exp_pro ul').html(html);
		},'json');
	}
	$('.exp_pro').niceScroll({
		cursorcolor: "#ccc", 
		cursoropacitymax: 1, 
		touchbehavior: false, 
		cursorwidth: "5px", 
		cursorborder: "0", 
		cursorborderradius: "5px", 
		autohidemode: false, 
		horizrailenabled: false,
		hidecursordelay: 10, 
		boxzoom:true
	}); 
</script>  
<{/if}>  
<script type="text/javascript">
$(function(){
	$("select[name=kd_code]").change(function(){
		$this = $(this);
		aa = $this.find("option:selected").val();
		ziyin(aa);
	}); 
	//ziyin('<{$kd_row.kd_code}>');
	function ziyin(aa){
		if(aa == 'uqcms'){
			$(".kd_code").hide();
		}else{
			$(".kd_code").show(); 
		}
	}
});
</script> 