index.php 15 KB

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