index.php 17 KB

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