index.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. {/block}
  4. {block name="content"}
  5. <style>
  6. .btn-outline{
  7. border:none;
  8. }
  9. .btn-outline:hover{
  10. background-color: #0e9aef;
  11. color: #fff;
  12. }
  13. .layui-form-item .layui-btn {
  14. margin-top: 5px;
  15. margin-right: 10px;
  16. }
  17. .layui-btn-primary{
  18. margin-right: 10px;
  19. margin-left: 0!important;
  20. }
  21. label{
  22. margin-bottom: 0!important;
  23. margin-top: 4px;
  24. }
  25. </style>
  26. <div class="layui-fluid">
  27. <div class="layui-row layui-col-space15" id="app">
  28. <!--搜索条件-->
  29. <div class="layui-col-md12">
  30. <div class="layui-card">
  31. <div class="layui-card-header">搜索条件</div>
  32. <div class="layui-card-body">
  33. <div class="layui-carousel layadmin-carousel layadmin-shortcut" lay-anim="" lay-indicator="inside" lay-arrow="none" style="background:none">
  34. <form class="layui-form layui-form-pane" action="">
  35. <div class="layui-form-item">
  36. <div class="layui-inline">
  37. <label class="layui-form-label" style="top: -4.5px">众筹场次</label>
  38. <div class="layui-input-block">
  39. <select name="many_id" id="many_id">
  40. <option value="">全部</option>
  41. {volist name='auction' id='vo'}
  42. <option value="{$vo.id}">{$vo.name}</option>
  43. {/volist}
  44. </select>
  45. </div>
  46. </div>
  47. <div class="layui-inline">
  48. <div class="layui-col-lg12">
  49. <label class="layui-form-label" style="top: -5.5px;">众筹期数</label>
  50. <div class="layui-input-inline">
  51. <input type="text" id="stage" name="stage" class="layui-input" placeholder="众筹期数">
  52. </div>
  53. </div>
  54. </div>
  55. <div class="layui-inline">
  56. <div class="layui-col-lg12">
  57. <label class="layui-form-label" style="top: -5.5px;">订单号</label>
  58. <div class="layui-input-inline">
  59. <input type="text" id="order_id" name="order_id" class="layui-input" placeholder="订单号">
  60. </div>
  61. </div>
  62. </div>
  63. <div class="layui-inline">
  64. <div class="layui-col-lg12">
  65. <label class="layui-form-label" style="top: -5.5px;">搜索用户</label>
  66. <div class="layui-input-inline">
  67. <input type="text" id="name" name="name" class="layui-input" placeholder="请输入名称,id,账号">
  68. </div>
  69. </div>
  70. </div>
  71. <div class="layui-col-lg12" id="app1">
  72. <div class="layui-col-lg12">
  73. <label class="layui-form-label">创建状态:</label>
  74. <div class="layui-input-block" v-cloak="">
  75. <button class="layui-btn layui-btn-sm" type="button" v-for="item in statusList"
  76. @click="where.status = item.value"
  77. :class="{'layui-btn-primary':where.status!==item.value}">{{item.name}}
  78. </button>
  79. </div>
  80. </div>
  81. <div class="layui-col-lg12">
  82. <label class="layui-form-label">创建时间:</label>
  83. <div class="layui-input-block" data-type="data" v-cloak="">
  84. <button class="layui-btn layui-btn-sm" type="button" v-for="item in dataList"
  85. @click="setData(item)"
  86. :class="{'layui-btn-primary':where.data!=item.value}">{{item.name}}
  87. </button>
  88. <button class="layui-btn layui-btn-sm" type="button" ref="time"
  89. @click="setData({value:'zd',is_zd:true})"
  90. :class="{'layui-btn-primary':where.data!='zd'}">自定义
  91. </button>
  92. <button type="button" class="layui-btn layui-btn-sm layui-btn-primary"
  93. v-show="showtime==true" ref="date_time">{$year.0} - {$year.1}
  94. </button>
  95. </div>
  96. </div>
  97. <button @click="excel" type="button"
  98. class="layui-btn layui-btn-warm layui-btn-sm export" type="button">
  99. <i class="fa fa-floppy-o" style="margin-right: 3px;"></i>导出
  100. </button>
  101. <div class="layui-inline">
  102. <div class="layui-input-inline">
  103. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
  104. <i class="layui-icon layui-icon-search"></i>搜索</button>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="col-sm-3 ui-sortable">
  109. <div class="ibox float-e-margins">
  110. <div class="ibox-title">
  111. <span class="label label-danger pull-right">人数</span>
  112. <h5>投注人数</h5>
  113. </div>
  114. <div class="ibox-content">
  115. <h1 class="no-margins" id="user_count"></h1>
  116. </div>
  117. </div>
  118. </div>
  119. <div class="col-sm-3 ui-sortable">
  120. <div class="ibox float-e-margins">
  121. <div class="ibox-title">
  122. <span class="label label-danger pull-right">总</span>
  123. <h5>投注金额</h5>
  124. </div>
  125. <div class="ibox-content">
  126. <h1 class="no-margins" id="user_price"></h1>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </form>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. <!-- 中间详细信息-->
  137. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  138. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  139. </div>
  140. <!--enb-->
  141. </div>
  142. <!--列表-->
  143. <div class="layui-row layui-col-space15">
  144. <div class="layui-col-md12">
  145. <div class="layui-card">
  146. <div class="layui-card-header">场次列表</div>
  147. <div class="layui-card-body">
  148. <table class="layui-hide" id="List" lay-filter="List"></table>
  149. <script type="text/html" id="image">
  150. <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}">
  151. </script>
  152. <script type="text/html" id="status">
  153. {{# if(d.status == 0){ }}
  154. <button type="button" name="suc" class="layui-btn layui-btn-xs" id="">
  155. 正常
  156. </button>
  157. {{# } else if(d.status == 1) { }}
  158. <button type="button" name="suc" class="layui-btn-xs layui-btn" id="">
  159. 成功返还
  160. </button>
  161. {{# } else if(d.status == 2) { }}
  162. <button type="button" name="suc" class="layui-btn-xs layui-btn" id="">
  163. 失败返还
  164. </button>
  165. {{# } }}
  166. </script>
  167. <script type="text/html" id="act">
  168. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
  169. 删除
  170. </button>
  171. </script>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. <!--end-->
  177. </div>
  178. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  179. {/block}
  180. {block name="script"}
  181. <script>
  182. layList.form.render();
  183. layList.tableList('List', "{:Url('list')}", function () {
  184. return [
  185. {type: 'checkbox'},
  186. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  187. {field: 'order_id', title: '订单号', align: 'center'},
  188. {field: 'nickname', title: '用户昵称', align: 'center'},
  189. {field: 'name', title: '众筹名称', align: 'center'},
  190. {field: 'stage', title: '期数', align: 'center'},
  191. {field: 'price', title: '金额', align: 'center'},
  192. {field: 'status', title: '状态', templet: '#status', align: 'center'},
  193. {field: 'create_time', title: '创建时间', align: 'center',width: '8%'},
  194. {field: 'return_time', title: '返还时间', align: 'center',width: '8%'},
  195. {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '15%'},
  196. ];
  197. });
  198. layList.baseGet(layList.U({a:'list',q:{type:1}}), function (res) {
  199. console.log(res);
  200. }, function (res) {
  201. $('#user_count').text(res.count.user);
  202. $('#user_price').text(res.count.price);
  203. });
  204. //查询
  205. layList.search('search',function(where){
  206. layList.reload(where,true);
  207. console.log(where);
  208. layList.baseGet(layList.U({c:'many.many_order',a:'list',q:{type:1,many_id:where['many_id'],name:where['name'],order_id:where['order_id'],stage:where['stage']}}), function (res) {
  209. console.log(res);
  210. }, function (res) {
  211. $('#user_count').text(res.count.user);
  212. $('#user_price').text(res.count.price);
  213. });
  214. });
  215. //点击事件绑定
  216. layList.tool(function (event,data,obj) {
  217. switch (event) {
  218. case 'delete':
  219. var url=layList.U({c:'many.many_order',a:'delete',q:{id:data.id}});
  220. var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
  221. $eb.$swal('delete',function(){
  222. $eb.axios.get(url).then(function(res){
  223. if(res.status == 200 && res.data.code == 200) {
  224. $eb.$swal('success',res.data.msg);
  225. obj.del();
  226. location.reload();
  227. }else
  228. return Promise.reject(res.data.msg || '删除失败')
  229. }).catch(function(err){
  230. $eb.$swal('error',err);
  231. });
  232. },code)
  233. break;
  234. case 'open_image':
  235. $eb.openImage(data.image);
  236. break;
  237. case 'edit':
  238. location.href = layList.U({a:'edit',q:{id:data.id}});
  239. break;
  240. }
  241. })
  242. //改状态
  243. layList.switch('status',function (odj,value) {
  244. if(odj.elem.checked==true){
  245. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:1,id:value}}),function (res) {
  246. layList.msg(res.msg, function () {
  247. layList.reload();
  248. });
  249. });
  250. }else{
  251. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:0,id:value}}),function (res) {
  252. layList.msg(res.msg, function () {
  253. layList.reload();
  254. });
  255. });
  256. }
  257. });
  258. require(['vue'], function (Vue) {
  259. new Vue({
  260. el: "#app1",
  261. data: {
  262. badge: [],
  263. dataList: [
  264. {name: '全部', value: ''},
  265. {name: '今天', value: 'today'},
  266. {name: '昨天', value: 'yesterday'},
  267. {name: '最近7天', value: 'lately7'},
  268. {name: '最近30天', value: 'lately30'},
  269. {name: '本月', value: 'month'},
  270. {name: '本年', value: 'year'},
  271. ],
  272. statusList:[
  273. {name: '全部', value: ''},
  274. {name: '正常', value: '1'},
  275. {name: '成功返还', value: '2'},
  276. {name: '失败返还', value: '3'}
  277. ],
  278. where: {
  279. data: '',
  280. status: status,
  281. type: '',
  282. pay_type: '',
  283. excel: 0,
  284. },
  285. showtime: false,
  286. },
  287. watch: {
  288. 'where.status': function () {
  289. this.where.excel = 0;
  290. this.getBadge();
  291. layList.reload(this.where, true);
  292. },
  293. 'where.data': function () {
  294. this.where.excel = 0;
  295. this.getBadge();
  296. layList.reload(this.where, true);
  297. },
  298. 'where.type': function () {
  299. this.where.excel = 0;
  300. this.getBadge();
  301. layList.reload(this.where, true);
  302. },
  303. 'where.pay_type': function () {
  304. this.where.excel = 0;
  305. this.getBadge();
  306. layList.reload(this.where, true);
  307. }
  308. },
  309. methods: {
  310. setData: function (item) {
  311. if (item.is_zd == true) {
  312. that.showtime = true;
  313. this.where.data = this.$refs.date_time.innerText;
  314. } else {
  315. this.showtime = false;
  316. this.where.data = item.value;
  317. }
  318. },
  319. getBadge: function () {
  320. var that = this;
  321. layList.basePost(layList.Url({c: 'order.store_order', a: 'getBadge'}), this.where, function (rem) {
  322. that.badge = rem.data;
  323. });
  324. },
  325. search: function () {
  326. this.where.excel = 0;
  327. this.getBadge();
  328. layList.reload(this.where, true);
  329. },
  330. refresh: function () {
  331. layList.reload();
  332. this.getBadge();
  333. },
  334. excel: function () {
  335. var name = $('#name').val();
  336. var many_id = $('#many_id').val();
  337. var order_id = $('#order_id').val();
  338. var stage = $('#stage').val();
  339. this.where['name'] = name;
  340. this.where['many_id'] = many_id;
  341. this.where['order_id'] = order_id;
  342. this.where['stage'] = stage;
  343. this.where.excel = 1;
  344. location.href = layList.U({c: 'many.many_order', a: 'list', q: this.where});
  345. this.where.excel = 0;
  346. }
  347. },
  348. mounted: function () {
  349. var that = this;
  350. that.getBadge();
  351. window.formReload = this.search;
  352. layList.laydate.render({
  353. elem: this.$refs.date_time,
  354. trigger: 'click',
  355. eventElem: this.$refs.time,
  356. range: true,
  357. change: function (value) {
  358. that.where.data = value;
  359. }
  360. });
  361. }
  362. })
  363. });
  364. </script>
  365. {/block}