<div class="content-wrapper">

    <section class="content-header">
        <?=$this->partial('layout/breadcrumb')?>

        <h1 class="pull-right">
            <a href="<?=$this->url('app-shop');?>" class="btn btn-default btn-sm"><i class="fa fa-arrow-left"></i> <?=$this->translate('返回商城订单列表')?></a>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title"><?=$this->translate('商城订单详情');?></h3>
                    </div>

                    <div class="box-body">
                        <div class="row">
                            <div class="col-xs-4 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('订单编号')?>：</b><?=$this->escapeHtml($this->orderInfo->getShopOrderSn());?>
                                </div>
                            </div>
                            <div class="col-xs-4 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('订单状态')?>：</b><?=$this->shop()->shopOrderState($this->orderInfo->getShopOrderState(), 2);?>
                                </div>
                            </div>

                            <div class="col-xs-4 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('付款方式')?>：</b><?=$this->escapeHtml($this->orderInfo->getShopPaymentName());?>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-12 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('下单时间')?>：</b><?=date("Y-m-d H:i:s", $this->orderInfo->getShopOrderAddTime());?>
                                </div>
                            </div>
                            <div class="col-xs-12 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('付款时间')?>：</b><?=(!empty($this->orderInfo->getShopOrderPayTime()) ? date("Y-m-d H:i:s", $this->orderInfo->getShopOrderPayTime()) : $this->translate('暂无'))?>
                                </div>
                            </div>
                            <div class="col-xs-12 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('发货时间')?>：</b><?=(!empty($this->orderInfo->getShopOrderExpressTime()) ? date("Y-m-d H:i:s", $this->orderInfo->getShopOrderExpressTime()) : $this->translate('暂无'))?>
                                </div>
                            </div>
                            <div class="col-xs-12 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('收货时间')?>：</b><?=(!empty($this->orderInfo->getShopOrderFinishTime()) ? date("Y-m-d H:i:s", $this->orderInfo->getShopOrderFinishTime()) : $this->translate('暂无'))?>
                                </div>
                            </div>
                        </div>

                        <div class="box-header">
                            <h4 class="box-title"><?=$this->translate('配送')?></h4>
                        </div>
                        <div class="row">
                            <div class="col-xs-4 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('快递信息')?>：</b><?=$this->escapeHtml($this->orderInfo->getShopExpressName());?>
                                </div>
                            </div>
                            <div class="col-xs-4 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('快递单号')?>：</b><?=$this->escapeHtml($this->deliveryInfo->getDeliveryNumber());?>
                                </div>
                            </div>
                            <div class="col-xs-4 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('收货人')?>：</b><?=$this->escapeHtml($this->deliveryInfo->getDeliveryName());?>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-4 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('收货人手机')?>：</b><?=$this->escapeHtml($this->deliveryInfo->getDeliveryPhone());?>
                                </div>
                            </div>
                            <div class="col-xs-4 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('收货人座机')?>：</b><?=$this->escapeHtml($this->deliveryInfo->getDeliveryTelephone());?>
                                </div>
                            </div>
                            <div class="col-xs-4 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('邮编')?>：</b><?=$this->escapeHtml($this->deliveryInfo->getZipCode());?>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-4 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('收货地址')?>：</b><?=$this->escapeHtml($this->deliveryInfo->getRegionInfo().$this->deliveryInfo->getRegionAddress());?>
                                </div>
                            </div>
                            <div class="col-xs-8 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('备注')?>：</b><?=$this->escapeHtml($this->deliveryInfo->getDeliveryInfo());?>
                                </div>
                            </div>
                        </div>

                        <div class="box-header">
                            <h4 class="box-title"><?=$this->translate('订单留言')?></h4>
                        </div>
                        <div class="row">
                            <div class="col-xs-12 form-group">
                                <div class="col-sm-12">
                                    <?=(!empty($this->orderInfo->getShopOrderMessage()) ? $this->escapeHtml($this->orderInfo->getShopOrderMessage()) : $this->translate('暂无'))?>
                                </div>
                            </div>
                        </div>

                        <div class="box-header">
                            <h4 class="box-title"><?=$this->translate('商品')?></h4>
                        </div>
                        <div class="box-body table-responsive no-padding">
                            <table class="table table-hover">
                                <thead>
                                <tr>
                                    <th width="15%"><?=$this->translate('商品编号')?></th>
                                    <th width="20%"><?=$this->translate('商品名称')?></th>
                                    <th><?=$this->translate('商品规格')?></th>
                                    <th><?=$this->translate('单位')?></th>
                                    <th><?=$this->translate('单价')?></th>
                                    <th><?=$this->translate('数量')?></th>
                                    <th width="10%"><?=$this->translate('总价')?></th>
                                </tr>
                                </thead>

                                <?php
                                foreach ($this->orderGoods as $goodsValue) {
                                    ?>
                                    <tr>
                                        <td><?=$this->escapeHtml($goodsValue->getGoodsSn());?></td>
                                        <td><?=$this->escapeHtml($goodsValue->getGoodsName());?></td>
                                        <td><?=$this->escapeHtml($goodsValue->getGoodsSpec());?></td>
                                        <td><?=$this->escapeHtml($goodsValue->getGoodsUnitName());?></td>
                                        <td><?=$this->erpCurrencyFormat($goodsValue->getGoodsPrice());?></td>
                                        <td><?=$this->escapeHtml($goodsValue->getBuyNum());?></td>
                                        <td><?=$this->erpCurrencyFormat($goodsValue->getGoodsAmount());?></td>
                                    </tr>
                                <?php } ?>
                                <tfoot>
                                <tr>
                                    <td colspan="7" class="text-right">
                                        <?php if($this->orderInfo->getShopPaymentCost() > 0) { ?>
                                            + <b><?=$this->translate('支付费用')?>：</b><?=$this->erpCurrencyFormat($this->orderInfo->getShopPaymentCost())?>
                                        <?php } ?>
                                        <?php if($this->orderInfo->getShopExpressCost() > 0) { ?>
                                            + <b><?=$this->translate('快递费用')?>：</b><?=$this->erpCurrencyFormat($this->orderInfo->getShopExpressCost())?>
                                        <?php } ?>
                                        <?php if($this->orderInfo->getShopOrderOtherCost() > 0) { ?>
                                            + <b><?=$this->orderInfo->getShopOrderOtherInfo()?>：</b><?=$this->erpCurrencyFormat($this->orderInfo->getShopOrderOtherCost())?>
                                        <?php } ?>
                                        <?php if($this->orderInfo->getShopOrderDiscountAmount() > 0) { ?>
                                            - <b><?=$this->orderInfo->getShopOrderDiscountInfo()?>：</b><?=$this->erpCurrencyFormat($this->orderInfo->getShopOrderDiscountAmount())?>
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="7" class="text-right"><b><?=$this->translate('销售金额合计')?>：</b><span id="order-amount"><?=$this->erpCurrencyFormat($this->orderInfo->getShopOrderAmount())?></span></td>
                                </tr>
                                </tfoot>
                            </table>
                        </div>

                    </div>

                </div>


            </div>
        </div>

    </section>

</div>