index.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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">{{d.user}}</h1>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </form>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <!-- 中间详细信息-->
  126. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  127. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  128. </div>
  129. <!--enb-->
  130. </div>
  131. <!--列表-->
  132. <div class="layui-row layui-col-space15">
  133. <div class="layui-col-md12">
  134. <div class="layui-card">
  135. <div class="layui-card-header">场次列表</div>
  136. <div class="layui-card-body">
  137. <table class="layui-hide" id="List" lay-filter="List"></table>
  138. <script type="text/html" id="image">
  139. <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}">
  140. </script>
  141. <script type="text/html" id="status">
  142. {{# if(d.status == 0){ }}
  143. <button type="button" name="suc" class="layui-btn layui-btn-xs" id="">
  144. 正常
  145. </button>
  146. {{# } else if(d.status == 1) { }}
  147. <button type="button" name="suc" class="layui-btn-xs layui-btn" id="">
  148. 成功返还
  149. </button>
  150. {{# } else if(d.status == 2) { }}
  151. <button type="button" name="suc" class="layui-btn-xs layui-btn" id="">
  152. 失败返还
  153. </button>
  154. {{# } }}
  155. </script>
  156. <script type="text/html" id="act">
  157. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
  158. 删除
  159. </button>
  160. </script>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. <!--end-->
  166. </div>
  167. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  168. {/block}
  169. {block name="script"}
  170. <script>
  171. layList.form.render();
  172. layList.tableList('List', "{:Url('list')}", function () {
  173. return [
  174. {type: 'checkbox'},
  175. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  176. {field: 'order_id', title: '订单号', align: 'center'},
  177. {field: 'nickname', title: '用户昵称', align: 'center'},
  178. {field: 'name', title: '众筹名称', align: 'center'},
  179. {field: 'stage', title: '期数', align: 'center'},
  180. {field: 'price', title: '金额', align: 'center'},
  181. {field: 'status', title: '状态', templet: '#status', align: 'center'},
  182. {field: 'create_time', title: '创建时间', align: 'center',width: '8%'},
  183. {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '15%'},
  184. ];
  185. });
  186. layList.baseGet(layList.U({a:'list',q:{type:1}}), function (res) {
  187. console.log(res);
  188. }, function (res) {
  189. $('.no-margins').text(res.count);
  190. });
  191. //查询
  192. layList.search('search',function(where){
  193. layList.reload(where,true);
  194. console.log(where);
  195. 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) {
  196. console.log(res);
  197. }, function (res) {
  198. $('.no-margins').text(res.count);
  199. });
  200. });
  201. //点击事件绑定
  202. layList.tool(function (event,data,obj) {
  203. switch (event) {
  204. case 'delete':
  205. var url=layList.U({c:'many.many_order',a:'delete',q:{id:data.id}});
  206. var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
  207. $eb.$swal('delete',function(){
  208. $eb.axios.get(url).then(function(res){
  209. if(res.status == 200 && res.data.code == 200) {
  210. $eb.$swal('success',res.data.msg);
  211. obj.del();
  212. location.reload();
  213. }else
  214. return Promise.reject(res.data.msg || '删除失败')
  215. }).catch(function(err){
  216. $eb.$swal('error',err);
  217. });
  218. },code)
  219. break;
  220. case 'open_image':
  221. $eb.openImage(data.image);
  222. break;
  223. case 'edit':
  224. location.href = layList.U({a:'edit',q:{id:data.id}});
  225. break;
  226. }
  227. })
  228. //改状态
  229. layList.switch('status',function (odj,value) {
  230. if(odj.elem.checked==true){
  231. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:1,id:value}}),function (res) {
  232. layList.msg(res.msg, function () {
  233. layList.reload();
  234. });
  235. });
  236. }else{
  237. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:0,id:value}}),function (res) {
  238. layList.msg(res.msg, function () {
  239. layList.reload();
  240. });
  241. });
  242. }
  243. });
  244. require(['vue'], function (Vue) {
  245. new Vue({
  246. el: "#app1",
  247. data: {
  248. badge: [],
  249. dataList: [
  250. {name: '全部', value: ''},
  251. {name: '今天', value: 'today'},
  252. {name: '昨天', value: 'yesterday'},
  253. {name: '最近7天', value: 'lately7'},
  254. {name: '最近30天', value: 'lately30'},
  255. {name: '本月', value: 'month'},
  256. {name: '本年', value: 'year'},
  257. ],
  258. statusList:[
  259. {name: '全部', value: ''},
  260. {name: '正常', value: '1'},
  261. {name: '成功返还', value: '2'},
  262. {name: '失败返还', value: '3'}
  263. ],
  264. where: {
  265. data: '',
  266. status: status,
  267. type: '',
  268. pay_type: '',
  269. excel: 0,
  270. },
  271. showtime: false,
  272. },
  273. watch: {
  274. 'where.status': function () {
  275. this.where.excel = 0;
  276. this.getBadge();
  277. layList.reload(this.where, true);
  278. },
  279. 'where.data': function () {
  280. this.where.excel = 0;
  281. this.getBadge();
  282. layList.reload(this.where, true);
  283. },
  284. 'where.type': function () {
  285. this.where.excel = 0;
  286. this.getBadge();
  287. layList.reload(this.where, true);
  288. },
  289. 'where.pay_type': function () {
  290. this.where.excel = 0;
  291. this.getBadge();
  292. layList.reload(this.where, true);
  293. }
  294. },
  295. methods: {
  296. setData: function (item) {
  297. var that = this;
  298. if (item.is_zd == true) {
  299. that.showtime = true;
  300. this.where.data = this.$refs.date_time.innerText;
  301. } else {
  302. this.showtime = false;
  303. this.where.data = item.value;
  304. }
  305. },
  306. getBadge: function () {
  307. var that = this;
  308. layList.basePost(layList.Url({c: 'order.store_order', a: 'getBadge'}), this.where, function (rem) {
  309. that.badge = rem.data;
  310. });
  311. },
  312. search: function () {
  313. this.where.excel = 0;
  314. this.getBadge();
  315. layList.reload(this.where, true);
  316. },
  317. refresh: function () {
  318. layList.reload();
  319. this.getBadge();
  320. },
  321. excel: function () {
  322. var name = $('#name').val();
  323. var many_id = $('#many_id').val();
  324. var order_id = $('#order_id').val();
  325. var stage = $('#stage').val();
  326. this.where['name'] = name;
  327. this.where['many_id'] = many_id;
  328. this.where['order_id'] = order_id;
  329. this.where['stage'] = stage;
  330. this.where.excel = 1;
  331. location.href = layList.U({c: 'many.many_order', a: 'list', q: this.where});
  332. this.where.excel = 0;
  333. }
  334. },
  335. mounted: function () {
  336. var that = this;
  337. that.getBadge();
  338. window.formReload = this.search;
  339. layList.laydate.render({
  340. elem: this.$refs.date_time,
  341. trigger: 'click',
  342. eventElem: this.$refs.time,
  343. range: true,
  344. change: function (value) {
  345. that.where.data = value;
  346. }
  347. });
  348. }
  349. })
  350. });
  351. </script>
  352. {/block}