index.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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-inline">
  53. <label class="layui-form-label" style="top: -4.5px">是否挂售</label>
  54. <div class="layui-input-block">
  55. <select name="is_show">
  56. <option value="">全部</option>
  57. <option value="2">未挂售</option>
  58. <option value="1">已挂售</option>
  59. </select>
  60. </div>
  61. </div>
  62. <div class="layui-inline">
  63. <div class="layui-input-inline">
  64. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
  65. <i class="layui-icon layui-icon-search"></i>搜索</button>
  66. </div>
  67. </div>
  68. </div>
  69. </form>
  70. </div>
  71. </div>
  72. </div>
  73. <!-- 中间详细信息-->
  74. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  75. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  76. </div>
  77. <!--enb-->
  78. </div>
  79. <!--列表-->
  80. <div class="layui-row layui-col-space15">
  81. <div class="layui-col-md12">
  82. <div class="layui-card">
  83. <div class="layui-card-header">商品列表</div>
  84. <div class="layui-card-body">
  85. <div class="layui-btn-container" id="container-action">
  86. <a class="layui-btn layui-btn-sm" href="{:Url('create')}">添加商品</a>
  87. <!-- <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
  88. </div>
  89. <table class="layui-hide" id="List" lay-filter="List"></table>
  90. <script type="text/html" id="image">
  91. <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}">
  92. </script>
  93. <script type="text/html" id="is_show">
  94. <input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show' lay-text='上架|下架' {{ d.is_show == 1 ? 'checked' : '' }}>
  95. </script>
  96. <script type="text/html" id="frozen">
  97. <input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='frozen' lay-text='冻结|解冻' {{ d.frozen == 1 ? 'checked' : '' }}>
  98. </script>
  99. <script type="text/html" id="act">
  100. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('修改所属人','{:Url('belonging')}?id={{d.id}}',{h:500,w:500})">
  101. 所属
  102. </button>
  103. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='fz'>
  104. 复制
  105. </button>
  106. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='edit'>
  107. 编辑
  108. </button>
  109. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
  110. 删除
  111. </button>
  112. </script>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <!--end-->
  118. </div>
  119. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  120. {/block}
  121. {block name="script"}
  122. <script>
  123. //实例化form
  124. layList.form.render();
  125. layList.tableList('List', "{:Url('list')}", function () {
  126. return [
  127. {type: 'checkbox'},
  128. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  129. {field: 'image', title: '封面', templet: '#image', align: 'center',width: '5%'},
  130. {field: 'name', title: '商品名', templet: '#nickname', align: 'center'},
  131. {field: 'au_name', title: '场次', templet: '#auction_name', align: 'center'},
  132. {field: 'nickname', title: '拥有人', templet: '#nickname', align: 'center'},
  133. {field: 'price', title: '原价', templet: '#price', align: 'center',style : 'color: #DC143C;'},
  134. {field: 'hanging_price', title: '挂售价格', templet: '#hanging_price', align: 'center',style : 'color: #DC143C;'},
  135. {field: 'fictitious_price', title: '虚拟价格', templet: '#fictitious_price', align: 'center',style : 'color: #DC143C;'},
  136. {field: 'is_show', title: '状态', templet: '#is_show', align: 'center'},
  137. {field: 'rise', title: '涨幅%', templet: '#rise', align: 'center'},
  138. {field: 'deduct', title: '扣除%', templet: '#deduct', align: 'center'},
  139. {field: 'give', title: '赠送%', templet: '#deduct', align: 'center'},
  140. {field: 'sort', title: '排序', templet: '#sort', align: 'center'},
  141. {field: 'time', title: '挂售时间', templet: '#time', align: 'center'},
  142. {field: 'frozen', title: '冻结状态', templet: '#frozen', align: 'center'},
  143. {field: 'create_time', title: '创建时间', templet: '#create_time', align: 'center'},
  144. {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '10%'},
  145. ];
  146. });
  147. //点击事件绑定
  148. layList.tool(function (event,data,obj) {
  149. switch (event) {
  150. case 'delete':
  151. var url=layList.U({c:'auction.auction_product',a:'delete',q:{id:data.id}});
  152. var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
  153. $eb.$swal('delete',function(){
  154. $eb.axios.get(url).then(function(res){
  155. if(res.status == 200 && res.data.code == 200) {
  156. $eb.$swal('success',res.data.msg);
  157. obj.del();
  158. location.reload();
  159. }else
  160. return Promise.reject(res.data.msg || '删除失败')
  161. }).catch(function(err){
  162. $eb.$swal('error',err);
  163. });
  164. },code)
  165. break;
  166. case 'open_image':
  167. $eb.openImage(data.image);
  168. break;
  169. case 'edit':
  170. layList.createModalFrame(data.name+'-修改',layList.U({a:'edit',q:{id:data.id}}),{h:750,w:1300})
  171. break;
  172. case 'fz':
  173. layList.createModalFrame(data.name+'-复制',layList.U({a:'fz',q:{id:data.id}}),{h:750,w:1300})
  174. break;
  175. }
  176. })
  177. //查询
  178. layList.search('search',function(where){
  179. console.log(111);
  180. layList.reload(where,true);
  181. });
  182. //改状态
  183. layList.switch('is_show',function (odj,value) {
  184. if(odj.elem.checked==true){
  185. layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_status',p:{status:1,id:value}}),function (res) {
  186. layList.msg(res.msg, function () {
  187. layList.reload();
  188. });
  189. });
  190. }else{
  191. layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_status',p:{status:0,id:value}}),function (res) {
  192. layList.msg(res.msg, function () {
  193. layList.reload();
  194. });
  195. });
  196. }
  197. });
  198. //改状态
  199. layList.switch('frozen',function (odj,value) {
  200. if(odj.elem.checked==true){
  201. layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_frozen',p:{status:1,id:value}}),function (res) {
  202. layList.msg(res.msg, function () {
  203. layList.reload();
  204. });
  205. });
  206. }else{
  207. layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_frozen',p:{status:0,id:value}}),function (res) {
  208. layList.msg(res.msg, function () {
  209. layList.reload();
  210. });
  211. });
  212. }
  213. });
  214. </script>
  215. {/block}