index.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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. <div class="layui-col-lg12">
  38. <label class="layui-form-label" style="top: -5.5px;">搜索条件</label>
  39. <div class="layui-input-inline">
  40. <input type="text" id="auction" name="name" class="layui-input" placeholder="请输入昵称">
  41. </div>
  42. </div>
  43. </div>
  44. <div class="layui-inline">
  45. <label class="layui-form-label" style="top: -4.5px">状态</label>
  46. <div class="layui-input-block">
  47. <select name="status">
  48. <option value="">全部</option>
  49. <option value="1">正常</option>
  50. <option value="2">待核销</option>
  51. <option value="3">已核销</option>
  52. <option value="4">未完成</option>
  53. </select>
  54. </div>
  55. </div>
  56. <div class="layui-inline">
  57. <div class="layui-input-inline">
  58. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
  59. <i class="layui-icon layui-icon-search"></i>搜索</button>
  60. </div>
  61. </div>
  62. </div>
  63. </form>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <!-- 中间详细信息-->
  69. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  70. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  71. </div>
  72. <!--enb-->
  73. </div>
  74. <!--列表-->
  75. <div class="layui-row layui-col-space15">
  76. <div class="layui-col-md12">
  77. <div class="layui-card">
  78. <div class="layui-card-header">出局奖励列表</div>
  79. <div class="layui-card-body">
  80. <div class="layui-btn-container" id="container-action">
  81. <!-- <a class="layui-btn layui-btn-sm" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}',{h:700,w:1100})">添加出局奖励</a>-->
  82. <!-- <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
  83. </div>
  84. <table class="layui-hide" id="List" lay-filter="List"></table>
  85. <script type="text/html" id="status">
  86. {{# if(d.status == -1){ }}
  87. <button type="button" class="layui-btn layui-btn-primary layui-btn-xs" style="color: red">未完成</button>
  88. {{# } }}
  89. {{# if(d.status == 0){ }}
  90. <button type="button" class="layui-btn layui-btn-primary layui-btn-xs">正常</button>
  91. {{# } }}
  92. {{# if(d.status == 1){ }}
  93. <button type="button" class="layui-btn layui-btn-primary layui-btn-xs" style="color: #00b7ee">待核销</button>
  94. {{# } }}
  95. {{# if(d.status == 2){ }}
  96. <button type="button" class="layui-btn layui-btn-primary layui-btn-xs" style="color: yellowgreen">已核销</button>
  97. {{# } }}
  98. </script>
  99. <script type="text/html" id="act">
  100. {{# if(d.status == 0){ }}
  101. <button type="button" class="layui-btn layui-btn-xs layui-btn-warm" lay-event='hx' id="">
  102. 核销
  103. </button>
  104. <button type="button" class="layui-btn layui-btn-xs layui-btn-warm" lay-event='wwc' id="">
  105. 未完成
  106. </button>
  107. {{# } }}
  108. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
  109. 删除
  110. </button>
  111. </script>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <!--end-->
  117. </div>
  118. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  119. {/block}
  120. {block name="script"}
  121. <script>
  122. layList.form.render();
  123. layList.tableList('List', "{:Url('list')}", function () {
  124. return [
  125. {type: 'checkbox'},
  126. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  127. {field: 'uid', title: 'UID', align: 'center'},
  128. {field: 'nickname', title: '用户昵称', align: 'center'},
  129. {field: 'name', title: '出局名称', align: 'center'},
  130. {field: 'status', title: '状态', templet: '#status', align: 'center'},
  131. {field: 'number', title: '达标额度', align: 'center'},
  132. {field: 'money', title: '累计金额', align: 'center'},
  133. {field: 'create_time', title: '参与时间', align: 'center'},
  134. {field: 'right', title: '操作', align: 'center', toolbar: '#act'},
  135. ];
  136. });
  137. //查询
  138. layList.search('search',function(where){
  139. layList.reload(where,true);
  140. });
  141. //点击事件绑定
  142. layList.tool(function (event,data,obj) {
  143. switch (event) {
  144. case 'hx':
  145. var url=layList.U({c:'user.user_partake',a:'set_status',q:{id:data.id,status:2}});
  146. var code = {title:"操作提示",text:"确定核销吗?",type:'info',confirm:'是的'};
  147. $eb.$swal('delete',function(){
  148. $eb.axios.get(url).then(function(res){
  149. if(res.status == 200 && res.data.code == 200) {
  150. $eb.$swal('success',res.data.msg);
  151. location.reload();
  152. }else
  153. return Promise.reject(res.data.msg || '失败')
  154. }).catch(function(err){
  155. $eb.$swal('error',err);
  156. });
  157. },code)
  158. break;
  159. case 'wwc':
  160. var url=layList.U({c:'user.user_partake',a:'set_status',q:{id:data.id,status:-1}});
  161. var code = {title:"操作提示",text:"确定未完成吗?",type:'info',confirm:'是的'};
  162. $eb.$swal('delete',function(){
  163. $eb.axios.get(url).then(function(res){
  164. if(res.status == 200 && res.data.code == 200) {
  165. $eb.$swal('success',res.data.msg);
  166. location.reload();
  167. }else
  168. return Promise.reject(res.data.msg || '失败')
  169. }).catch(function(err){
  170. $eb.$swal('error',err);
  171. });
  172. },code)
  173. break;
  174. case 'delete':
  175. var url=layList.U({c:'user.user_partake',a:'delete',q:{id:data.id}});
  176. var code = {title:"操作提示",text:"确定将移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
  177. $eb.$swal('delete',function(){
  178. $eb.axios.get(url).then(function(res){
  179. if(res.status == 200 && res.data.code == 200) {
  180. $eb.$swal('success',res.data.msg);
  181. obj.del();
  182. location.reload();
  183. }else
  184. return Promise.reject(res.data.msg || '删除失败')
  185. }).catch(function(err){
  186. $eb.$swal('error',err);
  187. });
  188. },code)
  189. break;
  190. case 'open_image':
  191. $eb.openImage(data.image);
  192. break;
  193. case 'edit':
  194. location.href = layList.U({a:'edit',q:{id:data.id}});
  195. break;
  196. }
  197. })
  198. //改状态
  199. layList.switch('status',function (odj,value) {
  200. if(odj.elem.checked==true){
  201. layList.baseGet(layList.Url({c:'user.out',a:'set_status',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:'user.out',a:'set_status',p:{status:0,id:value}}),function (res) {
  208. layList.msg(res.msg, function () {
  209. layList.reload();
  210. });
  211. });
  212. }
  213. });
  214. </script>
  215. {/block}