index.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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. <form class="layui-form layui-form-pane" action="">
  34. <div class="layui-form-item">
  35. <!-- <div class="layui-inline">-->
  36. <!-- <label class="layui-form-label" style="top: -4.5px">所有场馆</label>-->
  37. <!-- <div class="layui-input-block">-->
  38. <!-- <select name="auction_id">-->
  39. <!-- <option value=" ">全部</option>-->
  40. <!-- {volist name='auction' id='vo'}-->
  41. <!-- <option value="{$vo.id}">{$vo.nickname}</option>-->
  42. <!-- {/volist}-->
  43. <!-- </select>-->
  44. <!-- </div>-->
  45. <!-- </div>-->
  46. <div class="layui-inline">
  47. <label class="layui-form-label" style="top: -4.5px">搜索</label>
  48. <div class="layui-input-block">
  49. <input type="text" name="store_name" class="layui-input" placeholder="订单号,账号,昵称,编号">
  50. </div>
  51. </div>
  52. <div class="layui-col-lg12">
  53. <label class="layui-form-label">创建时间:</label>
  54. <div class="layui-input-block" data-type="data" v-cloak="">
  55. <button class="layui-btn layui-btn-sm" type="button" v-for="item in dataList"
  56. @click="setData(item)"
  57. :class="{'layui-btn-primary':where.data!=item.value}">{{item.name}}
  58. </button>
  59. <button class="layui-btn layui-btn-sm" type="button" ref="time"
  60. @click="setData({value:'zd',is_zd:true})"
  61. :class="{'layui-btn-primary':where.data!='zd'}">自定义
  62. </button>
  63. <button type="button" class="layui-btn layui-btn-sm layui-btn-primary"
  64. v-show="showtime==true" ref="date_time">{$year.0} - {$year.1}
  65. </button>
  66. </div>
  67. </div>
  68. <div class="layui-inline" style="top: -5px">
  69. <div class="layui-input-inline">
  70. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search" >
  71. <i class="layui-icon layui-icon-search"></i>搜索</button>
  72. </div>
  73. </div>
  74. </div>
  75. </form>
  76. </div>
  77. </div>
  78. </div>
  79. <!-- 中间详细信息-->
  80. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  81. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  82. </div>
  83. <!--enb-->
  84. </div>
  85. <!--列表-->
  86. <div class="layui-row layui-col-space15">
  87. <div class="layui-col-md12">
  88. <div class="layui-card">
  89. <div class="layui-card-header">订单列表</div>
  90. <div class="layui-card-body">
  91. <!-- <div class="layui-btn-container" id="container-action">-->
  92. <!-- <a class="layui-btn layui-btn-sm" href="{:Url('create')}">添加商品</a>-->
  93. <!-- <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
  94. <!-- </div>-->
  95. <table class="layui-hide" id="List" lay-filter="List"></table>
  96. <script type="text/html" id="image" >
  97. <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}" style="cursor: pointer">
  98. </script>
  99. <script type="text/html" id="status">
  100. {{# if(d.status < 1){ }}
  101. <button type="button" name="status" class="layui-btn-disabled layui-btn-xs" id="">
  102. 过期
  103. </button>
  104. {{# } else if(d.status == 1) { }}
  105. <button type="button" name="status" class="layui-btn-xs layui-btn-disabled" id="">
  106. 待上传
  107. </button>
  108. {{# } else if(d.status == 2) { }}
  109. <button type="button" name="status" class="layui-btn layui-btn-xs layui-btn-danger" id="">
  110. 待审核
  111. </button>
  112. {{# } else if(d.status == 3) { }}
  113. <button type="button" name="status" class="layui-btn layui-btn-xs layui-btn-danger" id="">
  114. 完成
  115. </button>
  116. {{# } }}
  117. </script>
  118. <script type="text/html" id="upload_image">
  119. {{# if(d.upload_image === ''){ }}
  120. <button type="button" name="status" class="layui-btn-disabled layui-btn-xs" id="">
  121. 未上传打款凭证
  122. </button>
  123. {{# } else { }}
  124. <img style="cursor: pointer" lay-event="open_image" src="{{d.upload_image}}" style="cursor: pointer">
  125. {{# } }}
  126. </script>
  127. <script type="text/html" id="act">
  128. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='qd' id="">
  129. 通过
  130. </button>
  131. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
  132. 删除
  133. </button>
  134. </script>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <!--end-->
  140. </div>
  141. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  142. {/block}
  143. {block name="script"}
  144. <script>
  145. //实例化form
  146. layList.form.render();
  147. layList.tableList('List', "{:Url('list')}", function () {
  148. return [
  149. {type: 'checkbox'},
  150. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  151. {field: 'order_id', title: '订单号', templet: '#order_id', align: 'center'},
  152. {field: 'account', title: '购买用户账号', templet: '#account', align: 'center'},
  153. {field: 'nickname', title: '购买用户呢称', templet: '#nickname', align: 'center'},
  154. {field: 'name', title: '商品', templet: '#name', align: 'center'},
  155. {field: 'price', title: '购买价格', templet: '#price', align: 'center', style : 'color: #DC143C;'},
  156. {field: 'image', title: '图片', templet: '#image', align: 'center', width: '5%'},
  157. {field: 'upload_image', title: '打款凭证', templet: '#upload_image', align: 'center',width: '5%'},
  158. {field: 'status', title: '状态', templet: '#status', align: 'center'},
  159. {field: 'create_time', title: '预约时间', templet: '#date', align: 'center'},
  160. {field: 'right', title: '操作', align: 'center', toolbar: '#act'},
  161. ];
  162. });
  163. //点击事件绑定
  164. layList.tool(function (event,data,obj) {
  165. switch (event) {
  166. case 'delete':
  167. var url=layList.U({c:'auction.auction_order',a:'delete',q:{id:data.id}});
  168. var code = {title:"操作提示",text:"确定删除?",type:'info',confirm:'是的,删除'};
  169. $eb.$swal('delete',function(){
  170. $eb.axios.get(url).then(function(res){
  171. if(res.status == 200 && res.data.code == 200) {
  172. $eb.$swal('success',res.data.msg);
  173. obj.del();
  174. location.reload();
  175. }else
  176. return Promise.reject(res.data.msg || '删除失败')
  177. }).catch(function(err){
  178. $eb.$swal('error',err);
  179. });
  180. },code)
  181. break;
  182. case 'qd':
  183. var url=layList.U({c:'auction.auction_order',a:'qd',q:{id:data.id}});
  184. var code = {title:"操作提示",text:"确定通过订单吗?",type:'info',confirm:'是的,确定'};
  185. $eb.$swal('delete',function(){
  186. $eb.axios.get(url).then(function(res){
  187. if(res.status == 200 && res.data.code == 200) {
  188. $eb.$swal('success',res.data.msg);
  189. obj.del();
  190. location.reload();
  191. }else
  192. return Promise.reject(res.data.msg || '失败')
  193. }).catch(function(err){
  194. $eb.$swal('error',err);
  195. });
  196. },code)
  197. break;
  198. case 'open_image':
  199. $eb.openImage(data.image);
  200. break;
  201. case 'edit':
  202. location.href = layList.U({a:'edit',q:{id:data.id}});
  203. break;
  204. }
  205. })
  206. //查询
  207. layList.search('search',function(where){
  208. console.log(111);
  209. layList.reload(where,true);
  210. });
  211. //改状态
  212. layList.switch('is_show',function (odj,value) {
  213. if(odj.elem.checked==true){
  214. layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_status',p:{status:1,id:value}}),function (res) {
  215. layList.msg(res.msg, function () {
  216. layList.reload();
  217. });
  218. });
  219. }else{
  220. layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_status',p:{status:0,id:value}}),function (res) {
  221. layList.msg(res.msg, function () {
  222. layList.reload();
  223. });
  224. });
  225. }
  226. });
  227. require(['vue'], function (Vue) {
  228. new Vue({
  229. el: "#app",
  230. data: {
  231. badge: [],
  232. dataList: [
  233. {name: '全部', value: ''},
  234. {name: '今天', value: 'today'},
  235. {name: '昨天', value: 'yesterday'},
  236. {name: '最近7天', value: 'lately7'},
  237. {name: '最近30天', value: 'lately30'},
  238. {name: '本月', value: 'month'},
  239. {name: '本年', value: 'year'},
  240. ],
  241. where: {
  242. data: '',
  243. status: status,
  244. type: '',
  245. pay_type: '',
  246. excel: 0,
  247. },
  248. showtime: false,
  249. },
  250. watch: {
  251. 'where.status': function () {
  252. this.where.excel = 0;
  253. this.getBadge();
  254. layList.reload(this.where, true);
  255. },
  256. 'where.data': function () {
  257. this.where.excel = 0;
  258. this.getBadge();
  259. layList.reload(this.where, true);
  260. },
  261. 'where.type': function () {
  262. this.where.excel = 0;
  263. this.getBadge();
  264. layList.reload(this.where, true);
  265. },
  266. 'where.pay_type': function () {
  267. this.where.excel = 0;
  268. this.getBadge();
  269. layList.reload(this.where, true);
  270. }
  271. },
  272. methods: {
  273. setData: function (item) {
  274. var that = this;
  275. if (item.is_zd == true) {
  276. that.showtime = true;
  277. this.where.data = this.$refs.date_time.innerText;
  278. } else {
  279. this.showtime = false;
  280. this.where.data = item.value;
  281. }
  282. },
  283. getBadge: function () {
  284. var that = this;
  285. layList.basePost(layList.Url({c: 'order.store_order', a: 'getBadge'}), this.where, function (rem) {
  286. that.badge = rem.data;
  287. });
  288. },
  289. search: function () {
  290. this.where.excel = 0;
  291. this.getBadge();
  292. layList.reload(this.where, true);
  293. },
  294. refresh: function () {
  295. layList.reload();
  296. this.getBadge();
  297. },
  298. excel: function () {
  299. this.where.excel = 1;
  300. location.href = layList.U({c: 'order.store_order', a: 'order_list', q: this.where});
  301. this.where.excel = 0;
  302. }
  303. },
  304. mounted: function () {
  305. var that = this;
  306. that.getBadge();
  307. window.formReload = this.search;
  308. layList.laydate.render({
  309. elem: this.$refs.date_time,
  310. trigger: 'click',
  311. eventElem: this.$refs.time,
  312. range: true,
  313. change: function (value) {
  314. that.where.data = value;
  315. }
  316. });
  317. }
  318. })
  319. });
  320. </script>
  321. {/block}