invoices.blade.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. @extends('user.layouts')
  2. @section('css')
  3. <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" type="text/css" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <div class="page-content container">
  7. <div class="panel">
  8. <div class="panel-heading p-20">
  9. <h1 class="panel-title cyan-600"><i class="icon wb-bookmark"></i>{{trans('home.invoices')}}</h1>
  10. </div>
  11. <div class="panel-body">
  12. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  13. <thead class="thead-default">
  14. <tr>
  15. <th> #</th>
  16. <th> {{trans('home.invoice_table_id')}} </th>
  17. <th> {{trans('home.invoice_table_name')}} </th>
  18. <th> {{trans('home.invoice_table_pay_way')}} </th>
  19. <th> {{trans('home.invoice_table_price')}} </th>
  20. <th> {{trans('home.invoice_table_create_date')}} </th>
  21. <th> {{trans('home.invoice_table_expire_at')}} </th>
  22. <th> {{trans('home.invoice_table_status')}} </th>
  23. <th> {{trans('home.invoice_table_actions')}} </th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. @if($orderList->isEmpty())
  28. <tr>
  29. <td colspan="8">{{trans('home.invoice_table_none')}}</td>
  30. </tr>
  31. @else
  32. @foreach($orderList as $order)
  33. <tr>
  34. <td>{{$loop->iteration}}</td>
  35. <td><a href="/invoice/{{$order->order_sn}}" target="_blank">{{$order->order_sn}}</a>
  36. </td>
  37. <td>{{empty($order->goods) ? trans('home.invoice_table_goods_deleted') : $order->goods->name}}</td>
  38. <td>{{$order->pay_way === 1 ? trans('home.service_pay_button') : trans('home.online_pay')}}</td>
  39. <td>¥{{$order->amount}}</td>
  40. <td>{{$order->created_at}}</td>
  41. <td>{{empty($order->goods) ? '' : $order->goods->type == 3 || $order->status == 3 ? '' : $order->expire_at}}</td>
  42. <td>
  43. @switch($order->status)
  44. @case(-1)
  45. <span class="badge badge-default">{{trans('home.invoice_status_closed')}}</span>
  46. @break
  47. @case(0)
  48. <span class="badge badge-danger">{{trans('home.invoice_status_wait_payment')}}</span>
  49. @break
  50. @case(1)
  51. <span class="badge badge-info">{{trans('home.invoice_status_wait_confirm')}}</span>
  52. @break
  53. @case(2)
  54. @if (!empty($order->goods) && $order->goods->type == 3)
  55. <span class="badge badge-default">{{trans('home.invoice_status_payment_confirm')}}</span>
  56. @else
  57. @if($order->is_expire)
  58. <span class="badge badge-default">{{trans('home.invoice_table_expired')}}</span>
  59. @else
  60. <span class="badge badge-success">{{trans('home.invoice_table_active')}}</span>
  61. @endif
  62. @endif
  63. @break
  64. @case(3)
  65. <span class="badge badge-info">{{trans('home.invoice_table_prepay')}}</span>
  66. @break
  67. @endswitch
  68. <td>
  69. @if($order->status == 0 && !empty($order->payment))
  70. @if(!empty($order->payment->jump_url))
  71. <a href="{{$order->payment->jump_url}}" target="_blank" class="btn btn-primary">{{trans('home.pay')}}</a>
  72. @elseif(!empty($order->payment->sn))
  73. <a href="/payment/{{$order->payment->sn}}" target="_blank" class="btn btn-primary">{{trans('home.pay')}}</a>
  74. @endif
  75. @elseif ($order->status == 3)
  76. <button onclick="activeOrder('{{$order->oid}}')" class="btn btn-success">{{trans('home.invoice_table_start')}}</button>
  77. @endif
  78. </td>
  79. </tr>
  80. @endforeach
  81. @endif
  82. </tbody>
  83. </table>
  84. </div>
  85. <div class="panel-footer">
  86. <div class="row">
  87. <div class="col-12">
  88. <nav class="Page navigation float-right">
  89. {{$orderList->links()}}
  90. </nav>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. @endsection
  97. @section('script')
  98. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js" type="text/javascript"></script>
  99. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js" type="text/javascript"></script>
  100. <script type="text/javascript">
  101. function activeOrder(oid) {
  102. swal.fire({
  103. title: '是否提前激活本套餐?',
  104. html: '套餐激活后:<br>先前套餐将直接失效!<br>过期日期将由本日重新开始计算!',
  105. type: 'warning',
  106. showCancelButton: true,
  107. cancelButtonText: '{{trans('home.ticket_close')}}',
  108. confirmButtonText: '{{trans('home.ticket_confirm')}}',
  109. }).then((result) => {
  110. if (result.value) {
  111. $.ajax({
  112. type: "POST",
  113. url: "/activeOrder",
  114. async: false,
  115. data: {_token: '{{csrf_token()}}', oid: oid},
  116. dataType: 'json',
  117. success: function (ret) {
  118. if (ret.status === 'success') {
  119. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  120. .then(() => window.location.reload())
  121. } else {
  122. swal.fire({title: ret.message, type: 'error'});
  123. }
  124. }
  125. });
  126. }
  127. })
  128. }
  129. </script>
  130. @endsection