index.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. <style>
  4. </style>
  5. {/block}
  6. {block name="content"}
  7. <div class="layui-fluid">
  8. <div class="layui-row layui-col-space15" id="app">
  9. <!--搜索条件-->
  10. <div class="layui-col-md12">
  11. <div class="layui-card">
  12. <div class="layui-card-header">搜索条件</div>
  13. <div class="layui-card-body">
  14. <div class="layui-carousel layadmin-carousel layadmin-shortcut" lay-anim="" lay-indicator="inside" lay-arrow="none" style="background:none">
  15. <div class="layui-card-body">
  16. <div class="layui-row layui-col-space10 layui-form-item">
  17. <div class="layui-col-lg12">
  18. <label class="layui-form-label">时间选择:</label>
  19. <div class="layui-input-block" data-type="data" v-cloak="">
  20. <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>
  21. <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>
  22. <button type="button" class="layui-btn layui-btn-sm layui-btn-primary" v-show="showtime==true" ref="date_time">{$year.0} - {$year.1}</button>
  23. </div>
  24. </div>
  25. <div class="layui-col-lg12">
  26. <label class="layui-form-label">支付类型:</label>
  27. <div class="layui-input-block" v-cloak="">
  28. <button class="layui-btn layui-btn-sm" :class="{'layui-btn-primary':where.paid !== item.value}" @click="where.paid = item.value" type="button" v-for="item in paidStatus">{{item.name}}
  29. <span v-if="item.count!=undefined" class="layui-badge layui-bg-gray">{{item.count}}</span></button>
  30. </div>
  31. </div>
  32. <div class="layui-col-lg12">
  33. <label class="layui-form-label">用户昵称:</label>
  34. <div class="layui-input-block">
  35. <input type="text" name="nickname" style="width: 50%" v-model="where.nickname" placeholder="请输入姓名、电话、UID" class="layui-input">
  36. </div>
  37. </div>
  38. <div class="layui-col-lg12">
  39. <div class="layui-input-block">
  40. <button @click="search" type="button" class="layui-btn layui-btn-sm layui-btn-normal">
  41. <i class="layui-icon layui-icon-search"></i>搜索</button>
  42. <button @click="excel" type="button" class="layui-btn layui-btn-warm layui-btn-sm export" type="button">
  43. <i class="fa fa-floppy-o" style="margin-right: 3px;"></i>导出</button>
  44. <button @click="refresh" type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
  45. <i class="layui-icon layui-icon-refresh" ></i>刷新</button>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <!--end-->
  55. <!-- 中间详细信息-->
  56. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'" v-for="item in badge" v-cloak="" v-if="item.count > 0">
  57. <div class="layui-card">
  58. <div class="layui-card-header">
  59. {{item.name}}
  60. <span class="layui-badge layuiadmin-badge" :class="item.background_color">{{item.field}}</span>
  61. </div>
  62. <div class="layui-card-body">
  63. <p class="layuiadmin-big-font">{{item.count}}</p>
  64. <p v-show="item.content!=undefined">
  65. {{item.content}}
  66. <span class="layuiadmin-span-color">{{item.sum}}<i :class="item.class"></i></span>
  67. </p>
  68. </div>
  69. </div>
  70. </div>
  71. <!--enb-->
  72. </div>
  73. <div class="layui-row layui-col-space15">
  74. <div class="layui-col-md12">
  75. <div class="layui-card">
  76. <div class="layui-card-header">充值记录列表</div>
  77. <div class="layui-card-body">
  78. <table class="layui-hide" id="userList" lay-filter="userList"></table>
  79. <script type="text/html" id="avatar">
  80. <img style="cursor: pointer" lay-event='open_image' src="{{d.avatar}}">
  81. </script>
  82. <script type="text/html" id="act">
  83. {{# if(d.paid && parseFloat(d.refund_price) <= 0) { }}
  84. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='refund'>退款</button>
  85. {{# }else if(d.paid == 0){ }}
  86. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delect'>删除</button>
  87. {{# }else{ }}
  88. <button type="button" class="layui-btn layui-btn-xs layui-btn-disabled">暂无操作</button>
  89. {{# } }}
  90. </script>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  97. {/block}
  98. {block name="script"}
  99. <script>
  100. layList.form.render();
  101. layList.tableList('userList',"{:Url('get_user_recharge_list')}",function () {
  102. return [
  103. {field: 'uid', title: 'UID', sort: true,width:'5%'},
  104. {field: 'avatar', title: '头像',templet:'#avatar'},
  105. {field: 'nickname', title: '用户昵称'},
  106. {field: 'order_id', title: '订单号'},
  107. {field: 'price', title: '支付金额',sort:true},
  108. {field: 'paid_type', title: '是否支付'},
  109. {field: '_recharge_type', title: '充值类型'},
  110. {field: '_pay_time', title: '支付时间'},
  111. {field: 'right', title: '操作',toolbar:'#act',width:'5%'},
  112. ];
  113. });
  114. layList.date({elem:'#start_time',theme:'#393D49',type:'datetime'});
  115. layList.date({elem:'#end_time',theme:'#393D49',type:'datetime'});
  116. layList.search('search',function(where){
  117. if(where.start_time!='' && where.end_time=='') return layList.msg('请选择结束时间')
  118. if(where.end_time!='' && where.start_time=='') return layList.msg('请选择开始时间')
  119. console.log(where);
  120. layList.reload(where,true);
  121. });
  122. layList.tool(function (event,data,obj) {
  123. switch (event) {
  124. case 'open_image':
  125. if($eb)
  126. $eb.openImage(data.avatar);
  127. else
  128. layList.layer.open({
  129. type: 1,
  130. title: false,
  131. closeBtn: 0,
  132. shadeClose: true,
  133. content: '<img src="'+data.avatar+'" style="display: block;width: 100%;" />'
  134. });
  135. break;
  136. case 'refund':
  137. $eb.createModalFrame('退款',layList.U({a:'edit',q:{id:data.id}}),{h:'300',w:'500'});
  138. break;
  139. case 'delect':
  140. var url =layList.U({a:'delect',p:{id:data.id}});
  141. if (data.paid) return layList.msg('已支付的记录无法删除!');
  142. $eb.$swal('delete',function(){
  143. $eb.axios.get(url).then(function(res){
  144. if(res.status == 200 && res.data.code == 200) {
  145. $eb.$swal('success',res.data.msg);
  146. obj.del();
  147. }else
  148. return Promise.reject(res.data.msg || '删除失败')
  149. }).catch(function(err){
  150. $eb.$swal('error',err);
  151. });
  152. },{'title':'您确定要删除此条充值记录吗?','text':'删除后将无法恢复,请谨慎操作!','confirm':'是的,我要删除'})
  153. break;
  154. }
  155. });
  156. require(['vue'],function(Vue) {
  157. new Vue({
  158. el: "#app",
  159. data: {
  160. badge: [],
  161. dataList: [
  162. {name: '全部', value: ''},
  163. {name: '今天', value: 'today'},
  164. {name: '昨天', value: 'yesterday'},
  165. {name: '最近7天', value: 'lately7'},
  166. {name: '最近30天', value: 'lately30'},
  167. {name: '本月', value: 'month'},
  168. {name: '本年', value: 'year'},
  169. ],
  170. paidStatus:[
  171. {name:'全部',value:''},
  172. {name:'已支付',value:1},
  173. {name:'未支付',value:0},
  174. ],
  175. where:{
  176. data:'',
  177. paid:'',
  178. nickname: '',
  179. excel:0,
  180. },
  181. showtime: false,
  182. },
  183. watch:{
  184. },
  185. methods:{
  186. getBadge:function(){
  187. var that=this;
  188. layList.basePost(layList.Url({a:'get_badge'}),this.where,function (rem) {
  189. that.badge=rem.data;
  190. });
  191. },
  192. setData:function(item){
  193. var that=this;
  194. if(item.is_zd==true){
  195. that.showtime=true;
  196. this.where.data=this.$refs.date_time.innerText;
  197. }else{
  198. this.showtime=false;
  199. this.where.data=item.value;
  200. }
  201. },
  202. search:function () {
  203. this.where.excel=0;
  204. this.getBadge();
  205. layList.reload(this.where,true);
  206. },
  207. excel:function () {
  208. this.where.excel=1;
  209. location.href=layList.U({a:'get_user_recharge_list',q:this.where});
  210. },
  211. refresh:function () {
  212. layList.reload();
  213. this.getBadge();
  214. }
  215. },
  216. mounted:function () {
  217. this.getBadge();
  218. layList.laydate.render({
  219. elem:this.$refs.date_time,
  220. trigger:'click',
  221. eventElem:this.$refs.time,
  222. range:true,
  223. change:function (value){
  224. that.where.data=value;
  225. }
  226. });
  227. window.SuccessFun = this.search
  228. }
  229. })
  230. });
  231. </script>
  232. {/block}