user.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. {include file="public/frame_head"}
  2. <link href="{__FRAME_PATH}css/plugins/iCheck/custom.css" rel="stylesheet">
  3. <script src="{__PLUG_PATH}moment.js"></script>
  4. <link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
  5. <script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
  6. <script src="{__ADMIN_PATH}frame/js/plugins/iCheck/icheck.min.js"></script>
  7. <div class="row">
  8. <div class="col-sm-12">
  9. {if condition="$notice['is_send'] eq 0 AND $notice['type'] eq 2"}
  10. <div class="ibox-title">
  11. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('user_create',array('id'=>$notice['id']))}')">添加发送用户</button>
  12. <button type="button" class="btn btn-w-m btn-primary select-delete" data-url="{:Url('user_select_delete',array('id'=>$notice['id']))}">选择删除</button>
  13. </div>
  14. {/if}
  15. <div class="ibox-content">
  16. <div class="table-responsive">
  17. <table class="table table-striped table-bordered">
  18. <thead>
  19. <tr>
  20. {if condition="$notice['is_send'] eq 0 AND $notice['type'] eq 2"}<th class="text-center"></th>{/if}
  21. <th class="text-center">编号</th>
  22. <th class="text-center">微信用户名称</th>
  23. <th class="text-center">头像</th>
  24. <th class="text-center">性别</th>
  25. {if condition="$notice['is_send'] eq 1 AND $notice['type'] eq 2"}<th class="text-center">是否查看</th>{/if}
  26. {if condition="$notice['is_send'] eq 0 AND $notice['type'] eq 2"}<th class="text-center">操作</th>{/if}
  27. </tr>
  28. </thead>
  29. <tbody class="">
  30. <form method="post" class="sub-save">
  31. {volist name="list" id="vo"}
  32. <tr>
  33. {if condition="$notice['is_send'] eq 0 AND $notice['type'] eq 2"}
  34. <td class="text-center">
  35. <label class="checkbox-inline i-checks">
  36. <input type="checkbox" name="ids[]" value="{$vo.uid}">
  37. </label>
  38. </td>
  39. {/if}
  40. <td class="text-center">{$vo.uid}</td>
  41. <td class="text-center">{$vo.nickname}</td>
  42. <td class="text-center">
  43. <img src="{$vo.headimgurl}" alt="{$vo.nickname}" title="{$vo.nickname}" style="width:50px;height: 50px;cursor: pointer;" class="head_image" data-image="{$vo.headimgurl}">
  44. </td>
  45. <td class="text-center">
  46. {if condition="$vo['sex'] eq 1"}
  47. {elseif condition="$vo['sex'] eq 2"/}
  48. {else/}
  49. 保密
  50. {/if}
  51. </td>
  52. {if condition="$notice['is_send'] eq 1 AND $notice['type'] eq 2"}
  53. <td class="text-center">
  54. {if condition="$vo['is_see'] eq 1"}
  55. <span style="color:green">是</span>
  56. {else/}
  57. <span style="color:red">否</span>
  58. {/if}
  59. </td>
  60. {/if}
  61. {if condition="$notice['is_send'] eq 0 AND $notice['type'] eq 2"}
  62. <td class="text-center">
  63. <button class="btn btn-warning btn-xs" data-url="{:Url('user_delete',array('id'=>$notice['id'],'uid'=>$vo['uid']))}" type="button"><i class="fa fa-warning"></i> 删除</button>
  64. </td>
  65. {/if}
  66. </tr>
  67. {/volist}
  68. </form>
  69. </tbody>
  70. </table>
  71. </div>
  72. {include file="public/inner_page"}
  73. </div>
  74. </div>
  75. </div>
  76. <script>
  77. $('.i-checks').iCheck({
  78. checkboxClass: 'icheckbox_square-green',
  79. });
  80. $('.btn-warning').on('click',function(){
  81. window.t = $(this);
  82. var _this = $(this),url =_this.data('url');
  83. $eb.$swal('delete',function(){
  84. $eb.axios.get(url).then(function(res){
  85. if(res.status == 200 && res.data.code == 200) {
  86. $eb.$swal('success',res.data.msg);
  87. _this.parents('tr').remove();
  88. }else
  89. return Promise.reject(res.data.msg || '删除失败')
  90. }).catch(function(err){
  91. $eb.$swal('error',err);
  92. });
  93. })
  94. });
  95. $(".select-delete").on("click",function(){
  96. var url = $(this).data('url');
  97. var formData = {checked_menus:[]};
  98. $("input[name='ids[]']:checked").each(function(){
  99. formData.checked_menus.push($(this).val());
  100. });
  101. if(formData.checked_menus.length <= 0){
  102. $eb.message('error',"删除数据不能为空");
  103. return;
  104. }
  105. $eb.$swal('delete',function(){
  106. $eb.axios.post(url,formData).then((res)=>{
  107. if(res.status && res.data.code == 200)
  108. return Promise.resolve(res.data);
  109. else
  110. return Promise.reject(res.data.msg || '删除失败,请稍候再试!');
  111. }).then((res)=>{
  112. $eb.message('success',res.msg || '操作成功!');
  113. $eb.closeModalFrame(window.name);
  114. $("input[name='ids[]']:checked").each(function(){
  115. $(this).parents('tr').remove();
  116. });
  117. }).catch((err)=>{
  118. this.loading=false;
  119. $eb.message('error',err);
  120. });
  121. },{
  122. title:"您确定要删除这些信息吗",
  123. text:"删除后将无法回复信息,请谨慎操作!",
  124. confirm:"是的,我要删除!",
  125. cancel:"让我再考虑一下"
  126. })
  127. });
  128. $('.head_image').on('click',function (e) {
  129. var image = $(this).data('image');
  130. $eb.openImage(image);
  131. });
  132. </script>
  133. {include file="public/inner_footer"}