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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. {layout name="layout1" /}
  2. <div class="wrapper">
  3. <div class="layui-card">
  4. <!-- 操作提示 -->
  5. <div class="layui-card-body">
  6. <div class="layui-collapse" style="border:1px dashed #c4c4c4">
  7. <div class="layui-colla-item">
  8. <h2 class="layui-colla-title like-layui-colla-title">操作提示</h2>
  9. <div class="layui-colla-content layui-show">
  10. <p>*商家提交需要参与拼团活动的商品,平台审核通过之后即可参与拼团活动。</p>
  11. </div>
  12. </div>
  13. </div>
  14. </div>
  15. <!-- 搜索区域 -->
  16. <div class="layui-card-body layui-form">
  17. <div class="layui-form-item">
  18. <div class="layui-inline">
  19. <label for="shop" class="layui-form-label">商家信息:</label>
  20. <div class="layui-inline" style="margin-right:0;">
  21. <div class="layui-input-inline" >
  22. <input type="text" id="shop" name="shop" placeholder="商家编号/商家名称" autocomplete="off" class="layui-input">
  23. </div>
  24. </div>
  25. </div>
  26. <div class="layui-inline">
  27. <label for="name" class="layui-form-label">商品名称:</label>
  28. <div class="layui-inline" style="margin-right:0;">
  29. <div class="layui-input-inline" >
  30. <input type="text" id="name" name="name" autocomplete="off" class="layui-input">
  31. </div>
  32. </div>
  33. </div>
  34. <div class="layui-inline">
  35. <label for="status" class="layui-form-label">活动状态:</label>
  36. <div class="layui-inline" style="margin-right:0;">
  37. <div class="layui-input-inline" >
  38. <select id="status" name="status">
  39. <option value="">全选</option>
  40. <option value="1">活动中</option>
  41. <option value="2">已停止</option>
  42. </select>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="layui-inline">
  47. <label for="datetime" class="layui-form-label">活动时间:</label>
  48. <div class="layui-inline" style="margin-right:0;">
  49. <div class="layui-input-inline" >
  50. <input type="text" id="datetime" name="datetime" autocomplete="off" class="layui-input">
  51. </div>
  52. </div>
  53. </div>
  54. <div class="layui-inline">
  55. <a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
  56. <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
  57. </div>
  58. </div>
  59. </div>
  60. <!-- 主体区域 -->
  61. <div class="layui-card-body">
  62. <div class="layui-tab layui-tab-card" lay-filter="like-tab">
  63. <ul class="layui-tab-title">
  64. <li lay-id="0" class="layui-this">全部商品({$statistics.total})</li>
  65. <li lay-id="1">待审核商品({$statistics.stayAudit})</li>
  66. <li lay-id="2">审核通过商品({$statistics.adoptAudit})</li>
  67. <li lay-id="3">审核拒绝商品({$statistics.refuseAudit})</li>
  68. </ul>
  69. <div class="layui-tab-content" style="padding:20px;">
  70. <table id="like-table-lists" lay-filter="like-table-lists"></table>
  71. <script type="text/html" id="table-shop">
  72. <img src="{{d.logo}}" alt="图" style="width:50px;height:50px;">
  73. <div class="layui-inline">
  74. <p>商家编号:{{d.shop_id}}</p>
  75. <p>商家名称:{{d.shop_name}}</p>
  76. <p>商家类型:{{d.shop_type}}</p>
  77. </div>
  78. </script>
  79. <script type="text/html" id="table-goods">
  80. <img src="{{d.goods.image}}" alt="图" style="width:50px;height:50px;">
  81. <div class="layui-inline">{{d.goods.name}}</div>
  82. </script>
  83. <script type="text/html" id="table-teamAmount">
  84. {{d.team_min_price}} ~ {{d.team_max_price}}
  85. </script>
  86. <script type="text/html" id="table-teamData">
  87. <p>拼团数量:{{d.team_count}}个</p>
  88. <p>成团数量:{{d.success_found}}个</p>
  89. <p>参团人数:{{d.join_found}}人</p>
  90. </script>
  91. <script type="text/html" id="table-teamTime">
  92. {{d.activity_start_time}} ~ {{d.activity_end_time}}
  93. </script>
  94. <script type="text/html" id="table-operation">
  95. <a class="layui-btn layui-btn-sm layui-btn-primary" lay-event="detail">详情</a>
  96. <a class="layui-btn layui-btn-sm layui-btn-primary" lay-event="record">拼团记录</a>
  97. {{# if(d.audit == 0){ }}
  98. <a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="audit">审核</a>
  99. {{# } }}
  100. {{# if(d.audit == 1){ }}
  101. <a class="layui-btn layui-btn-sm layui-btn-danger" lay-event="violation">违规重审</a>
  102. {{# } }}
  103. </script>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <script>
  110. layui.use(["table", "form", "element", "laydate"], function(){
  111. var table = layui.table;
  112. var form = layui.form;
  113. var element = layui.element;
  114. var laydate = layui.laydate;
  115. laydate.render({elem:"#datetime", range: true, trigger:"click"});
  116. like.tableLists("#like-table-lists", "{:url()}", [
  117. {field:"shop", width:250, title:"商家信息", templet:"#table-shop"}
  118. ,{field:"goodsInfo", width:250, title:"商品", templet:"#table-goods"}
  119. ,{field:"teamAmount", width:180, align:"center",title:"拼团价", templet:"#table-teamAmount"}
  120. ,{field:"teamData", width:180, title:"拼团数据", templet:"#table-teamData"}
  121. ,{field:"activityTime", width:280, align:"center", title:"活动时间", templet:"#table-teamTime"}
  122. ,{field:"status_text", width:90, align:"center", title:"活动状态"}
  123. ,{field:"audit_text", width:90, align:"center", title:"审核状态"}
  124. ,{field:"explain", width:200, align:"center", title:"审核说明"}
  125. ,{title:"操作", width:250, align:"center", fixed:"right", toolbar:"#table-operation"}
  126. ]);
  127. var active = {
  128. audit: function(obj) {
  129. layer.open({
  130. type: 2
  131. ,title: "审核"
  132. ,content: "{:url('team.Activity/audit')}?id="+obj.data.id
  133. ,area: ["500px", "400px"]
  134. ,btn: ["确定", "取消"]
  135. ,yes: function(index, layero){
  136. var iframeWindow = window["layui-layer-iframe" + index];
  137. var submit = layero.find("iframe").contents().find("#addSubmit");
  138. iframeWindow.layui.form.on("submit(addSubmit)", function(data){
  139. data.field['id'] = obj.data.id;
  140. like.ajax({
  141. url: "{:url('team.Activity/audit')}",
  142. data: data.field,
  143. type: "POST",
  144. success:function(res) {
  145. if(res.code === 1) {
  146. var type = $(".layui-tab-title li.layui-this").attr("lay-id");
  147. active.statistics();
  148. layui.layer.msg(res.msg);
  149. layer.close(index);
  150. table.reload("like-table-lists", {
  151. where: {type: type},
  152. page: { cur: 1 }
  153. });
  154. }
  155. }
  156. });
  157. });
  158. submit.trigger("click");
  159. }
  160. });
  161. },
  162. violation: function (obj) {
  163. layer.confirm("违规重审会将拼团中的团设置为拼团失败,请谨慎处理。", function(index) {
  164. like.ajax({
  165. url: "{:url('team.Activity/violation')}",
  166. data: {id: obj.data.id},
  167. type: "POST",
  168. success: function (res) {
  169. if (res.code === 1) {
  170. layui.layer.msg(res.msg);
  171. layer.close(index);
  172. var type = $(".layui-tab-title li.layui-this").attr("lay-id");
  173. active.statistics();
  174. table.reload('like-table-lists', {
  175. where: {type: type},
  176. page: {cur: 1}
  177. })
  178. }
  179. }
  180. });
  181. layer.close(index);
  182. })
  183. },
  184. detail: function (obj) {
  185. layer.open({
  186. type: 2
  187. ,title: "拼团商品详情"
  188. ,content: "{:url('team.Activity/details')}?id="+obj.data.id
  189. ,area: ["60%", "80%"]
  190. });
  191. },
  192. record: function (obj) {
  193. layer.open({
  194. type: 2
  195. ,title: "拼团记录("+obj.data.shop_name+")"
  196. ,content: "{:url('team.Activity/record')}?id="+obj.data.id+"&shop_id="+obj.data.shop_id
  197. ,area: ["90%", "90%"]
  198. });
  199. },
  200. statistics: function () {
  201. like.ajax({
  202. url: "{:url('team.Activity/statistics')}",
  203. data: {},
  204. type: "GET",
  205. success:function(res) {
  206. if(res.code === 1) {
  207. $(".layui-tab-title li[lay-id=0]").html("全部商品("+res.data.total+")");
  208. $(".layui-tab-title li[lay-id=1]").html("待审核商品("+res.data.stayAudit+")");
  209. $(".layui-tab-title li[lay-id=2]").html("审核通过商品("+res.data.adoptAudit+")");
  210. $(".layui-tab-title li[lay-id=3]").html("审核拒绝商品("+res.data.refuseAudit+")");
  211. }
  212. }
  213. });
  214. }
  215. };
  216. like.eventClick(active);
  217. element.on("tab(like-tab)", function(){
  218. var type = this.getAttribute("lay-id");
  219. table.reload("like-table-lists", {
  220. where: {type: type},
  221. page: {
  222. curr: 1
  223. }
  224. });
  225. });
  226. form.on("submit(search)", function(data){
  227. table.reload("like-table-lists", {
  228. where: data.field,
  229. page: {
  230. curr: 1
  231. }
  232. });
  233. });
  234. form.on("submit(clear-search)", function(){
  235. $("#shop").val("");
  236. $("#name").val("");
  237. $("#datetime").val("");
  238. $("#status").val("");
  239. table.reload("like-table-lists", {
  240. where: {},
  241. page: {
  242. curr: 1
  243. }
  244. });
  245. });
  246. })
  247. </script>