{include file="public/seller_top" /} 

<div class="seller_main w1200">
    {include file="public/seller_left" /}
    <div class="seller_right">

        <div class="dssc-oredr-show">
            <div class="dssc-order-info">
                <div class="dssc-order-details">
                    <div class="title">{$Think.lang.store_show_order_info}</div>
                    <div class="content">
                        <dl>
                            <dt>{$Think.lang.store_show_order_receiver}{$Think.lang.ds_colon}</dt>
                            <dd><?php echo $order_info['extend_order_common']['reciver_name'];?>&nbsp; <?php echo @$order_info['extend_order_common']['reciver_info']['phone'];?>&nbsp; <?php echo @$order_info['extend_order_common']['reciver_info']['address'];?></dd>
                        </dl>
                        <dl>
                            <dt>发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;票：</dt>
                            <dd>
                                <?php foreach ((array)$order_info['extend_order_common']['invoice_info'] as $key => $value){?>
                                <span><?php echo $key;?> (<strong><?php echo $value;?></strong>)</span>
                                <?php } ?>
                            </dd>
                        </dl>
                        <dl>
                            <dt>{$Think.lang.store_show_order_buyer_message}{$Think.lang.ds_colon}</dt>
                            <dd><?php echo $order_info['extend_order_common']['order_message']; ?></dd>
                        </dl>
                        <dl class="line">
                            <dt>{$Think.lang.store_order_order_sn}{$Think.lang.ds_colon}</dt>
                            <dd><?php echo $order_info['order_sn']; ?><a href="javascript:void(0);">更多<i class="icon-angle-down"></i>
                                    <div class="more"><span class="arrow"></span>
                                        <ul>
                                            <?php if($order_info['payment_name']) { ?>
                                            <li>{$Think.lang.store_order_pay_method}{$Think.lang.ds_colon}<span><?php echo $order_info['payment_name']; ?>
                                                    <?php if($order_info['payment_code'] != 'offline' && !in_array($order_info['order_state'],array(ORDER_STATE_CANCEL,ORDER_STATE_NEW))) { ?>
                                                    (付款单号{$Think.lang.ds_colon}<?php echo $order_info['pay_sn']; ?>)
                                                    <?php } ?>
                                                </span></li>
                                            <?php } ?>
                                            <li>{$Think.lang.store_order_add_time}{$Think.lang.ds_colon}<span><?php echo date("Y-m-d H:i:s",$order_info['add_time']); ?></span></li>
                                            <?php if(intval($order_info['payment_time'])) { ?>
                                            <li>{$Think.lang.store_show_order_pay_time}{$Think.lang.ds_colon}<span><?php echo date("Y-m-d H:i:s",$order_info['payment_time']); ?></span></li>
                                            <?php } ?>
                                            <?php if($order_info['extend_order_common']['shipping_time']) { ?>
                                            <li>{$Think.lang.store_show_order_send_time}{$Think.lang.ds_colon}<span><?php echo date("Y-m-d H:i:s",$order_info['extend_order_common']['shipping_time']); ?></span></li>
                                            <?php } ?>
                                            <?php if(intval($order_info['finnshed_time'])) { ?>
                                            <li>{$Think.lang.store_show_order_finish_time}{$Think.lang.ds_colon}<span><?php echo date("Y-m-d H:i:s",$order_info['finnshed_time']); ?></span></li>
                                            <?php } ?>
                                        </ul>
                                    </div>
                                </a></dd>
                        </dl>
                        <dl>
                            <dt></dt>
                            <dd></dd>
                        </dl>
                    </div>
                </div>
                <?php if ($order_info['order_state'] == ORDER_STATE_CANCEL) { ?>
                <div class="dssc-order-condition">
                    <dl>
                        <dt><i class="icon-off orange"></i>订单状态：</dt>
                        <dd>交易关闭</dd>
                    </dl>
                    <ul>
                        <li><?php echo $order_info['close_info']['log_role'];?> 于 <?php echo date('Y-m-d H:i:s',$order_info['close_info']['log_time']);?> <?php echo $order_info['close_info']['log_msg'];?></li>
                    </ul>
                </div>
                <?php } ?>
                <?php if ($order_info['order_state'] == ORDER_STATE_NEW) { ?>
                <div class="dssc-order-condition">
                    <dl>
                        <dt><i class="icon-ok-circle green"></i>订单状态：</dt>
                        <dd>订单已经提交，等待买家付款</dd>
                    </dl>
                    <ul>
                        <li>1. 买家尚未对该订单进行支付。</li>
                        <li>2. 如果买家未对该笔订单进行支付操作，系统将于
                            <time><?php echo date('Y-m-d H:i:s',$order_info['order_cancel_day']);?></time>
                            自动关闭该订单。</li>
                    </ul>
                </div>
                <?php } ?>
                <?php if ($order_info['order_state'] == ORDER_STATE_PAY) { ?>
                <div class="dssc-order-condition">
                    <dl>
                        <dt><i class="icon-ok-circle green"></i>订单状态：</dt>
                        <dd>
                            <?php if ($order_info['payment_code'] == 'offline') { ?>
                            订单已提交，等待发货
                            <?php } else { ?>
                            已支付成功
                            <?php } ?>
                        </dd>
                    </dl>
                    <ul>
                        <?php if ($order_info['payment_code'] == 'offline') { ?>
                        <li>1. 买家已经选择货到付款方式下单成功。</li>
                        <li>2. 订单已提交商家进行备货发货准备。</li>
                        <?php } else { ?>
                        <li>1. 买家已使用“<?php echo orderPaymentName($order_info['payment_code']);?>”方式成功对订单进行支付，支付单号 “<?php echo $order_info['pay_sn'];?>”。</li>
                        <li>2. 订单已提交商家进行备货发货准备。</li>
                        <?php } ?>
                    </ul>
                </div>
                <?php } ?>
                <?php if ($order_info['order_state'] == ORDER_STATE_SEND) { ?>
                <div class="dssc-order-condition">
                    <dl>
                        <dt><i class="icon-ok-circle green"></i>订单状态：</dt>
                        <dd>已发货</dd>
                    </dl>
                    <ul>
                        <li>1. 商品已发出；
                            <?php if ($order_info['shipping_code'] != '') { ?>
                            物流公司：<?php echo $order_info['express_info']['e_name']?>；单号：<?php echo $order_info['shipping_code'];?>。
                            <?php if ($order_info['if_deliver']) { ?>
                            查看 <a href="#order-step" class="blue">“物流跟踪”</a> 情况。
                            <?php } ?>
                            <?php } else { ?>
                            无需要物流。
                            <?php } ?>
                        </li>
                        <li>2. 如果买家没有及时进行收货，系统将于
                            <time><?php echo date('Y-m-d H:i:s',$order_info['order_confirm_day']);?></time>
                            自动完成“确认收货”，完成交易。</li>
                    </ul>
                </div>
                <?php } ?>
                <?php if ($order_info['order_state'] == ORDER_STATE_SUCCESS) { ?>
                <?php if ($order_info['evaluation_state'] == 1) { ?>
                <div class="dssc-order-condition">
                    <dl>
                        <dt><i class="icon-ok-circle green"></i>订单状态：</dt>
                        <dd>评价完成。</dd>
                    </dl>
                    <ul>
                        <li>1. 买家已对该笔订单进行了商品及交易评价。</li>
                        <li>2. 可以在<a href="{:url('/home/storeevaluate/list')}" class="dssc-btn-mini">评价管理</a>查看详细内容。</li>
                    </ul>
                </div>
                <?php } else { ?>
                <div class="dssc-order-condition">
                    <dl>
                        <dt><i class="icon-ok-circle green"></i>订单状态：</dt>
                        <dd>已经收货。</dd>
                    </dl>
                    <ul>
                        <li>1. 交易已完成，买家可以对购买的商品及服务进行评价。</li>
                        <li>2. 评价后的情况会在商品详细页面中显示，以供其它会员在购买时参考。</li>
                    </ul>
                </div>
                <?php } ?>
                <?php } ?>
            </div>
            <?php if ($order_info['order_state'] != ORDER_STATE_CANCEL) { ?>
            <div id="order-step" class="dssc-order-step">
                <dl class="step-first <?php if ($order_info['order_state'] != ORDER_STATE_CANCEL) echo 'current';?>">
                    <dt>提交订单</dt>
                    <dd class="bg"></dd>
                    <dd class="date" title="">{$Think.lang.store_order_add_time}<?php echo date("Y-m-d H:i:s",$order_info['add_time']); ?></dd>
                </dl>
                <?php if ($order_info['payment_code'] != 'offline') { ?>
                <dl class="<?php if(intval($order_info['payment_time'])) echo 'current'; ?>">
                    <dt>支付订单</dt>
                    <dd class="bg"> </dd>
                    <dd class="date" title="{$Think.lang.store_show_order_pay_time}"><?php echo date("Y-m-d H:i:s",$order_info['payment_time']); ?></dd>
                </dl>
                <?php } ?>
                <dl class="<?php if($order_info['extend_order_common']['shipping_time']) echo 'current'; ?>">
                    <dt>商家发货</dt>
                    <dd class="bg"> </dd>
                    <dd class="date" title="{$Think.lang.store_show_order_send_time}"><?php echo date("Y-m-d H:i:s",$order_info['extend_order_common']['shipping_time']); ?></dd>
                </dl>
                <dl class="<?php if(intval($order_info['finnshed_time'])) { ?>current<?php } ?>">
                    <dt>确认收货</dt>
                    <dd class="bg"> </dd>
                    <dd class="date" title="{$Think.lang.store_show_order_finish_time}"><?php echo date("Y-m-d H:i:s",$order_info['finnshed_time']); ?></dd>
                </dl>
                <dl class="<?php if($order_info['evaluation_state'] == 1) { ?>current<?php } ?>">
                    <dt>评价</dt>
                    <dd class="bg"></dd>
                    <dd class="date" title="{$Think.lang.store_show_order_finish_time}"><?php echo date("Y-m-d H:i:s",$order_info['extend_order_common']['evaluation_time']); ?></dd>
                </dl>
            </div>
            <?php } ?>
            <div class="dssc-order-contnet">
                <table class="dssc-default-table order">
                    <thead>
                        <tr>
                            <th class="w10">&nbsp;</th>
                            <th colspan="2">{$Think.lang.store_show_order_goods_name}</th>
                            <th class="w120">{$Think.lang.store_show_order_price}</th>
                            <th class="w60">{$Think.lang.store_show_order_amount}</th>
                            <th class="w100">优惠活动</th>
                            <th class=""><strong>实付 * 佣金比 = 应付佣金(元)</strong></th>
                            <th>交易操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if (!empty($order_info['shipping_code'])) { ?>
                        <tr>
                            <th colspan="6" style="border-right: 0;"> <div class="order-deliver"> <span>物流公司： <a target="_blank" href="<?php echo $order_info['express_info']['e_url'];?>"><?php echo $order_info['express_info']['e_name'];?></a></span> <span>{$Think.lang.store_order_shipping_no}{$Think.lang.ds_colon}<?php echo $order_info['shipping_code']; ?></span><span><a href="javascript:void(0);" id="show_shipping">物流跟踪<i class="icon-angle-down"></i>
                                <div class="more"><span class="arrow"></span>
                                    <ul id="shipping_ul">
                                        <li>加载中...</li>
                                    </ul>
                                </div>
                            </a></span> </div></th>
                    <th colspan="3" style=" border-left: 0;"><?php if(!empty($daddress_info)) { ?>
                    <dl class="daddress-info">
                        <dt>发&nbsp;&nbsp;货&nbsp;&nbsp;人：</dt>
                        <dd><?php echo $daddress_info['seller_name']; ?><a href="javascript:void(0);">更多<i class="icon-angle-down"></i>
                                <div class="more"><span class="arrow"></span>
                                    <ul>
                                        <li>公&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;司：<span><?php echo $daddress_info['company'];?></span></li>
                                        <li>联系电话：<span><?php echo $daddress_info['telphone'];?></span></li>
                                        <li>发货地址：<span><?php echo $daddress_info['area_info'];?>&nbsp;<?php echo $daddress_info['address'];?></span></li>
                                    </ul>
                                </div>
                            </a></dd>
                    </dl>
                    <?php } ?>
                    </th>
                    </tr>
                    <?php } ?>
                    <?php $i = 0;?>
                    <?php foreach($order_info['goods_list'] as $k => $goods) { ?>
                    <?php $i++;?>
                    <tr class="bd-line">
                        <td>&nbsp;</td>
                        <td class="w50"><div class="pic-thumb"><a target="_blank" href="<?php echo $goods['goods_url'];?>"><img src="<?php echo thumb($goods,60);?>" /></a></div></td>
                        <td class="tl">
                            <dl class="goods-name">
                                <dt><a target="_blank" href="<?php echo $goods['goods_url']; ?>"><?php echo $goods['goods_name']; ?></a></dt>
                                <dd>
                                    <?php if (isset($refund_all)) {?>
                                    <?php if (is_array($refund_all) && !empty($refund_all)) {?>
                                    退款单号：<a target="_blank" href="{:url('/home/sellerrefund/view',['refund_id'=>$refund_all.refund_id])}"><?php echo $refund_all['refund_sn'];?></a>
                                    <?php }else if($goods['extend_refund']['refund_type'] == 1) {?>
                                    退款单号：<a target="_blank" href="{:url('/home/sellerrefund/view',['refund_id'=>$goods.extend_refund.refund_id])}"><?php echo $goods['extend_refund']['refund_sn'];?></a></dd>
                                <?php }else if($goods['extend_refund']['refund_type'] == 2) {?>
                                退货单号：<a target="_blank" href="{:url('/home/sellerreturn/view',['refund_id'=>$goods.extend_refund.refund_id])}"><?php echo $goods['extend_refund']['refund_sn'];?></a>
                                </dd>
                                <?php } ?>
                                <?php } ?>
                            </dl>
                        </td>
                        <td><?php echo $goods['goods_price']; ?>
                            <p class="green">
                                <?php if (isset($refund_all)) {?>
                                <?php if (is_array($refund_all) && !empty($refund_all) && $refund_all['admin_time'] > 0) {?>
                                <?php echo $goods['goods_pay_price'];?><span>退</span>
                                <?php } elseif (isset($goods['extend_refund']) && $goods['extend_refund']['admin_time'] > 0) { ?>
                                <?php echo $goods['extend_refund']['refund_amount'];?><span>退</span>
                                <?php } ?>
                                <?php } ?>
                            </p></td>
                        <td><?php echo $goods['goods_num']; ?></td>
                        <td><?php echo $goods['goods_type_cn']; ?></td>
                        <td class="commis bdl bdr">
                            <?php if ($goods['commis_rate'] != 200) { ?>
                            <?php echo $goods['goods_pay_price']; ?> * <?php echo $goods['commis_rate']; ?>% = <b><?php echo dsPriceFormat($goods['goods_pay_price']*$goods['commis_rate']/100); ?></b>
                            <?php } ?>
                        </td>

                        <!-- S 合并TD -->
                        <?php if (($order_info['goods_count'] > 1 && $k ==0) || ($order_info['goods_count'] == 1)){?>
                        <td class="bdl bdr" rowspan="<?php echo $order_info['goods_count'];?>"><?php echo $order_info['state_desc']; ?>
                            <?php if ($order_info['if_lock']) { ?>
                            <p>退款退货中</p>
                            <?php } ?>

                            <!-- 修改价格 -->
                            <?php if ($order_info['if_modify_price']) { ?>
                            <p><a href="javascript:void(0)" class="dssc-btn" uri="{:url('/home/sellerorder/change_state',['state_type'=>'modify_price','order_sn'=>$order_info.order_sn,'order_id'=>$order_info.order_id])}" dialog_width="480" dialog_title="{$Think.lang.store_order_modify_price}" nc_type="dialog"  dialog_id="seller_order_adjust_fee" id="order<?php echo $order_info['order_id']; ?>_action_adjust_fee" />修改运费</a></p>
                            <?php }?>

                            <!-- 取消订单 -->
                            <?php if ($order_info['if_cancel']) { ?>
                            <p><a href="javascript:void(0)" style="color:#F30; text-decoration:underline;" nc_type="dialog" uri="{:url('/home/sellerorder/change_state',['state_type'=>'order_cancel','order_sn'=>$order_info.order_sn,'order_id'=>$order_info.order_id])}" dialog_title="{$Think.lang.store_order_cancel_order}" dialog_id="seller_order_cancel_order" dialog_width="400" id="order<?php echo $order_info['order_id']; ?>_action_cancel" />{$Think.lang.store_order_cancel_order}</a></p>
                            <?php } ?>

                            <!-- 发货 -->
                            <?php if ($order_info['if_send']) { ?>
                            <p><a class="dssc-btn" href="{:url('/home/sellerdeliver/send',['order_id'=>$order_info.order_id])}"/><i class="icon-truck"></i>{$Think.lang.store_order_send}</a></p>
                            <?php } ?></td>
                        <?php } ?>
                        <!-- E 合并TD -->
                    </tr>

                    <!-- S 赠品列表 -->
                    <?php if (!empty($order_info['zengpin_list']) && $i == count($order_info['goods_list'])) { ?>
                    <tr class="bd-line">
                        <td>&nbsp;</td>
                        <td colspan="6" class="tl"><div class="dssc-goods-gift">赠品：
                                <ul><?php foreach($order_info['zengpin_list'] as $zengpin_info) {?>
                                    <li><a title="赠品：<?php echo $zengpin_info['goods_name'];?> * <?php echo $zengpin_info['goods_num'];?>" target="_blank" href="<?php echo $zengpin_info['goods_url'];?>"><img src="<?php echo thumb($zengpin_info,60);?>" /></a></li>
                                    <?php } ?></ul></div>
                        </td>
                    </tr>
                    <?php } ?>
                    <!-- E 赠品列表 -->

                    <?php } ?>
                    </tbody>
                    <tfoot>
                        <?php if(!empty($order_info['extend_order_common']['promotion_info']) || !empty($order_info['extend_order_common']['voucher_code'])){ ?>
                        <tr>
                            <td colspan="20"><dl class="dssc-store-sales">
                                    <dt>其它信息{$Think.lang.ds_colon}</dt>
                                    <?php if(!empty($order_info['extend_order_common']['promotion_info'])){ ?>
                                    <dd><?php echo $order_info['extend_order_common']['promotion_info'];?></dd>
                                    <?php } ?>
                                    <?php if(!empty($order_info['extend_order_common']['voucher_code'])){ ?>
                                    <dd>使用了面额为 <?php echo $order_info['extend_order_common']['voucher_price'];?> 元的代金券，编码：<?php echo $order_info['extend_order_common']['voucher_code'];?></span></dd>
                                    <?php } ?>
                                </dl></td>
                        </tr>
                        <?php } ?>
                        <tr>
                            <td colspan="20"><dl class="freight">
                                    <dd>
                                        <?php if(!empty($order_info['shipping_fee']) && $order_info['shipping_fee'] != '0.00'){ ?>
                                        {$Think.lang.store_show_order_tp_fee}: <span>{$Think.lang.currency}<?php echo $order_info['shipping_fee']; ?></span>
                                        <?php }else{?>
                                        {$Think.lang.ds_common_shipping_free}
                                        <?php }?>
                                        <?php if($order_info['refund_amount'] > 0) { ?>
                                        ({$Think.lang.store_order_refund}:{$Think.lang.currency}<?php echo $order_info['refund_amount'];?>)
                                        <?php } ?>
                                    </dd>
                                </dl>
                                <dl class="sum">
                                    <dt>{$Think.lang.store_order_sum}{$Think.lang.ds_colon}</dt>
                                    <dd><em><?php echo $order_info['order_amount']; ?></em>元</dd>
                                </dl></td>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </div>












    </div>
</div>

{include file="public/mall_footer" /}


<script type="text/javascript">
$(function(){
    $('#show_shipping').on('hover',function(){
        var_send = '<?php echo date("Y-m-d H:i:s",$order_info['extend_order_common']['shipping_time']); ?>&nbsp;&nbsp;{$Think.lang.member_show_seller_has_send}<br/>';
    	$.getJSON(SITE_URL+'index.php/Sellerdeliver/get_express.html?e_code={$order_info.express_info.e_code}&shipping_code={$order_info.shipping_code}',function(data){
    		if(data){
    			data = var_send+data;
    			$('#shipping_ul').html(data);
    			$('#show_shipping').unbind('hover');
    		}else{
    			$('#shipping_ul').html(var_send);
    			$('#show_shipping').unbind('hover');
    		}
    	});
    });
});
</script>