ticketList.blade.php 6.2 KB

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