index.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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-col-lg12" id="app1">
  56. <div class="layui-col-lg12">
  57. <label class="layui-form-label">创建时间:</label>
  58. <div class="layui-input-block" data-type="data" v-cloak="">
  59. <button class="layui-btn layui-btn-sm" type="button" v-for="item in dataList"
  60. @click="setData(item)"
  61. :class="{'layui-btn-primary':where.data!=item.value}">{{item.name}}
  62. </button>
  63. <button class="layui-btn layui-btn-sm" type="button" ref="time"
  64. @click="setData({value:'zd',is_zd:true})"
  65. :class="{'layui-btn-primary':where.data!='zd'}">自定义
  66. </button>
  67. <button type="button" class="layui-btn layui-btn-sm layui-btn-primary"
  68. v-show="showtime==true" ref="date_time">{$year.0} - {$year.1}
  69. </button>
  70. </div>
  71. </div>
  72. <!-- <button @click="excel" type="button"-->
  73. <!-- class="layui-btn layui-btn-warm layui-btn-sm export" type="button">-->
  74. <!-- <i class="fa fa-floppy-o" style="margin-right: 3px;"></i>导出-->
  75. <!-- </button>-->
  76. <div class="layui-inline">
  77. <div class="layui-input-inline">
  78. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
  79. <i class="layui-icon layui-icon-search"></i>搜索</button>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </form>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <!-- 中间详细信息-->
  90. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  91. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  92. </div>
  93. <!--enb-->
  94. </div>
  95. <!--列表-->
  96. <div class="layui-row layui-col-space15">
  97. <div class="layui-col-md12">
  98. <div class="layui-card">
  99. <div class="layui-card-header">场次列表</div>
  100. <div class="layui-card-body">
  101. <table class="layui-hide" id="List" lay-filter="List"></table>
  102. <script type="text/html" id="image">
  103. <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}">
  104. </script>
  105. <script type="text/html" id="status">
  106. {{# if(d.status == 1){ }}
  107. <button type="button" name="suc" class="layui-btn layui-btn-xs" id="">
  108. 成功
  109. {{# } else if(d.status == 2) { }}
  110. <button type="button" name="suc" class="layui-btn-xs layui-btn" id="">
  111. 失败
  112. </button>
  113. {{# } }}
  114. </script>
  115. <script type="text/html" id="act">
  116. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
  117. 删除
  118. </button>
  119. </script>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <!--end-->
  125. </div>
  126. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  127. {/block}
  128. {block name="script"}
  129. <script>
  130. layList.form.render();
  131. layList.tableList('List', "{:Url('list')}", function () {
  132. return [
  133. {type: 'checkbox'},
  134. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  135. {field: 'name', title: '众筹名称', align: 'center'},
  136. {field: 'stage', title: '期数', align: 'center'},
  137. {field: 'status', title: '众筹状态', templet: '#status', align: 'center'},
  138. {field: 'create_time', title: '创建时间', align: 'center',width: '8%'},
  139. {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '15%'},
  140. ];
  141. });
  142. //查询
  143. layList.search('search',function(where){
  144. layList.reload(where,true);
  145. });
  146. //点击事件绑定
  147. layList.tool(function (event,data,obj) {
  148. switch (event) {
  149. case 'delete':
  150. var url=layList.U({c:'many.many_discipline',a:'delete',q:{id:data.id}});
  151. var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
  152. $eb.$swal('delete',function(){
  153. $eb.axios.get(url).then(function(res){
  154. if(res.status == 200 && res.data.code == 200) {
  155. $eb.$swal('success',res.data.msg);
  156. obj.del();
  157. location.reload();
  158. }else
  159. return Promise.reject(res.data.msg || '删除失败')
  160. }).catch(function(err){
  161. $eb.$swal('error',err);
  162. });
  163. },code)
  164. break;
  165. case 'open_image':
  166. $eb.openImage(data.image);
  167. break;
  168. case 'edit':
  169. location.href = layList.U({a:'edit',q:{id:data.id}});
  170. break;
  171. }
  172. })
  173. //改状态
  174. layList.switch('status',function (odj,value) {
  175. if(odj.elem.checked==true){
  176. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:1,id:value}}),function (res) {
  177. layList.msg(res.msg, function () {
  178. layList.reload();
  179. });
  180. });
  181. }else{
  182. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:0,id:value}}),function (res) {
  183. layList.msg(res.msg, function () {
  184. layList.reload();
  185. });
  186. });
  187. }
  188. });
  189. require(['vue'], function (Vue) {
  190. new Vue({
  191. el: "#app1",
  192. data: {
  193. badge: [],
  194. dataList: [
  195. {name: '全部', value: ''},
  196. {name: '今天', value: 'today'},
  197. {name: '昨天', value: 'yesterday'},
  198. {name: '最近7天', value: 'lately7'},
  199. {name: '最近30天', value: 'lately30'},
  200. {name: '本月', value: 'month'},
  201. {name: '本年', value: 'year'},
  202. ],
  203. statusList:[
  204. {name: '全部', value: ''},
  205. {name: '正常', value: '0'},
  206. {name: '成功返还', value: '1'},
  207. {name: '失败返还', value: '2'}
  208. ],
  209. where: {
  210. data: '',
  211. status: status,
  212. type: '',
  213. pay_type: '',
  214. excel: 0,
  215. },
  216. showtime: false,
  217. },
  218. watch: {
  219. 'where.status': function () {
  220. this.where.excel = 0;
  221. this.getBadge();
  222. layList.reload(this.where, true);
  223. },
  224. 'where.data': function () {
  225. this.where.excel = 0;
  226. this.getBadge();
  227. layList.reload(this.where, true);
  228. },
  229. 'where.type': function () {
  230. this.where.excel = 0;
  231. this.getBadge();
  232. layList.reload(this.where, true);
  233. },
  234. 'where.pay_type': function () {
  235. this.where.excel = 0;
  236. this.getBadge();
  237. layList.reload(this.where, true);
  238. }
  239. },
  240. methods: {
  241. setData: function (item) {
  242. var that = this;
  243. if (item.is_zd == true) {
  244. that.showtime = true;
  245. this.where.data = this.$refs.date_time.innerText;
  246. } else {
  247. this.showtime = false;
  248. this.where.data = item.value;
  249. }
  250. },
  251. getBadge: function () {
  252. var that = this;
  253. layList.basePost(layList.Url({c: 'order.store_order', a: 'getBadge'}), this.where, function (rem) {
  254. that.badge = rem.data;
  255. });
  256. },
  257. search: function () {
  258. this.where.excel = 0;
  259. this.getBadge();
  260. layList.reload(this.where, true);
  261. },
  262. refresh: function () {
  263. layList.reload();
  264. this.getBadge();
  265. },
  266. excel: function () {
  267. var name = $('#name').val();
  268. var many_id = $('#many_id').val();
  269. var order_id = $('#order_id').val();
  270. var stage = $('#stage').val();
  271. this.where['name'] = name;
  272. this.where['many_id'] = many_id;
  273. this.where['order_id'] = order_id;
  274. this.where['stage'] = stage;
  275. this.where.excel = 1;
  276. location.href = layList.U({c: 'many.many_order', a: 'list', q: this.where});
  277. this.where.excel = 0;
  278. }
  279. },
  280. mounted: function () {
  281. var that = this;
  282. that.getBadge();
  283. window.formReload = this.search;
  284. layList.laydate.render({
  285. elem: this.$refs.date_time,
  286. trigger: 'click',
  287. eventElem: this.$refs.time,
  288. range: true,
  289. change: function (value) {
  290. that.where.data = value;
  291. }
  292. });
  293. }
  294. })
  295. });
  296. </script>
  297. {/block}