keyword.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. {extend name="public/container"}
  2. {block name="content"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox">
  6. <div class="ibox-title">
  7. <button type="button" class="btn btn-w-m btn-primary" onclick="window.location.href='{:Url('add_keyword')}'">添加关键字</button>
  8. <div class="ibox-tools">
  9. <button class="btn btn-white btn-sm" onclick="location.reload()"><i class="fa fa-refresh"></i> 刷新</button>
  10. </div>
  11. <div style="margin-top: 2rem"></div>
  12. <div class="row">
  13. <div class="m-b m-l">
  14. <form action="" class="form-inline">
  15. <select name="type" aria-controls="editable" class="form-control input-sm">
  16. <option value="">回复类型</option>
  17. <option value="text" {eq name="$where.type" value="text"}selected="selected"{/eq}>文字消息</option>
  18. <option value="image" {eq name="$where.type" value="image"}selected="selected"{/eq}>图片消息</option>
  19. <option value="news" {eq name="$where.type" value="news"}selected="selected"{/eq}>图文消息</option>
  20. <option value="voice" {eq name="$where.type" value="voice"}selected="selected"{/eq}>声音消息</option>
  21. </select>
  22. <div class="input-group">
  23. <input type="text" name="key" value="{$where.key}" placeholder="请输入关键词" class="input-sm form-control"> <span class="input-group-btn">
  24. <button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
  25. </div>
  26. </form>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="ibox-content">
  31. <div class="table-responsive">
  32. <table class="table table-striped table-bordered">
  33. <thead>
  34. <tr>
  35. <!-- <th class="text-center">编号</th>-->
  36. <th class="text-center">关键字</th>
  37. <th class="text-center">回复类型</th>
  38. <th class="text-center">状态</th>
  39. <th class="text-center">操作</th>
  40. </tr>
  41. </thead>
  42. <tbody class="">
  43. {volist name="list" id="vo"}
  44. <tr>
  45. <!-- <td class="text-center">-->
  46. <!-- {$vo.id}-->
  47. <!-- </td>-->
  48. <td class="text-center">
  49. {$vo.key}
  50. </td>
  51. <td class="text-center">
  52. {switch name="$vo['type']" }
  53. {case value="text" break="1"}文字消息{/case}
  54. {case value="voice" break="1"}声音消息{/case}
  55. {case value="image" break="1"}图片消息{/case}
  56. {case value="news" break="1"}图文消息{/case}
  57. {/switch}
  58. </td>
  59. <td class="text-center">
  60. {switch name="$vo['status']" }
  61. {case value="1" break="1"}<i class="fa fa-check text-navy"></i>{/case}
  62. {case value="0" break="1"}<i class="fa fa-close text-danger"></i>{/case}
  63. {/switch}
  64. </td>
  65. <td class="text-right">
  66. <button class="btn btn-info btn-xs" type="button" onclick="window.location.href='{:Url('info_keyword',array('key'=>$vo['key']))}'" ><i class="fa fa-edit"></i> 编辑</button>
  67. <button class="btn btn-danger btn-xs " data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-times"></i> 删除
  68. </button>
  69. </td>
  70. </tr>
  71. {/volist}
  72. </tbody>
  73. </table>
  74. </div>
  75. {include file="public/inner_page"}
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. {/block}
  81. {block name="script"}
  82. <script>
  83. $('.btn-danger').on('click',function(){
  84. window.t = $(this);
  85. var _this = $(this),url =_this.data('url');
  86. $eb.$swal('delete',function(){
  87. $eb.axios.get(url).then(function(res){
  88. console.log(res);
  89. if(res.status == 200 && res.data.code == 200) {
  90. $eb.$swal('success',res.data.msg);
  91. _this.parents('tr').remove();
  92. }else
  93. return Promise.reject(res.data.msg || '删除失败')
  94. }).catch(function(err){
  95. $eb.$swal('error',err);
  96. });
  97. })
  98. });
  99. </script>
  100. {/block}