ticketList.blade.php 6.4 KB

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