@extends('admin.master')

@section('top')
  <div class="top-breadcrumb pull-left">
    <h5>查看订单</h5>
    <a class="btn btn-xs btn-default goback" onclick="javascript:history.go(-1);">
      <i class="iconfont icon-back-copy"></i><span>返回</span>
    </a>
  </div>
@endsection

@section('content')
  {!! Form::model($data, ['route' => ['admin.order.update', $data->id], 'method'=>'put', 'class'=>'form-horizontal form-detail']) !!}
  <div class="tab-content">
    <div role="tabpanel" class="tab-pane active">
      <div class="form-group">
        <label class="col-sm-2 control-label label-width">用户名称：</label>
        <div class="col-sm-5 pt-7">
          {{ $data->member->username }}
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label label-width">订单号：</label>
        <div class="col-sm-5 pt-7">
          {{ $data->order_id }}
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label label-width">订单信息：</label>
        <div class="col-sm-10">
          @foreach ($data->list as $val)
            <p style="line-height: 60px;">
              <a href="{{ url('product/'.$val->product->slug.'.html') }}" target="_blank"><img src="{{ url($val->img) }}" width="60" class="mr-10">{{ $val->title }}</a>
              <span class="pl-10">￥{{ $val->price }} x {{ $val->num }}</span>
            </p>
          @endforeach
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label label-width">下单时间：</label>
        <div class="col-sm-5 pt-7">
          {{ $data->created_at }}
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label label-width">支付方式：</label>
        <div class="col-sm-5 pt-7">
          @if ($data->order_status == 1)
            <span class="changeblue">货到付款</span>
          @else
            @if ($data->status == 0)
              <span class="changegray">未付款</span>
            @else
              <span class="changegreen">已付款</span>
            @endif
          @endif
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label label-width">收货人信息：</label>
        <div class="col-sm-10 pt-7">
          <span class="pr-10">联系人：{{ $data->receive_name }}</span>
          <span class="pr-10">联系方式：{{ $data->receive_phone }}</span>
          <span>收货地址：{{ $data->receive_address }}</span>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label label-width">付款信息：</label>
        <div class="col-sm-10 pt-7">
          实际付款：￥ <span class="text-warning">{{ $data->total_fee }}</span>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label label-width">配送方式：</label>
        <div class="col-sm-2">
          {!! Form::select("express_id", ['' => '请选择'] + $express, null, ['class'=>'form-control']) !!}
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label label-width">快递单号：</label>
        <div class="col-sm-2">
          {!! Form::text("express_order", null, ['class'=>'form-control']) !!}
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label label-width">订单状态：</label>
        <div class="col-sm-5">
          <div class="pretty-box">
            <div class="pretty p-default p-round">
              {!! Form::radio('status', 1, null) !!}
              <div class="state p-success-o"><label>待发货</label></div>
            </div>
            <div class="pretty p-default p-round">
              {!! Form::radio('status', 2, null) !!}
              <div class="state p-success-o"><label>已发货</label></div>
            </div>
            <div class="pretty p-default p-round">
              {!! Form::radio('status', 3, null) !!}
              <div class="state p-success-o"><label>已完结</label></div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label label-width"></label>
      <div class="col-sm-5">
        {!! Form::submit('提交', ['class'=>'btn btn-primary']) !!}
      </div>
    </div>
  </div>
  {!! Form::close() !!}
@endsection