order.blade.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. @extends('admin.table_layouts')
  2. @push('css')
  3. <link href="/assets/global/vendor/bootstrap-datepicker/bootstrap-datepicker.min.css" rel="stylesheet">
  4. @endpush
  5. @section('content')
  6. <div class="page-content container-fluid">
  7. <x-admin.table-panel :title="trans('admin.menu.shop.order')" :theads="[
  8. 'id' => '#',
  9. trans('common.account'),
  10. 'sn' => trans('model.order.id'),
  11. trans('model.goods.attribute'),
  12. trans('model.coupon.attribute'),
  13. trans('model.order.original_price'),
  14. trans('model.order.price'),
  15. trans('model.order.pay_way'),
  16. trans('model.order.status'),
  17. 'expired_at' => trans('common.expired_at'),
  18. 'created_at' => trans('common.created_at'),
  19. trans('common.action'),
  20. ]" :count="trans('admin.logs.counts', ['num' => $orders->total()])" :pagination="$orders->links()">
  21. <x-slot:filters>
  22. <x-admin.filter.input class="col-lg-2 col-sm-6" name="username" :placeholder="trans('common.account')" />
  23. <x-admin.filter.input class="col-lg-2 col-sm-6" name="sn" type="number" :placeholder="trans('model.order.id')" />
  24. <x-admin.filter.daterange />
  25. <x-admin.filter.selectpicker class="col-lg-2 col-sm-6" name="is_expire" :title="trans('admin.logs.order.is_expired')" :options="[0 => trans('admin.no'), 1 => trans('admin.yes')]" />
  26. <x-admin.filter.selectpicker class="col-lg-2 col-sm-6" name="is_coupon" :title="trans('admin.logs.order.is_coupon')" :options="[0 => trans('admin.no'), 1 => trans('admin.yes')]" />
  27. <x-admin.filter.selectpicker class="col-lg-2 col-sm-6" name="pay_way" :title="trans('model.order.pay_way')" :options="$paymentLabels" />
  28. <x-admin.filter.selectpicker class="col-lg-2 col-sm-6" name="status" :title="trans('model.order.status')" :options="[
  29. -1 => trans('common.order.status.canceled'),
  30. 0 => trans('common.status.payment_pending'),
  31. 1 => trans('common.order.status.review'),
  32. 2 => trans('common.order.status.completed') . '/' . trans('common.status.expire') . '/' . trans('common.order.status.ongoing'),
  33. 3 => trans('common.order.status.prepaid'),
  34. ]" :multiple="true" />
  35. </x-slot:filters>
  36. <x-slot:tbody>
  37. @foreach ($orders as $order)
  38. <tr>
  39. <td> {{ $order->id }} </td>
  40. <td>
  41. @if (empty($order->user))
  42. 【{{ trans('common.deleted_item', ['attribute' => trans('common.account')]) }}】
  43. @else
  44. @can('admin.user.index')
  45. <a href="{{ route('admin.user.index', ['id' => $order->user->id]) }}" target="_blank">{{ $order->user->username }} </a>
  46. @else
  47. {{ $order->user->username }}
  48. @endcan
  49. @endif
  50. </td>
  51. <td> {{ $order->sn }}</td>
  52. <td> {{ $order->goods->name ?? trans('user.recharge_credit') }} </td>
  53. <td> {{ $order->coupon ? $order->coupon->name . ' - ' . $order->coupon->sn : '' }} </td>
  54. <td> {{ $order->origin_amount_tag }} </td>
  55. <td> {{ $order->amount_tag }} </td>
  56. <td>
  57. {{ $order->pay_way_label }}
  58. </td>
  59. <td>
  60. {!! $order->status_label !!}
  61. </td>
  62. <td> {{ $order->is_expire ? trans('common.status.expire') : $order->expired_at }} </td>
  63. <td> {{ $order->created_at }} </td>
  64. @can(['admin.order.edit'])
  65. <td>
  66. <x-ui.dropdown>
  67. @if ($order->status !== -1)
  68. <x-ui.dropdown-item url="javascript:changeStatus('{{ $order->id }}', -1)" icon="wb-close" :text="trans('admin.set_to', ['attribute' => $order->statusTags(-1, 0, false)])" />
  69. @endif
  70. @if ($order->status !== 2)
  71. <x-ui.dropdown-item url="javascript:changeStatus('{{ $order->id }}', 2)" icon="wb-check" :text="trans('admin.set_to', ['attribute' => $order->statusTags(2, 0, false)])" />
  72. @endif
  73. @if ($order->status !== 3)
  74. <x-ui.dropdown-item url="javascript:changeStatus('{{ $order->id }}', 3)" icon="wb-check-circle" :text="trans('admin.set_to', ['attribute' => $order->statusTags(3, 0, false)])" />
  75. @endif
  76. </x-ui.dropdown>
  77. </td>
  78. @endcan
  79. </tr>
  80. @endforeach
  81. </x-slot:tbody>
  82. </x-admin.table-panel>
  83. </div>
  84. @endsection
  85. @push('javascript')
  86. <script src="/assets/global/vendor/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
  87. @if (app()->getLocale() !== 'en')
  88. <script src="/assets/global/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.{{ str_replace('_', '-', app()->getLocale()) }}.min.js" charset="UTF-8">
  89. </script>
  90. @endif
  91. <script src="/assets/global/js/Plugin/bootstrap-datepicker.js"></script>
  92. <script>
  93. @can('admin.order.edit')
  94. // 重置流量
  95. function changeStatus(id, status) {
  96. ajaxPost('{{ route('admin.order.edit') }}', {
  97. oid: id,
  98. status: status
  99. });
  100. }
  101. @endcan
  102. </script>
  103. @endpush