index.php 7.7 KB

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