invoices.blade.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. @extends('user.layouts')
  2. @section('css')
  3. <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.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('user.menu.invoices') }}</h1>
  10. @if ($prepaidPlan)
  11. <div class="panel-actions">
  12. <button class="btn btn-primary" onclick="closePlan()">
  13. {{ trans('common.active_item', ['attribute' => trans('common.order.status.prepaid')]) }}</button>
  14. </div>
  15. @endif
  16. </div>
  17. <div class="panel-body">
  18. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  19. <thead class="thead-default">
  20. <tr>
  21. <th> #</th>
  22. <th> {{ trans('model.order.id') }} </th>
  23. <th> {{ trans('user.shop.service') }} </th>
  24. <th> {{ trans('user.payment.method') }} </th>
  25. <th> {{ trans('user.invoice.amount') }} </th>
  26. <th> {{ trans('user.bought_at') }} </th>
  27. <th> {{ trans('common.expired_at') }} </th>
  28. <th> {{ trans('common.status.attribute') }} </th>
  29. <th> {{ trans('common.action') }} </th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. @foreach ($orderList as $order)
  34. <tr>
  35. <td>{{ $loop->iteration }}</td>
  36. <td><a href="{{ route('invoice.show', $order->sn) }}" target="_blank">{{ $order->sn }}</a></td>
  37. <td>{{ $order->goods->name ?? trans('user.recharge_credit') }}</td>
  38. <td>{{ $order->pay_way === 1 ? trans('user.shop.pay_credit') : trans('user.shop.pay_online') }}</td>
  39. <td>{{ $order->amount_tag }}</td>
  40. <td>{{ $order->created_at }}</td>
  41. <td>{{ empty($order->goods) || $order->goods_id === null || $order->status === 3 ? '' : $order->expired_at }}</td>
  42. <td>{!! $order->status_label !!}</td>
  43. <td>
  44. <div class="btn-group">
  45. @if ($order->status === 0 && $order->pay_way !== 1)
  46. @if ($order->payment)
  47. @if ($order->payment->qr_code)
  48. <a class="btn btn-primary" href="{{ route('orderDetail', $order->payment->trade_no) }}"
  49. target="_blank">{{ trans('user.pay') }}</a>
  50. @elseif($order->payment->url)
  51. <a class="btn btn-primary" href="{{ $order->payment->url }}" target="_blank">{{ trans('user.pay') }}</a>
  52. @endif
  53. @endif
  54. <button class="btn btn-danger" onclick="closeOrder('{{ $order->id }}')">{{ trans('common.cancel') }}</button>
  55. @elseif ($order->status === 1)
  56. <button class="btn btn-primary" onClick="window.location.reload();">
  57. <i class="icon wb-refresh" aria-hidden="true"></i></button>
  58. @endif
  59. </div>
  60. </td>
  61. </tr>
  62. @endforeach
  63. </tbody>
  64. </table>
  65. </div>
  66. <div class="panel-footer d-flex justify-content-end">
  67. {{ $orderList->links() }}
  68. </div>
  69. </div>
  70. </div>
  71. @endsection
  72. @section('javascript')
  73. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
  74. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
  75. <script>
  76. @if ($prepaidPlan)
  77. function closePlan() {
  78. showConfirm({
  79. title: '{{ trans('user.invoice.active_prepaid_question') }}',
  80. html: `{!! trans('user.invoice.active_prepaid_tips') !!}`,
  81. icon: 'warning',
  82. onConfirm: function() {
  83. ajaxPost('{{ route('invoice.activate') }}');
  84. }
  85. });
  86. }
  87. @endif
  88. function closeOrder(id) {
  89. showConfirm({
  90. title: '{{ trans('common.close_item', ['attribute' => trans('user.invoice.attribute')]) }}?',
  91. icon: 'warning',
  92. onConfirm: function() {
  93. ajaxPut(jsRoute('{{ route('closeOrder', 'PLACEHOLDER') }}', id));
  94. }
  95. });
  96. }
  97. </script>
  98. @endsection