index.php 12 KB

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