<div class="main f_r">

    <div class="uc_title m_10">
        <label class="current"><span>退款详情</span></label>
    </div>

    {if:$this->data['pay_status'] == 3}
	<div class="box m_10">
	    <form action="{url:/ucenter/refunds_freight}" method="post">
	    <input type="hidden" value="{$this->data['id']}" name="id" />
	    <table class="border_table" width="100%" cellpadding="0" cellspacing="0">
			<colgroup>
				<col width="150px" />
				<col />
			</colgroup>
			<tr><th>说明：</th><td>需要您提供返还商品的物流信息，以便我们尽快为您办理后续服务</td></tr>
			<tr>
			    <th>填写返还物流：</th>
			    <td>
			        <select name="user_freight_id" pattern="required">
    					<option value="">请选择物流公司</option>
                        {foreach:items=Api::run('getFreightCompany')}
    					<option value="{$item['id']}">{$item['freight_name']}</option>
    					{/foreach}
			        </select>
			        <input name="user_delivery_code" type="text" pattern="required" class="normal" placeholder="填写快递单号">
			    </td>
			</tr>

			<tr>
				<th></th>
				<td>
					<label class="btn"><input type="submit" value="保 存" /></label>
				</td>
			</tr>
		</table>
	    </form>
	</div>
	{/if}

	<div class="box m_10">
		<table class="border_table" width="100%" cellpadding="0" cellspacing="0">
			<colgroup>
				<col width="150px" />
				<col />
			</colgroup>

			<tr>
				<th>订单号：</th>
				<td>{$this->data['order_no']}</td>
			</tr>

			<tr>
				<th>处理状态：</th>
				<td>{echo:Order_Class::refundmentText($this->data['pay_status'])}</td>
			</tr>

			<tr>
				<th>售后商品：</th>
				<td>
					{foreach:items = $this->data['goods']}
					{set:$goodsInfo = JSON::decode($item['goods_array'])}
					<p>
						<a class="blue" href="{url:/site/products/id/$item['goods_id']}" href="_blank">
							{$goodsInfo['name']} {if:$goodsInfo['value']}{$goodsInfo['value']}{/if} X {$item['goods_nums']}
						</a>
					</p>
					{/foreach}
				</td>
			</tr>

			{if:$this->data['img_list']}
            <tr>
                <th>图片信息：</th>
                <td>
                {foreach:items=JSON::decode($this->data['img_list']) item=$itemImg}
                    <a href="{url:$itemImg}" target="_blank"><img class="img-thumbnail" style="width:100px;height:100px" src="{url:$itemImg}" /></a>
                 {/foreach}
                 </td>
            </tr>
            {/if}

			{if:$this->data['seller_id']}
			<tr>
				<th>商家主页：</th>
				<td><a href="{url:/site/home/id/$this->data['seller_id']}" target="_blank">进入主页</a></td>
			</tr>
			{/if}

			<tr>
				<th>申请时间：</th>
				<td>{$this->data['time']}</td>
			</tr>

			{if:$this->data['amount'] > 0}
			<tr>
				<th>退款金额：</th>
				<td class="red2 bold">{$this->data['amount']}</td>
			</tr>
			<tr>
				<th>退款方式：</th>
				<td>{echo:Order_Class::refundWay($this->data['way'])}</td>
			</tr>
			{/if}

			<tr>
				<th>处理时间：</th>
				<td>{echo:$this->data['dispose_time']?$this->data['dispose_time']:'未处理';}</td>
			</tr>

			<tr>
				<th>处理建议：</th>
				<td>{echo:$this->data['dispose_idea']?$this->data['dispose_idea']:'未回复'}</td>
			</tr>

			<tr>
				<th>售后原因：</th>
				<td>{$this->data['content']}</td>
			</tr>

	        {if:$this->data['user_send_time']}
			<tr>
			    <th>返还物流：</th>
			    <td>
			        {$this->data['user_send_time']}
                    <p>
    			    {foreach:items=Api::run('getFreightCompanyById',array('freight_id'=>$this->data['user_freight_id'])) item=$tempFreight}
                    {$tempFreight['freight_name']}
                    {/foreach}

                    【快递单号：{$this->data['user_delivery_code']}】
                    <input type='button' class='sbtn' value='物流' onclick="freightLine({$this->data['user_freight_id']},'{$this->data['user_delivery_code']}')" />
			        </p>
			    </td>
			</tr>
	        {/if}

			<tr>
				<th></th>
				<td>
					<label class="btn"><input type="button" value="返 回" onclick='event_link("{url:/ucenter/refunds}")'></label>
				</td>
			</tr>
		</table>
	</div>
</div>

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