index.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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="auction" name="auction" class="layui-input" placeholder="请输入名称,编号">
  40. </div>
  41. </div>
  42. <div class="layui-inline">
  43. <div class="layui-input-inline">
  44. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
  45. <i class="layui-icon layui-icon-search"></i>搜索</button>
  46. </div>
  47. </div>
  48. </div>
  49. </form>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <!-- 中间详细信息-->
  55. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  56. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  57. </div>
  58. <!--enb-->
  59. </div>
  60. <!--列表-->
  61. <div class="layui-row layui-col-space15">
  62. <div class="layui-col-md12">
  63. <div class="layui-card">
  64. <div class="layui-card-header">场馆列表</div>
  65. <div class="layui-card-body">
  66. {if $admin['roles'] == 1}
  67. <div class="layui-btn-container" id="container-action">
  68. <a class="layui-btn layui-btn-sm" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}',{h:700,w:1100})">添加会馆</a>
  69. <!-- <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
  70. </div>
  71. {/if}
  72. <table class="layui-hide" id="List" lay-filter="List"></table>
  73. <script type="text/html" id="image">
  74. <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}" >
  75. </script>
  76. <script type="text/html" id="status">
  77. <input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='status' lay-text='使用|禁用' {{ d.status == 1 ? 'checked' : '' }}>
  78. </script>
  79. <script type="text/html" id="act">
  80. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('{{d.title}}-编辑','{:Url('edit')}?id={{d.id}}',{h:700,w:1100})">
  81. 编辑
  82. </button>
  83. {if $admin['roles'] == 1}
  84. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
  85. 删除
  86. </button>
  87. {/if}
  88. </script>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <!--end-->
  94. </div>
  95. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  96. {/block}
  97. {block name="script"}
  98. <script>
  99. layList.tableList('List', "{:Url('list')}", function () {
  100. return [
  101. {type: 'checkbox'},
  102. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  103. {field: 'name', title: '会馆名称', templet: '#nickname', align: 'center'},
  104. {field: 'max_hanging', title: '最大挂售', templet: '#max_hanging', align: 'center'},
  105. {field: 'nickname', title: '会馆拥有人', templet: '#nickname', align: 'center'},
  106. {field: 'image', title: '封面', templet: '#image', align: 'center', width: '5%',},
  107. {field: 'status', title: '状态', templet: '#status', align: 'center'},
  108. {field: 'right', title: '操作', align: 'center', toolbar: '#act'},
  109. ];
  110. });
  111. //查询
  112. layList.search('search',function(where){
  113. layList.reload(where,true);
  114. });
  115. //点击事件绑定
  116. layList.tool(function (event,data,obj) {
  117. switch (event) {
  118. case 'delete':
  119. var url=layList.U({c:'auction.auction_gu',a:'delete',q:{id:data.id}});
  120. var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
  121. $eb.$swal('delete',function(){
  122. $eb.axios.get(url).then(function(res){
  123. if(res.status == 200 && res.data.code == 200) {
  124. $eb.$swal('success',res.data.msg);
  125. obj.del();
  126. location.reload();
  127. }else
  128. return Promise.reject(res.data.msg || '删除失败')
  129. }).catch(function(err){
  130. $eb.$swal('error',err);
  131. });
  132. },code)
  133. break;
  134. case 'open_image':
  135. $eb.openImage(data.image);
  136. break;
  137. case 'edit':
  138. location.href = layList.U({a:'edit',q:{id:data.id}});
  139. break;
  140. }
  141. })
  142. //改状态
  143. layList.switch('status',function (odj,value) {
  144. if(odj.elem.checked==true){
  145. layList.baseGet(layList.Url({c:'auction.auction_gu',a:'set_status',p:{status:1,id:value}}),function (res) {
  146. layList.msg(res.msg, function () {
  147. layList.reload();
  148. });
  149. });
  150. }else{
  151. layList.baseGet(layList.Url({c:'auction.auction_gu',a:'set_status',p:{status:0,id:value}}),function (res) {
  152. layList.msg(res.msg, function () {
  153. layList.reload();
  154. });
  155. });
  156. }
  157. });
  158. </script>
  159. {/block}