notice.php 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. <script src="{__FRAME_PATH}js/content.min.js"></script>
  4. <script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
  5. {/block}
  6. {block name="content"}
  7. <div class="row">
  8. <div class="col-sm-12">
  9. <div class="ibox">
  10. <div class="ibox-content">
  11. <div class="row">
  12. <div class="col-sm-8 m-b-xs">
  13. <form action="" class="form-inline">
  14. <i class="fa fa-search" style="margin-right: 10px;"></i>
  15. <div class="input-group" style="width: 80%">
  16. <input type="text" name="title" value="{$where.title}" placeholder="请输入通知标题" class="input-sm form-control"> <span class="input-group-btn">
  17. <button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
  18. </div>
  19. </form>
  20. </div>
  21. </div>
  22. <div class="table-responsive">
  23. <table class="table table-striped table-bordered">
  24. <thead>
  25. <tr>
  26. <th class="text-center">编号</th>
  27. <th class="text-center">发送人</th>
  28. <th class="text-center">通知标题</th>
  29. <th class="text-center" width="700">通知内容</th>
  30. <th class="text-center">操作</th>
  31. </tr>
  32. </thead>
  33. <tbody class="">
  34. {volist name="list" id="vo"}
  35. <tr>
  36. <td class="text-center">{$vo.id}</td>
  37. <td class="text-center">{$vo.user}</td>
  38. <td class="text-center">{$vo.title}</td>
  39. <td class="text-center">{$vo.content}</td>
  40. <td class="text-center">
  41. <a class="btn-send" data-url="{:Url('send_user',array('id'=>$vo['id'],'uid'=>$uid))}">立即发送</a>
  42. </td>
  43. </tr>
  44. {/volist}
  45. </tbody>
  46. </table>
  47. </div>
  48. {include file="public/inner_page"}
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. {/block}
  54. {block name="script"}
  55. <script>
  56. $('.btn-send').on('click',function(){
  57. window.t = $(this);
  58. var _this = $(this),url =_this.data('url');
  59. swal({
  60. title: "您确定要发送这条信息给‘{$nickname}’吗?",
  61. text:"发送后将无法修改通知信息,请谨慎操作!",
  62. type: "warning",
  63. showCancelButton: true,
  64. confirmButtonColor: "#DD6B55",
  65. confirmButtonText:"是的,我要发送!",
  66. cancelButtonText:"让我再考虑一下…",
  67. closeOnConfirm: false,
  68. closeOnCancel: false
  69. }).then(function(){
  70. $eb.axios.get(url).then(function(res){
  71. if(res.status == 200 && res.data.code == 200) {
  72. swal(res.data.msg);
  73. _this.parents('tr').remove();
  74. }else
  75. return Promise.reject(res.data.msg || '发送失败')
  76. }).catch(function(err){
  77. swal(err);
  78. });
  79. }).catch(console.log);
  80. });
  81. </script>
  82. {/block}