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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 like-layui-collapse" style="border:1px dashed #c4c4c4">
  7. <div class="layui-colla-item">
  8. <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</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="keyword_type" class="layui-form-label">会员信息:</label>
  20. <div class="layui-input-inline">
  21. <select name="keyword_type" id="keyword_type">
  22. <option value="sn">会员编号</option>
  23. <option value="nickname">会员昵称</option>
  24. <option value="mobile">手机号码</option>
  25. </select>
  26. </div>
  27. </div>
  28. <div class="layui-inline">
  29. <div class="layui-input-inline">
  30. <input type="text" name="keyword" autocomplete="off" class="layui-input">
  31. </div>
  32. </div>
  33. <div class="layui-inline">
  34. <a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
  35. <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
  36. </div>
  37. </div>
  38. </div>
  39. <!-- 主体 -->
  40. <div class="layui-tab layui-tab-card" lay-filter="like-tabs">
  41. <ul class="layui-tab-title">
  42. <li data-type="0" class="layui-this">待审核会员列表</li>
  43. <li data-type="1">审核通过会员列表</li>
  44. <li data-type="2">审核拒绝会员列表</li>
  45. </ul>
  46. <div class="layui-tab-content" style="padding: 0 15px;">
  47. <table id="like-table-lists" lay-filter="like-table-lists"></table>
  48. <script type="text/html" id="table-userInfo">
  49. <img src="{{d.user.avatar}}" alt="头像" style="width:60px;height:60px;margin-right:5px;">
  50. <div class="layui-inline" style="text-align:left;">
  51. <p>会员编号:{{d.user.sn}}</p>
  52. <p>会员昵称:{{d.user.nickname}}</p>
  53. <p>会员等级:{{d.user.level.name || '未知'}}</p>
  54. </div>
  55. </script>
  56. <script type="text/html" id="table-operation">
  57. <a class="layui-btn layui-btn-primary layui-btn-sm" lay-event="detail">申请详情</a>
  58. {{# if(d.status === 0){ }}
  59. <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="audit">审核</a>
  60. {{# } }}
  61. </script>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <script>
  67. layui.use(["table", "form", "element", "laydate"], function() {
  68. var table = layui.table;
  69. var form = layui.form;
  70. var element = layui.element;
  71. var laydate = layui.laydate;
  72. like.tableLists("#like-table-lists", "{:url()}", [
  73. {field:"id", width:60, title:"ID"}
  74. ,{field:"user", width:250, title:"会员信息", templet:'#table-userInfo'}
  75. ,{field:"real_name", width:100, align:"center", title:"真实姓名"}
  76. ,{field:"mobile", width:120, align:"center",title:"联系手机"}
  77. ,{field:"region", width:150, align:"center", title:"现住区域"}
  78. ,{field:"reason", width:150, align:"center", title:"申请原因"}
  79. ,{title:"操作", width:230, align:"center", fixed:"right", toolbar:"#table-operation"}
  80. ]);
  81. var active = {
  82. detail: function (obj) {
  83. layer.open({
  84. type: 2
  85. ,title: "申请详情"
  86. ,content: "{:url('distribution.Apply/detail')}?id=" + obj.data.id
  87. ,area: ["600px", "600px"]
  88. });
  89. },
  90. audit: function (obj) {
  91. layer.open({
  92. type: 2
  93. ,title: "审核分销会员申请"
  94. ,content: "{:url('distribution.Apply/audit')}?id=" + obj.data.id
  95. ,area: ["420px", "360px"]
  96. ,btn: ["确定", "取消"]
  97. ,yes: function(index, layero){
  98. var iframeWindow = window["layui-layer-iframe" + index];
  99. var submit = layero.find("iframe").contents().find("#addSubmit");
  100. iframeWindow.layui.form.on("submit(addSubmit)", function(data){
  101. data.field["id"] = obj.data.id;
  102. like.ajax({
  103. url: "{:url('distribution.Apply/audit')}",
  104. data: data.field,
  105. type: "POST",
  106. success:function(res) {
  107. if(res.code === 1) {
  108. layui.layer.msg(res.msg);
  109. layer.close(index);
  110. table.reload("like-table-lists", {
  111. where: {},
  112. page: { cur: 1 }
  113. });
  114. }
  115. }
  116. });
  117. });
  118. submit.trigger("click");
  119. }
  120. });
  121. }
  122. };
  123. like.eventClick(active);
  124. element.on("tab(like-tabs)", function(){
  125. var type = this.getAttribute("data-type");
  126. table.reload("like-table-lists", {
  127. where: {type: type},
  128. page: { cur: 1 }
  129. });
  130. });
  131. /**
  132. * 搜索
  133. */
  134. form.on("submit(search)", function(data){
  135. data.field["type"] = $(".layui-tab-title li.layui-this").attr("lay-id");
  136. table.reload("like-table-lists", {
  137. where: data.field,
  138. page: {
  139. curr: 1
  140. }
  141. });
  142. });
  143. /**
  144. * 清空搜索
  145. */
  146. form.on("submit(clear-search)", function(){
  147. var type = $(".layui-tab-title li.layui-this").attr("lay-id");
  148. $("#keyword_type").val("");
  149. $("#keyword").val("");
  150. form.render("select");
  151. table.reload("like-table-lists", {
  152. where: {type: type},
  153. page: {
  154. curr: 1
  155. }
  156. });
  157. });
  158. });
  159. </script>