<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <include file="Common/head" />
        <style type="text/css">
            table {
                border-left:1px solid #ccc;
                border-top:1px solid #ccc;
            }
            th {
                border-right:1px solid #ccc;
                border-bottom:1px solid #ccc;
            }
            td {
                border-right:1px solid #ccc;
                border-bottom:1px solid #ccc;
            }
            .delTr {
                background-color: #666600;
                color: #fff;
                padding: 5px;
            }
            .option {
                margin: 10px;
            }
            .am-form-label{
                padding-top: 0 !important;
            }
        </style>
    </head>
    <body>
        <include file="Common/header" />
        <div class="am-cf admin-main">
            <include file="Common/sidebar" nav="order"/>
            <div class="admin-content">
                <div class="admin-content-body">
                    <div class="am-cf am-padding am-padding-bottom-0">
                        <div class="am-fl am-cf">
                            <strong class="am-text-primary am-text-lg">订单管理</strong> / <small>订单详情</small>
                        </div>
                    </div>
                    <hr style="margin-top:0px;">
                    
                    <div class="am-u-sm-12">
                        <form class="am-form am-form-horizontal" action="" method="POST" enctype="multipart/form-data" id="goodsForm">
                            <input type="hidden" name="id" value="{$detail['id']}" />
                            <input type="hidden" name="p" value="<?php echo I('p')?>">
                            <div class="am-tabs " data-am-tabs >
                                
                                <div class="am-tabs-bd">
                                    <div class="am-tab-panel am-fade am-in am-active" id="tab1">
                                        <div class="am-form-group">
                                            <label class="am-u-sm-2 am-form-label">订单编号</label>
                                            <div class="am-u-sm-10">
                                                <span>{$detail['order_sn']}</span>
                                            </div>
                                        </div>
                                  
                                        <div class="am-form-group">
                                            <label class="am-u-sm-2 am-form-label">订单商品</label>
                                            <div class="am-u-sm-10">                                             
                                            {$detail['goods']}
                                            </div>
                                        </div>
                                        
                                        <div class="am-form-group">
                                            <label class="am-u-sm-2 am-form-label">总价</label>
                                            <div class="am-u-sm-10">
                                               <span>{$detail['total_fee']}</span>
                                            </div>
                                        </div>
                                        <div class="am-form-group">
                                            <label class="am-u-sm-2 am-form-label">用户微信昵称</label>
                                            <div class="am-u-sm-10">
                                               <span>{$detail['nickname']}</span>
                                            </div>
                                        </div>
                                        <div class="am-form-group">
                                            <label class="am-u-sm-2 am-form-label">收货人</label>
                                            <div class="am-u-sm-10">
                                               <span>{$detail['name']}</span>
                                            </div>
                                        </div>
                                        <div class="am-form-group">
                                            <label class="am-u-sm-2 am-form-label">联系方式</label>
                                            <div class="am-u-sm-10">
                                               <span>{$detail['mobile']}</span>
                                            </div>
                                        </div>
                                        <div class="am-form-group">
                                            <label class="am-u-sm-2 am-form-label">收货地址</label>
                                            <div class="am-u-sm-10">
                                               <span>{$detail['address']}</span>
                                            </div>
                                        </div>
                                        <div class="am-form-group">
                                            <label class="am-u-sm-2 am-form-label">订单状态</label>
                                            <div class="am-u-sm-10">
                                               <span>
                                               <switch name="detail.status">
                                                    <case value="1">待确认</case>
                                                    <case value="2">待送货</case>
                                                    <case value="3">已完成</case>
                                                    <case value="-1">已取消</case>
                                                    <case value="-2">已拒绝</case>
                                                </switch>
                                               </span>
                                            </div>
                                        </div>
                                        
                                        <div class="am-form-group">
                                            <label class="am-u-sm-2 am-form-label">预计到达时间</label>
                                            <div class="am-u-sm-10">
                                               <span>{$detail.expect_time}</span>
                                            </div>
                                        </div>
                                        <div class="am-form-group">
                                            <label class="am-u-sm-2 am-form-label">下单时间</label>
                                            <div class="am-u-sm-10">
                                               <span>{$detail.create_time}</span>
                                            </div>
                                        </div>
                                        <div class="am-form-group">
                                            <label class="am-u-sm-2 am-form-label">完成时间</label>
                                            <div class="am-u-sm-10">
                                            <if condition="$detail['finish_time'] gt 0">
                                                <span>{$detail.finish_time}</span>
                                             </if>   
                                            </div>
                                        </div>
                                        <div class="am-form-group">
                                            <label class="am-u-sm-2 am-form-label">订单处理</label>
                                            <div class="am-u-sm-10">
                                               <span><select name="status" id="" style="width: 150px" class="status">
                                                   <option value="2" <?php if($detail['status']==2){echo "selected";}?>>接单</option>
                                                   <option value="3" <?php if($detail['status']==3){echo "selected";}?>>完成</option>
                                                   <option value="-1" <?php if($detail['status']==-1){echo "selected";}?>>取消</option>
                                                   <option value="-2" <?php if($detail['status']==-2){echo "selected";}?>>拒绝</option>
                                               </select></span>
                                            </div>
                                        </div>
                                        <div class="am-form-group status-show" style="display: none;">
                                            <label class="am-u-sm-2 am-form-label">拒绝原因</label>
                                            <div class="am-u-sm-10">
                                               <span><input type="text" name="reason" value="{$detail.reason}" style="width: 500px"></span>
                                            </div>
                                        </div>
                                    </div>                                                                   
                                    
                                </div>
                            </div>
                            <hr>
                            <button type="submit" class="am-btn am-btn-primary am-btn-block" id="comfirm" style="width:80px;">确认</button>
                            
                            <hr>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <script>
        $(function(){
            $('.status').change(function(){
                var status = $(this).val();
                if(status == -2){
                    $('.status-show').show();
                }else{
                     $('.status-show').hide();
                }
            });
            var status = $(".status").val();
            if(status == -2){
                $('.status-show').show();
            }else{
                 $('.status-show').hide();
            }
        });        
        </script>
    </body>

</html>