stair.php 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. {extend name="public/container"}
  2. {block name="content"}
  3. <div class="layui-fluid">
  4. <div class="layui-row layui-col-space15" id="app" v-cloak="">
  5. <!--搜索条件-->
  6. <div class="layui-col-md12">
  7. <div class="layui-card">
  8. <div class="layui-card-header">搜索条件</div>
  9. <div class="layui-card-body">
  10. <div class="layui-carousel layadmin-carousel layadmin-shortcut" lay-anim="" lay-indicator="inside" lay-arrow="none" style="background:none">
  11. <div class="layui-card-body">
  12. <div class="layui-row layui-col-space10 layui-form-item">
  13. <div class="layui-col-lg12">
  14. <label class="layui-form-label">时间选择:</label>
  15. <div class="layui-input-block" data-type="data" v-cloak="">
  16. <button class="layui-btn layui-btn-sm" type="button" v-for="item in dataList" @click="setData(item)" :class="{'layui-btn-primary':where.data!=item.value}">{{item.name}}</button>
  17. <button class="layui-btn layui-btn-sm" type="button" ref="time" @click="setData({value:'zd',is_zd:true})" :class="{'layui-btn-primary':where.data!='zd'}">自定义</button>
  18. <button type="button" class="layui-btn layui-btn-sm layui-btn-primary" v-show="showtime==true" ref="date_time">{$year.0} - {$year.1}</button>
  19. </div>
  20. </div>
  21. <div class="layui-col-lg12">
  22. <label class="layui-form-label">用户类型:</label>
  23. <div class="layui-input-block" v-cloak="">
  24. <button class="layui-btn layui-btn-sm" :class="{'layui-btn-primary':where.type!=item.value}" @click="where.type = item.value" type="button" v-for="item in spread_type">{{item.name}}
  25. <span v-if="item.count!=undefined" class="layui-badge layui-bg-gray">{{item.count}}</span></button>
  26. </div>
  27. </div>
  28. <div class="layui-col-lg12">
  29. <label class="layui-form-label">用户昵称:</label>
  30. <div class="layui-input-block">
  31. <input type="text" name="nickname" style="width: 50%" v-model="where.nickname" placeholder="请输入姓名、电话、UID" class="layui-input">
  32. </div>
  33. </div>
  34. <div class="layui-col-lg12">
  35. <div class="layui-input-block">
  36. <button @click="search" type="button" class="layui-btn layui-btn-sm layui-btn-normal">
  37. <i class="layui-icon layui-icon-search"></i>搜索</button>
  38. <button @click="refresh" type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
  39. <i class="layui-icon layui-icon-refresh" ></i>刷新</button>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <!--end-->
  49. <!-- 中间详细信息-->
  50. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col +' layui-col-xs'+item.col:'layui-col-sm4 layui-col-md3'" v-for="item in badge" v-cloak="" v-if="item.count > 0">
  51. <div class="layui-card">
  52. <div class="layui-card-header">
  53. {{item.name}}
  54. <span class="layui-badge layuiadmin-badge" :class="item.background_color">{{item.field}}</span>
  55. </div>
  56. <div class="layui-card-body">
  57. <p class="layuiadmin-big-font">{{item.count}}</p>
  58. <p v-show="item.content!=undefined">
  59. {{item.content}}
  60. <span class="layuiadmin-span-color">{{item.sum}}<i :class="item.class"></i></span>
  61. </p>
  62. </div>
  63. </div>
  64. </div>
  65. <!--enb-->
  66. </div>
  67. <div class="layui-row layui-col-space15">
  68. <div class="layui-col-md12">
  69. <div class="layui-card">
  70. <div class="layui-card-header">分销员列表</div>
  71. <div class="layui-card-body">
  72. <div class="layui-btn-container">
  73. <!-- <div class="layui-btn-group conrelTable">-->
  74. <!-- <button class="layui-btn layui-btn-sm layui-btn-normal" type="button" data-type="refresh"><i class="layui-icon layui-icon-refresh" ></i>刷新</button>-->
  75. <!-- </div>-->
  76. </div>
  77. <table class="layui-hide" id="userList" lay-filter="userList"></table>
  78. <script type="text/html" id="avatar">
  79. <img style="cursor: pointer" lay-event='open_image' src="{{d.avatar}}">
  80. </script>
  81. <!--用户信息-->
  82. <script type="text/html" id="userinfo">
  83. 昵称:{{d.nickname==null ? '暂无信息':d.nickname}}
  84. <br>姓名:{{d.real_name==null ? '暂无信息':d.real_name}}
  85. <br>电话:{{d.phone==null ? '暂无信息':d.phone}}
  86. </script>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  93. {/block}
  94. {block name="script"}
  95. <script>
  96. var action={
  97. refresh:function () {
  98. layList.reload();
  99. }
  100. },uid = {$uid};
  101. layList.form.render();
  102. layList.tableList('userList',"{:Url('get_stair_list',['uid'=>$uid])}",function () {
  103. return [
  104. {field: 'uid', title: 'UID',width:'10%'},
  105. {field: 'avatar', title: '头像',templet:'#avatar'},
  106. {field: 'real_name', title: '用户信息',templet:'#userinfo',width:'22%'},
  107. {field: 'promoter_name', title: '是否推广员'},
  108. {field: 'spread_count', title: '推广人数',sort: true},
  109. {field: 'order_count', title: '订单数',sort: true},
  110. {field: 'add_time', title: '关注时间',width:'10%',sort: true},
  111. ];
  112. });
  113. layList.date({elem: '#start_time', theme: '#393D49', type: 'datetime'});
  114. layList.date({elem: '#end_time', theme: '#393D49', type: 'datetime'});
  115. layList.search('search',function(where){
  116. if(where.start_time!='' && where.end_time=='') return layList.msg('请选择结束时间');
  117. if(where.end_time!='' && where.start_time=='') return layList.msg('请选择开始时间');
  118. layList.reload(where,true);
  119. });
  120. $('.conrelTable').find('button').each(function () {
  121. var type=$(this).data('type');
  122. $(this).on('click',function () {
  123. action[type] && action[type]();
  124. })
  125. })
  126. require(['vue'],function(Vue) {
  127. new Vue({
  128. el: "#app",
  129. data: {
  130. badge: [],
  131. dataList: [
  132. {name: '全部', value: ''},
  133. {name: '昨天', value: 'yesterday'},
  134. {name: '今天', value: 'today'},
  135. {name: '最近7天', value: 'lately7'},
  136. {name: '最近30天', value: 'lately30'},
  137. {name: '本月', value: 'month'},
  138. {name: '本年', value: 'year'},
  139. ],
  140. spread_type:[
  141. {name:'全部',value:''},
  142. {name:'一级推广人',value:'1'},
  143. {name:'二级推广人',value:'2'},
  144. ],
  145. where:{
  146. data:'',
  147. nickname: '',
  148. type:'',
  149. uid:uid
  150. },
  151. showtime: false,
  152. },
  153. watch:{
  154. },
  155. methods:{
  156. getBadge:function(){
  157. var that=this;
  158. layList.baseGet(layList.Url({a:'get_stair_badge',q:that.where}),function (rem) {
  159. that.badge=rem.data;
  160. });
  161. },
  162. setData:function(item){
  163. var that=this;
  164. if(item.is_zd==true){
  165. that.showtime=true;
  166. this.where.data=this.$refs.date_time.innerText;
  167. }else{
  168. this.showtime=false;
  169. this.where.data=item.value;
  170. }
  171. },
  172. search:function () {
  173. this.where.excel=0;
  174. this.getBadge();
  175. layList.reload(this.where,true);
  176. },
  177. refresh:function () {
  178. layList.reload();
  179. this.getBadge();
  180. }
  181. },
  182. mounted:function () {
  183. that = this;
  184. this.getBadge();
  185. layList.laydate.render({
  186. elem:this.$refs.date_time,
  187. trigger:'click',
  188. eventElem:this.$refs.time,
  189. range:true,
  190. change:function (value){
  191. that.where.data=value;
  192. }
  193. });
  194. }
  195. })
  196. });
  197. </script>
  198. {/block}