index.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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="bd">
  40. <option value=" ">全部</option>
  41. <option value="1">未绑定</option>
  42. <option value="2">已绑定</option>
  43. </select>
  44. </div>
  45. </div>
  46. <div class="layui-inline">
  47. <div class="layui-input-inline">
  48. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
  49. <i class="layui-icon layui-icon-search"></i>搜索</button>
  50. </div>
  51. </div>
  52. </div>
  53. </form>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <!-- 中间详细信息-->
  59. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  60. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  61. </div>
  62. <!--enb-->
  63. </div>
  64. <!--列表-->
  65. <div class="layui-row layui-col-space15">
  66. <div class="layui-col-md12">
  67. <div class="layui-card">
  68. <div class="layui-card-header">场次列表</div>
  69. <div class="layui-card-body">
  70. <div class="layui-btn-container conrelTable" id="container-action">
  71. <a class="layui-btn layui-btn-sm" onclick="$eb.createModalFrame(this.innerText,'{:Url('code')}?id={$id}',{h:350,w:400})">生成兑换码</a>
  72. <button class="layui-btn layui-btn-sm layui-btn-normal" type="button" data-type="set_grant"><i class="fa fa-check-circle-o"></i>绑定</button>
  73. <!-- <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
  74. </div>
  75. <table class="layui-hide" id="List" lay-filter="List"></table>
  76. <script type="text/html" id="image">
  77. <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}">
  78. </script>
  79. <script type="text/html" id="status">
  80. {{# if(d.status == 0){ }}
  81. <button type="button" name="suc" class="layui-btn-disabled layui-btn-xs" id="">
  82. 关闭
  83. </button>
  84. {{# } else if(d.status == 1) { }}
  85. <button type="button" name="suc" class="layui-btn-xs layui-btn" id="">
  86. 开启
  87. </button>
  88. {{# } }}
  89. </script>>
  90. <script type="text/html" id="act">
  91. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
  92. 删除
  93. </button>
  94. </script>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. <!--end-->
  100. </div>
  101. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  102. {/block}
  103. {block name="script"}
  104. <script>
  105. layList.form.render();
  106. layList.tableList('List', "{:Url('list')}?id={$id}", function () {
  107. return [
  108. {type: 'checkbox'},
  109. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  110. {field: 'code', title: '兑换码', align: 'center'},
  111. {field: 'nickname', title: '发放人', align: 'center'},
  112. {field: 'end_time', title: '使用时间', align: 'center'},
  113. {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '15%'},
  114. ];
  115. });
  116. //查询
  117. layList.search('search',function(where){
  118. layList.reload(where,true);
  119. });
  120. //点击事件绑定
  121. layList.tool(function (event,data,obj) {
  122. switch (event) {
  123. case 'delete':
  124. var url=layList.U({c:'store.product_code',a:'delete',q:{id:data.id}});
  125. var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
  126. $eb.$swal('delete',function(){
  127. $eb.axios.get(url).then(function(res){
  128. if(res.status == 200 && res.data.code == 200) {
  129. $eb.$swal('success',res.data.msg);
  130. obj.del();
  131. location.reload();
  132. }else
  133. return Promise.reject(res.data.msg || '删除失败')
  134. }).catch(function(err){
  135. $eb.$swal('error',err);
  136. });
  137. },code)
  138. break;
  139. case 'open_image':
  140. $eb.openImage(data.image);
  141. break;
  142. case 'edit':
  143. location.href = layList.U({a:'edit',q:{id:data.id}});
  144. break;
  145. }
  146. })
  147. var action={
  148. set_grant:function () {
  149. var ids=layList.getCheckData().getIds('id');
  150. if(ids.length){
  151. var str = ids.join(',');
  152. $eb.createModalFrame('绑定兑换码',layList.Url({c:'store.product_code',a:'grant',p:{id:str}}),{'w':500});
  153. }else{
  154. layList.msg('请选择要发送兑换码的会员');
  155. }
  156. },
  157. };
  158. $('.conrelTable').find('button').each(function () {
  159. var type=$(this).data('type');
  160. $(this).on('click',function () {
  161. action[type] && action[type]();
  162. })
  163. })
  164. //改状态
  165. layList.switch('status',function (odj,value) {
  166. if(odj.elem.checked==true){
  167. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:1,id:value}}),function (res) {
  168. layList.msg(res.msg, function () {
  169. layList.reload();
  170. });
  171. });
  172. }else{
  173. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:0,id:value}}),function (res) {
  174. layList.msg(res.msg, function () {
  175. layList.reload();
  176. });
  177. });
  178. }
  179. });
  180. </script>
  181. {/block}