index.php 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {extend name="public/container"}
  2. {block name="head_top"}{/block}
  3. {block name="content"}
  4. <div class="row">
  5. <div class="col-sm-12">
  6. <div class="ibox">
  7. <div class="ibox-title">
  8. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加客服</button>
  9. </div>
  10. <div class="ibox-content">
  11. <div class="table-responsive">
  12. <table class="table table-striped table-bordered">
  13. <thead>
  14. <tr>
  15. <th class="text-center">编号</th>
  16. <th class="text-center">微信用户名称</th>
  17. <th class="text-center">客服头像</th>
  18. <th class="text-center">客服名称</th>
  19. <th class="text-center">是否显示</th>
  20. <th class="text-center">添加时间</th>
  21. <th class="text-center">操作</th>
  22. </tr>
  23. </thead>
  24. <tbody class="">
  25. {volist name="list" id="vo"}
  26. <tr>
  27. <td class="text-center">{$vo.id}</td>
  28. <td class="text-center">{$vo.wx_name}</td>
  29. <td class="text-center"><img src="{$vo.avatar}" class="head_image" data-image="{$vo.avatar}" width="35" height="35"></td>
  30. <td class="text-center">{$vo.nickname}</td>
  31. <td class="text-center">
  32. <i class="fa {eq name='vo.status' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  33. </td>
  34. <td class="text-center">{$vo.add_time|date='Y-m-d H:i:s'}</td>
  35. <td class="text-center">
  36. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('聊天记录','{:Url('chat_user',array('id'=>$vo['id']))}')"><i class="fa fa-commenting-o"></i> 聊天记录</button>
  37. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')"><i class="fa fa-edit"></i> 编辑</button>
  38. <button class="btn btn-danger btn-xs " data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-times"></i> 删除</button>
  39. </td>
  40. </tr>
  41. {/volist}
  42. </tbody>
  43. </table>
  44. </div>
  45. {include file="public/inner_page"}
  46. </div>
  47. </div>
  48. </div>
  49. {/block}
  50. {block name="script"}
  51. <script>
  52. $('.btn-danger').on('click',function(){
  53. window.t = $(this);
  54. var _this = $(this),url =_this.data('url');
  55. $eb.$swal('delete',function(){
  56. $eb.axios.get(url).then(function(res){
  57. console.log(res);
  58. if(res.status == 200 && res.data.code == 200) {
  59. $eb.$swal('success',res.data.msg);
  60. _this.parents('tr').remove();
  61. }else
  62. return Promise.reject(res.data.msg || '删除失败')
  63. }).catch(function(err){
  64. $eb.$swal('error',err);
  65. });
  66. })
  67. });
  68. $('.head_image').on('click',function (e) {
  69. var image = $(this).data('image');
  70. $eb.openImage(image);
  71. })
  72. </script>
  73. </div>
  74. {/block}