index.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  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. var uid = {$uid};
  184. var status = {$status};
  185. layList.tableList('List', "{:Url('list')}?uid="+uid+"&status="+status, function () {
  186. return [
  187. {type: 'checkbox'},
  188. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  189. {field: 'order_id', title: '订单号', align: 'center'},
  190. {field: 'nickname', title: '用户昵称', align: 'center'},
  191. {field: 'real_name', title: '姓名', align: 'center'},
  192. {field: 'phone', title: '电话', align: 'center'},
  193. {field: 'name', title: '众筹名称', align: 'center'},
  194. {field: 'stage', title: '期数', align: 'center'},
  195. {field: 'price', title: '金额', align: 'center'},
  196. {field: 'status', title: '状态', templet: '#status', align: 'center'},
  197. {field: 'create_time', title: '创建时间', align: 'center',width: '8%'},
  198. {field: 'return_time', title: '返还时间', align: 'center',width: '8%'},
  199. {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '15%'},
  200. ];
  201. });
  202. layList.baseGet(layList.U({a:'list',q:{type:1}}), function (res) {
  203. console.log(res);
  204. }, function (res) {
  205. $('#user_count').text(res.count.user);
  206. $('#user_price').text(res.count.price);
  207. });
  208. //查询
  209. layList.search('search',function(where){
  210. layList.reload(where,true);
  211. console.log(where);
  212. 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) {
  213. console.log(res);
  214. }, function (res) {
  215. $('#user_count').text(res.count.user);
  216. $('#user_price').text(res.count.price);
  217. });
  218. });
  219. //点击事件绑定
  220. layList.tool(function (event,data,obj) {
  221. switch (event) {
  222. case 'delete':
  223. var url=layList.U({c:'many.many_order',a:'delete',q:{id:data.id}});
  224. var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
  225. $eb.$swal('delete',function(){
  226. $eb.axios.get(url).then(function(res){
  227. if(res.status == 200 && res.data.code == 200) {
  228. $eb.$swal('success',res.data.msg);
  229. obj.del();
  230. location.reload();
  231. }else
  232. return Promise.reject(res.data.msg || '删除失败')
  233. }).catch(function(err){
  234. $eb.$swal('error',err);
  235. });
  236. },code)
  237. break;
  238. case 'open_image':
  239. $eb.openImage(data.image);
  240. break;
  241. case 'edit':
  242. location.href = layList.U({a:'edit',q:{id:data.id}});
  243. break;
  244. }
  245. })
  246. //改状态
  247. layList.switch('status',function (odj,value) {
  248. if(odj.elem.checked==true){
  249. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:1,id:value}}),function (res) {
  250. layList.msg(res.msg, function () {
  251. layList.reload();
  252. });
  253. });
  254. }else{
  255. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:0,id:value}}),function (res) {
  256. layList.msg(res.msg, function () {
  257. layList.reload();
  258. });
  259. });
  260. }
  261. });
  262. require(['vue'], function (Vue) {
  263. new Vue({
  264. el: "#app1",
  265. data: {
  266. badge: [],
  267. dataList: [
  268. {name: '全部', value: ''},
  269. {name: '今天', value: 'today'},
  270. {name: '昨天', value: 'yesterday'},
  271. {name: '最近7天', value: 'lately7'},
  272. {name: '最近30天', value: 'lately30'},
  273. {name: '本月', value: 'month'},
  274. {name: '本年', value: 'year'},
  275. ],
  276. statusList:[
  277. {name: '全部', value: ''},
  278. {name: '正常', value: '1'},
  279. {name: '成功返还', value: '2'},
  280. {name: '失败返还', value: '3'}
  281. ],
  282. where: {
  283. data: '',
  284. status: status,
  285. type: '',
  286. pay_type: '',
  287. excel: 0,
  288. },
  289. showtime: false,
  290. },
  291. watch: {
  292. 'where.status': function () {
  293. this.where.excel = 0;
  294. this.getBadge();
  295. layList.reload(this.where, true);
  296. },
  297. 'where.data': function () {
  298. this.where.excel = 0;
  299. this.getBadge();
  300. layList.reload(this.where, true);
  301. },
  302. 'where.type': function () {
  303. this.where.excel = 0;
  304. this.getBadge();
  305. layList.reload(this.where, true);
  306. },
  307. 'where.pay_type': function () {
  308. this.where.excel = 0;
  309. this.getBadge();
  310. layList.reload(this.where, true);
  311. }
  312. },
  313. methods: {
  314. setData: function (item) {
  315. if (item.is_zd == true) {
  316. that.showtime = true;
  317. this.where.data = this.$refs.date_time.innerText;
  318. } else {
  319. this.showtime = false;
  320. this.where.data = item.value;
  321. }
  322. },
  323. getBadge: function () {
  324. var that = this;
  325. layList.basePost(layList.Url({c: 'order.store_order', a: 'getBadge'}), this.where, function (rem) {
  326. that.badge = rem.data;
  327. });
  328. },
  329. search: function () {
  330. this.where.excel = 0;
  331. this.getBadge();
  332. layList.reload(this.where, true);
  333. },
  334. refresh: function () {
  335. layList.reload();
  336. this.getBadge();
  337. },
  338. excel: function () {
  339. var name = $('#name').val();
  340. var many_id = $('#many_id').val();
  341. var order_id = $('#order_id').val();
  342. var stage = $('#stage').val();
  343. this.where['name'] = name;
  344. this.where['many_id'] = many_id;
  345. this.where['order_id'] = order_id;
  346. this.where['stage'] = stage;
  347. this.where.excel = 1;
  348. location.href = layList.U({c: 'many.many_order', a: 'list', q: this.where});
  349. this.where.excel = 0;
  350. }
  351. },
  352. mounted: function () {
  353. var that = this;
  354. that.getBadge();
  355. window.formReload = this.search;
  356. layList.laydate.render({
  357. elem: this.$refs.date_time,
  358. trigger: 'click',
  359. eventElem: this.$refs.time,
  360. range: true,
  361. change: function (value) {
  362. that.where.data = value;
  363. }
  364. });
  365. }
  366. })
  367. });
  368. </script>
  369. {/block}