截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lists.html 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. {layout name="layout1" /}
  2. <style>
  3. </style>
  4. <div class="wrapper">
  5. <div class="layui-card">
  6. <!-- 操作提示 -->
  7. <div class="layui-card-body">
  8. <div class="layui-collapse" style="border:1px dashed #c4c4c4">
  9. <div class="layui-colla-item">
  10. <h2 class="layui-colla-title like-layui-colla-title">操作提示</h2>
  11. <div class="layui-colla-content layui-show">
  12. <p>*可对社区文章评论进行管理审核.</p>
  13. </div>
  14. </div>
  15. </div>
  16. </div>
  17. <!-- 搜索区域 -->
  18. <div class="layui-card-body layui-form">
  19. <div class="layui-form-item">
  20. <div class="layui-inline">
  21. <label for="keyword" class="layui-form-label">会员信息:</label>
  22. <div class="layui-input-inline">
  23. <input type="text" id="keyword" name="keyword" autocomplete="off" class="layui-input" placeholder="请输入昵称/编号/手机号">
  24. </div>
  25. </div>
  26. <div class="layui-inline">
  27. <label for="comment" class="layui-form-label">内容搜索:</label>
  28. <div class="layui-input-inline">
  29. <input type="text" id="comment" name="comment" autocomplete="off" class="layui-input" placeholder="请输入评论内容">
  30. </div>
  31. </div>
  32. <div class="layui-inline">
  33. <label for="status" class="layui-form-label">审核状态:</label>
  34. <div class="layui-input-inline">
  35. <select name="status" id="status">
  36. <option value="">全部</option>
  37. {foreach $status as $item => $val}
  38. <option value="{$item}">{$val}</option>
  39. {/foreach}
  40. </select>
  41. </div>
  42. </div>
  43. <div class="layui-inline">
  44. <a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
  45. <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
  46. </div>
  47. </div>
  48. </div>
  49. <!-- 主体区域 -->
  50. <div class="layui-card-body">
  51. <table id="like-table-lists" lay-filter="like-table-lists"></table>
  52. <script type="text/html" id="table-operation">
  53. {{# if(d.status == 0){ }}
  54. <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="audit">审核</a>
  55. {{# } }}
  56. <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
  57. </script>
  58. <script type="text/html" id="table-userInfo">
  59. <img src="{{d.avatar}}" alt="图标" style="width:60px;height:60px;margin-right:5px;">
  60. <div class="layui-inline" style="text-align:left;">
  61. <p>编号:{{d.sn}}</p>
  62. <p>昵称:{{d.nickname}}</p>
  63. </div>
  64. </script>
  65. <script type="text/html" id="table-articleContent">
  66. <div>{{d.article.content}}</div>
  67. </script>
  68. </div>
  69. </div>
  70. </div>
  71. <script>
  72. layui.use(["table", "form", "laydate"], function(){
  73. var table = layui.table;
  74. var form = layui.form;
  75. var laydate = layui.laydate;
  76. laydate.render({
  77. elem: '#start_time'
  78. , type: 'datetime'
  79. });
  80. laydate.render({
  81. elem: '#end_time'
  82. , type: 'datetime'
  83. });
  84. like.tableLists("#like-table-lists", "{:url()}", [
  85. {field:"user", align:"center",width: 240, title:"会员信息", templet: "#table-userInfo"}
  86. ,{field:"article_content", width: 250,title:"种草内容", templet: "#table-articleContent"}
  87. ,{field:"comment", width: 300,title:"评价内容"}
  88. ,{field:"topic_name", width: 150, align:"center",title:"话题"}
  89. ,{field:"status_desc",  width: 120, align:"center", title:"审核状态"}
  90. ,{field:"create_time", width: 180, align:"center", title:"评论时间"}
  91. ,{title:"操作", align:"left", fixed:"right",width: 160, toolbar:"#table-operation"}
  92. ]);
  93. var active = {
  94. audit: function(obj) {
  95. layer.open({
  96. type: 2
  97. ,title: "评论审核"
  98. ,content: "{:url('community.CommunityComment/audit')}?id=" + obj.data.id
  99. ,area: ["60%", "60%"]
  100. ,btn: ["确定", "取消"]
  101. ,yes: function(index, layero){
  102. var iframeWindow = window["layui-layer-iframe" + index];
  103. var submit = layero.find("iframe").contents().find("#addSubmit");
  104. iframeWindow.layui.form.on("submit(addSubmit)", function(data){
  105. data.field['id'] = obj.data.id;
  106. like.ajax({
  107. url: "{:url('community.CommunityComment/audit')}",
  108. data: data.field,
  109. type: "POST",
  110. success:function(res) {
  111. if(res.code === 1) {
  112. layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
  113. layer.close(index);
  114. table.reload("like-table-lists", {
  115. where: {},
  116. page: { cur: 1 }
  117. });
  118. }
  119. }
  120. });
  121. });
  122. submit.trigger("click");
  123. }
  124. });
  125. },
  126. del: function(obj) {
  127. var comment = "<div style='width:200px;overflow:hidden;text-overflow: ellipsis;white-space:nowrap;'>" +
  128. "<span>确定删除评论:</span>" +
  129. "<span style='color: red;'>"+obj.data.comment +"</span></div>";
  130. layer.confirm(comment, function(index) {
  131. like.ajax({
  132. url: "{:url('community.CommunityComment/del')}",
  133. data: {id: obj.data.id},
  134. type: "POST",
  135. success: function (res) {
  136. if (res.code === 1) {
  137. layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
  138. layer.close(index);
  139. obj.del();
  140. }
  141. }
  142. });
  143. layer.close(index);
  144. })
  145. }
  146. };
  147. like.eventClick(active);
  148. //图片放大
  149. $(document).on('click', '.image-show', function () {
  150. var src = $(this).attr('src');
  151. like.showImg(src,400);
  152. });
  153. form.on("submit(search)", function(data){
  154. table.reload("like-table-lists", {
  155. where: data.field,
  156. page: {
  157. curr: 1
  158. }
  159. });
  160. });
  161. form.on("submit(clear-search)", function(){
  162. $("#keyword").val("");
  163. $("#comment").val("");
  164. $("#status").val("");
  165. form.render("select");
  166. table.reload("like-table-lists", {
  167. where: {},
  168. page: {
  169. curr: 1
  170. }
  171. });
  172. });
  173. })
  174. </script>