截流自动化的商城平台
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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="content" class="layui-form-label">内容搜索:</label>
  28. <div class="layui-input-inline">
  29. <input type="text" id="content" name="content" 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. <label class="layui-form-label">审核时间:</label>
  45. <div class="layui-input-inline">
  46. <input type="text" class="layui-input time" id="start_time" name="start_time" autocomplete="off">
  47. </div>
  48. <div class="layui-input-inline" style="margin-right: 5px;width: 10px;">
  49. <label class="layui-form-mid">-</label>
  50. </div>
  51. <div class="layui-input-inline">
  52. <input type="text" class="layui-input time" id="end_time" name="end_time" autocomplete="off">
  53. </div>
  54. </div>
  55. <div class="layui-inline">
  56. <a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
  57. <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
  58. </div>
  59. </div>
  60. </div>
  61. <!-- 主体区域 -->
  62. <div class="layui-card-body">
  63. <table id="like-table-lists" lay-filter="like-table-lists"></table>
  64. <script type="text/html" id="table-operation">
  65. {{# if(d.status == 0){ }}
  66. <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="audit">审核</a>
  67. {{# } }}
  68. <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="detail">详情</a>
  69. <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
  70. </script>
  71. <script type="text/html" id="table-image">
  72. {{# layui.each(d.images, function(index, item){ }}
  73. <img src="{{item.image}}" style="height:60px;width: 60px;margin-right: 5px;" class="image-show">
  74. {{# }); }}
  75. </script>
  76. <script type="text/html" id="table-userInfo">
  77. <img src="{{d.avatar}}" alt="图标" style="width:60px;height:60px;margin-right:5px;">
  78. <div class="layui-inline" style="text-align:left;">
  79. <p>编号:{{d.sn}}</p>
  80. <p>昵称:{{d.nickname}}</p>
  81. </div>
  82. </script>
  83. </div>
  84. </div>
  85. </div>
  86. <script>
  87. layui.use(["table", "form", "laydate"], function(){
  88. var table = layui.table;
  89. var form = layui.form;
  90. var laydate = layui.laydate;
  91. laydate.render({
  92. elem: '#start_time'
  93. , type: 'datetime'
  94. });
  95. laydate.render({
  96. elem: '#end_time'
  97. , type: 'datetime'
  98. });
  99. like.tableLists("#like-table-lists", "{:url()}", [
  100. {field:"user", align:"center",width: 240, title:"会员信息", templet: "#table-userInfo"}
  101. ,{field:"content", width: 200,title:"种草内容"}
  102. ,{field:"images", width: 250, align:"left", title:"图片", templet: "#table-image"}
  103. ,{field:"like", width: 100, align:"center", title:"点赞数"}
  104. ,{field:"comment", width: 100, align:"center", title:"评论数"}
  105. ,{field:"status_desc",  width: 120, align:"center", title:"状态"}
  106. ,{field:"create_time", width: 180, align:"center", title:"发布时间"}
  107. ,{title:"操作", align:"left", fixed:"right",width: 220, toolbar:"#table-operation"}
  108. ]);
  109. var active = {
  110. audit: function(obj) {
  111. layer.open({
  112. type: 2
  113. ,title: "文章审核"
  114. ,content: "{:url('community.CommunityArticle/audit')}?id=" + obj.data.id
  115. ,area: ["90%", "90%"]
  116. ,btn: ["确定", "取消"]
  117. ,yes: function(index, layero){
  118. var iframeWindow = window["layui-layer-iframe" + index];
  119. var submit = layero.find("iframe").contents().find("#addSubmit");
  120. iframeWindow.layui.form.on("submit(addSubmit)", function(data){
  121. data.field['id'] = obj.data.id;
  122. like.ajax({
  123. url: "{:url('community.CommunityArticle/audit')}",
  124. data: data.field,
  125. type: "POST",
  126. success:function(res) {
  127. if(res.code === 1) {
  128. layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
  129. layer.close(index);
  130. table.reload("like-table-lists", {
  131. where: {},
  132. page: { cur: 1 }
  133. });
  134. }
  135. }
  136. });
  137. });
  138. submit.trigger("click");
  139. }
  140. });
  141. },
  142. detail: function(obj) {
  143. layer.open({
  144. type: 2
  145. ,title: "详情"
  146. ,content: "{:url('community.CommunityArticle/detail')}?id=" + obj.data.id
  147. ,area: ["90%", "90%"]
  148. ,yes: function(index, layero){
  149. }
  150. });
  151. },
  152. del: function(obj) {
  153. var name = "<div style='width:200px;overflow:hidden;text-overflow: ellipsis;white-space:nowrap;'>" +
  154. "<span>确定删除文章:</span>" +
  155. "<span style='color: red;'>"+obj.data.content +"</span></div>";
  156. layer.confirm(name, function(index) {
  157. like.ajax({
  158. url: "{:url('community.CommunityArticle/del')}",
  159. data: {id: obj.data.id},
  160. type: "POST",
  161. success: function (res) {
  162. if (res.code === 1) {
  163. layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
  164. layer.close(index);
  165. obj.del();
  166. }
  167. }
  168. });
  169. layer.close(index);
  170. })
  171. }
  172. };
  173. like.eventClick(active);
  174. //图片放大
  175. $(document).on('click', '.image-show', function () {
  176. var src = $(this).attr('src');
  177. like.showImg(src,400);
  178. });
  179. form.on("submit(search)", function(data){
  180. table.reload("like-table-lists", {
  181. where: data.field,
  182. page: {
  183. curr: 1
  184. }
  185. });
  186. });
  187. form.on("submit(clear-search)", function(){
  188. $("#keyword").val("");
  189. $("#content").val("");
  190. $("#status").val("");
  191. $("#start_time").val("");
  192. $("#end_time").val("");
  193. form.render("select");
  194. table.reload("like-table-lists", {
  195. where: {},
  196. page: {
  197. curr: 1
  198. }
  199. });
  200. });
  201. })
  202. </script>