ticketList.blade.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. @extends('user.layouts')
  2. @section('css')
  3. <link href="/assets/global/fonts/themify/themify.min.css" type="text/css" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <div class="page-content container-fluid">
  7. <div class="row">
  8. <div class="col-lg-8 order-lg-1 order-2">
  9. <div class="panel panel-bordered">
  10. <div class="panel-heading p-20">
  11. <h1 class="panel-title cyan-600">
  12. <i class="icon wb-user-circle"></i>{{trans('home.ticket_title')}}
  13. </h1>
  14. <div class="panel-actions">
  15. <button class="btn btn-primary btn-animate btn-animate-side" data-toggle="modal" data-target="#add_ticket_modal">
  16. <span>
  17. <i class="icon wb-plus" aria-hidden="true"></i> {{trans('home.ticket_table_new_button')}}
  18. </span>
  19. </button>
  20. </div>
  21. </div>
  22. <div class="panel-body">
  23. <div class="table-responsive">
  24. <table class="table table-hover text-center">
  25. <thead class="thead-default">
  26. <tr>
  27. <th data-cell-style="cellStyle"> #</th>
  28. <th> {{trans('home.ticket_table_title')}} </th>
  29. <th> {{trans('home.ticket_table_status')}} </th>
  30. <th></th>
  31. </tr>
  32. </thead>
  33. <tbody>
  34. @foreach($ticketList as $ticket)
  35. <tr>
  36. <td>{{$ticket->id}}</td>
  37. <td>{{$ticket->title}}</td>
  38. <td>{!!$ticket->status_label!!}</td>
  39. <td>
  40. <a href="{{route('replyTicket', ['id' => $ticket->id])}}" class="btn btn-animate btn-animate-vertical btn-outline-info">
  41. <span>
  42. @if($ticket->status === 2)
  43. <i class="icon wb-eye" aria-hidden="true" style="left: 40%"> </i>{{trans('home.ticket_table_view')}}
  44. @else
  45. <i class="icon wb-check" aria-hidden="true" style="left: 40%"> </i>{{trans('home.ticket_open')}}
  46. @endif
  47. </span>
  48. </a>
  49. </td>
  50. </tr>
  51. @endforeach
  52. </tbody>
  53. </table>
  54. </div>
  55. </div>
  56. <div class="panel-footer">
  57. <div class="row">
  58. <div class="col-md-12">
  59. <nav class="Page navigation float-right">
  60. {{$ticketList->links()}}
  61. </nav>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="col-lg-4 order-lg-2 order-1">
  68. <div class="panel panel-bordered">
  69. <div class="panel-heading p-20">
  70. <h3 class="panel-title cyan-600"><i class="icon ti-headphone-alt"></i>客服工作时间</h3>
  71. </div>
  72. <div class="panel-body pt-0">
  73. <ul class="list-group list-group-dividered list-group-full vertical-align-middle">
  74. <li class="list-group-item">
  75. <div class="row">
  76. <div class="col-lg-5 col-4">
  77. <button class="btn btn-pure ti-time blue-700"></button>
  78. 在线时间
  79. </div>
  80. <div class="col-lg-7 col-8 text-right">
  81. 周一至周五 23:00 - 次日 11:00
  82. <br>
  83. 周末 21:00 - 次日 12:00
  84. </div>
  85. </div>
  86. </li>
  87. <li class="list-group-item">
  88. <div class="row">
  89. <div class="col-2">
  90. <button class="btn btn-pure ti-info-alt red-700"></button>
  91. </div>
  92. <div class="col-10">
  93. 本站有多种联系方式,请使用其中<code>一种</code>联系客服!
  94. <br>重复请求,将会自动延迟处理时间
  95. </div>
  96. </div>
  97. </li>
  98. </ul>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. <div id="add_ticket_modal" class="modal fade" tabindex="-1" data-focus-on="input:first" data-keyboard="false">
  105. <div class="modal-dialog modal-simple modal-center">
  106. <div class="modal-content">
  107. <div class="modal-header">
  108. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  109. <span aria-hidden="true">×</span>
  110. </button>
  111. <h4 class="modal-title"> {{trans('home.ticket_table_new_button')}} </h4>
  112. </div>
  113. <div class="modal-body">
  114. <div class="row">
  115. <div class="col-xl-12 form-group">
  116. <input type="text" class="form-control" name="title" id="title" placeholder="{{trans('home.ticket_table_new_title')}}">
  117. </div>
  118. <div class="col-xl-12 form-group">
  119. <textarea class="form-control" rows="5" name="content" id="content" placeholder="{{trans('home.ticket_table_content')}}"></textarea>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="modal-footer">
  124. <button type="button" data-dismiss="modal" class="btn btn-danger"> {{trans('home.ticket_cancel')}} </button>
  125. <button type="button" data-dismiss="modal" class="btn btn-success" onclick="createTicket()"> {{trans('home.ticket_confirm')}} </button>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. @endsection
  131. @section('script')
  132. <script type="text/javascript">
  133. // 发起工单
  134. function createTicket() {
  135. const title = $('#title').val();
  136. const content = $('#content').val();
  137. if (title.trim() === '') {
  138. swal.fire({title: '您未填写工单标题!', icon: 'warning'});
  139. return false;
  140. }
  141. if (content.trim() === '') {
  142. swal.fire({title: '您未填写工单内容!', icon: 'warning'});
  143. return false;
  144. }
  145. swal.fire({
  146. title: '确定提交工单?',
  147. icon: 'question',
  148. showCancelButton: true,
  149. cancelButtonText: '{{trans('home.ticket_close')}}',
  150. confirmButtonText: '{{trans('home.ticket_confirm')}}',
  151. }).then((result) => {
  152. if (result.value) {
  153. $.post('{{route('openTicket')}}', {
  154. _token: '{{csrf_token()}}',
  155. title: title,
  156. content: content,
  157. }, function(ret) {
  158. if (ret.status === 'success') {
  159. swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
  160. }
  161. else {
  162. swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
  163. }
  164. });
  165. }
  166. });
  167. }
  168. </script>
  169. @endsection