<header class="uc_head">
	<h3 class="current">订单详情</h3>
</header>

<section class="order_schedule">
	<ol>
		{set:$orderStep = Order_Class::orderStep($this->order_info)}
		{foreach:items=$orderStep item=$stepData key=$eventTime}
		<li>{$eventTime}&nbsp;&nbsp;<span class="black">{$stepData}</span></li>
		{/foreach}
	</ol>
	<p>
		<strong>订单号：</strong>{$this->order_info['order_no']}
		<strong>下单日期：</strong>{$this->order_info['create_time']}
		<strong>状态：</strong>
		<span class="green bold">
			{echo:Order_Class::orderStatusText($orderStatus)}
		</span>
	</p>

	<p>
		{if:in_array($orderStatus,array(1,2))}
		<label class="btn btn_orange">
			<input type="button" value="取消订单" onclick='window.location.href="{url:/ucenter/order_status/order_id/$this->order_info['order_id']/op/cancel}"' />
		</label>
		{/if}

		{if:$orderStatus == 2}
		<label class="btn btn_green">
			<input type="button" value="立即付款" onclick="window.location.href='{url:/block/doPay/order_id/$this->order_info['order_id']}'" />
		</label>
		{/if}

		{if:in_array($orderStatus,array(11,3))}
		<label class="btn btn_green">
			<input type="button" value="确认收货" onclick='window.location.href="{url:/ucenter/order_status/order_id/$this->order_info['order_id']/op/confirm}"' />
		</label>
		{/if}

		{if:Order_Class::isRefundmentApply($this->order_info)}
		<label class="btn btn_orange">
			<input type="button" value="申请退款" onclick='window.location.href="{url:/ucenter/refunds_edit/order_id/$this->order_info['order_id']}"' />
		</label>
		{/if}
	</p>
</section>
<header class="uc_head">
	<h3>收件人信息</h3>
</header>

<section class="col_table">
	<table>
		<tr>
			<th>收货人：</th>
			<td>{$this->order_info['accept_name']}</td>
		</tr>
		<tr>
			<th>地址：</th>
			<td>{$this->order_info['province_str']} {$this->order_info['city_str']} {$this->order_info['area_str']} {$this->order_info['address']}</td>
		</tr>
		<tr>
			<th>邮编：</th>
			<td>{$this->order_info['postcode']}</td>
		</tr>
		<tr>
			<th>固定电话：</th>
			<td>{$this->order_info['telphone']}</td>
		</tr>
		<tr>
			<th>手机号码：</th>
			<td>{$this->order_info['mobile']}</td>
		</tr>
	</table>
</section>

<header class="uc_head">
	<h3>支付及配送方式</h3>
</header>
<section class="col_table">
	<table>
		<tr>
			<th>配送方式：</th>
			<td>{$this->order_info['delivery']}</td>
		</tr>

		{if:$this->order_info['takeself']}
		<tr>
			<th>自提地址：</th>
			<td>
				{$this->order_info['takeself']['province_str']}
				{$this->order_info['takeself']['city_str']}
				{$this->order_info['takeself']['area_str']}
				{$this->order_info['takeself']['address']}
			</td>
		</tr>
		<tr>
			<th>自提联系方式：</th>
			<td>
				座机：{$this->order_info['takeself']['phone']} &nbsp;&nbsp;
				手机：{$this->order_info['takeself']['mobile']}
			</td>
		</tr>
		{else:}
		<tr>
			<th>物流公司：</th>
			<td>{$this->order_info['freight']['freight_name']}</td>
		</tr>
		<tr>
			<th>快递单号：</th>
			<td>{$this->order_info['freight']['delivery_code']}</td>
		</tr>
		{/if}

		<tr>
			<th>支付方式：</th>
			<td>{$this->order_info['payment']}</td>
		</tr>

		{if:$this->order_info['paynote']}
		<tr>
			<th>支付说明：</th>
			<td>{$this->order_info['paynote']}</td>
		</tr>
		{/if}

		<tr>
			<th>运费：</th>
			<td>{$this->order_info['real_freight']}</td>
		</tr>

	</table>
</section>

{if:$this->order_info['invoice']==1}
<header class="uc_head">
	<h3>发票信息</h3>
</header>
<section class="col_table">
	<table>
		<tr>
			<th>所需税金：</th>
			<td>{$this->order_info['taxes']}</td>
		</tr>
		<tr>
			<th>发票抬头：</th>
			<td>{$this->order_info['invoice_title']}</td>
		</tr>
	</table>
</section>
{/if}

<header class="uc_head">
	<h3>商品清单</h3>
</header>

<section class="uc_table">
	<table>
		<thead>
			<tr>
				<th>图片</th>
				<th>商品名称</th>
				<th>赠送积分</th>
				<th>商品价格</th>
				<th>优惠金额</th>
				<th>商品数量</th>
				<th>小计</th>
				<th>配送</th>
			</tr>
		</thead>
		<tbody>
			{foreach:items=Api::run('getOrderGoodsListByGoodsid',array('#order_id#',$this->order_info['order_id'])) item=$good}
			{set:$good_info = JSON::decode($good['goods_array'])}

			<tr>
				<td><img class="pro_pic" src="{url:$good['img']}" width="50px" height="50px" onerror='this.src="{skin:images/front/nopic_100_100.gif}"' /></td>
				<td class="t_l">
					<a class="blue" href="{url:/site/products/id/$good['goods_id']}" target='_blank'>{$good_info['name']}</a>
					{if:$good_info['value']!=''}<p>{$good_info['value']}</p>{/if}
				</td>
				<td>{echo:$good['point']*$good['goods_nums']}</td>
				<td class="red2">￥{$good['goods_price']}</td>
				<td class="red2">￥{echo:$good['goods_price']-$good['real_price']}</td>
				<td>x {$good['goods_nums']}</td>
				<td class="red2 bold">￥{echo:$good['goods_nums']*$good['real_price']}</td>
				<td>
					{echo:Order_Class::goodsSendStatus($good['is_send'])}
					{if:$good['delivery_id']}
					<a onclick='freightLine({$good['delivery_id']});'>查看物流</a>
					{/if}
				</td>
			</tr>
			{/foreach}
			<tr>
				<td colspan="8" class="tr">
					<p>商品总金额：￥{$this->order_info['payable_amount']}</p>
					<p>+ 运费：￥<label id="freightFee">{$this->order_info['real_freight']}</label>

					{if:$this->order_info['taxes'] > 0}
					<p>+ 税金：￥{$this->order_info['taxes']}</p>
					{/if}

					{if:$this->order_info['pay_fee'] > 0}
					<p>+ 支付手续费：￥{$this->order_info['pay_fee']}</p>
					{/if}

					{if:$this->order_info['insured'] > 0}
					<p>+ 保价：￥{$this->order_info['insured']}</p>
					{/if}

					<p>订单折扣或涨价：￥{$this->order_info['discount']}</p>

					{if:$this->order_info['promotions'] > 0}
					<p>- 促销优惠金额：￥{$this->order_info['promotions']}</p>
					{/if}
					<p>订单支付金额：<span class="red">￥<label>{$this->order_info['order_amount']}</label></span></p>
				</td>
			</tr>
		</tbody>
	</table>
</section>

<script>
//快递跟踪
function freightLine(doc_id){
	var urlVal = "{url:/block/freight/id/@id@}";
	urlVal = urlVal.replace("@id@",doc_id);
	art.dialog.open(urlVal,{'title':'轨迹查询',width:'600px',height:'500px'});
}
</script>
