bts.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. {include file="common/header"/}
  2. <style>
  3. .upload-wrap {
  4. position: relative;
  5. display: inline-block;
  6. overflow: hidden;
  7. border: 1px solid #2d78f4;
  8. border-radius: 3px;
  9. }
  10. .upload-wrap .file-ele {
  11. position: absolute;
  12. top: 0;
  13. right: 0;
  14. opacity: 0;
  15. height: 100%;
  16. width: 100%;
  17. cursor: pointer;
  18. }
  19. .upload-wrap .file-open {
  20. width: 90px;
  21. height: 30px;
  22. line-height: 30px;
  23. text-align: center;
  24. color: #fff;
  25. background: #3385ff;
  26. }
  27. </style>
  28. <div class="LM-container">
  29. <div class="LM-main">
  30. <fieldset class="layui-elem-field layui-field-title">
  31. <legend>bts管理</legend>
  32. <blockquote class="layui-elem-quote">
  33. <div class="LM-table">
  34. <a href="{:url('addbts')}" class="layui-btn layui-btn-sm layui-btn-warm">添加BTS</a>
  35. </div>
  36. </blockquote>
  37. </fieldset>
  38. <table class="layui-table" id="list" lay-filter="list">
  39. </table>
  40. </div>
  41. </div>
  42. <script type="text/html" id="image">
  43. {{# layui.each(d.image, function(index, item){ }}
  44. <img src="/static/admin/images/image.gif" onmouseover="layer.tips('<img src={{item}}>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();">
  45. {{# });
  46. }}
  47. </script>
  48. <script type="text/html" id="status">
  49. <input type="checkbox" name="switch" value="{{d.id}}" lay-filter="status" lay-skin="switch" lay-text="开启|关闭" {{
  50. d.status== 0 ? 'checked' : '' }}>
  51. </script>
  52. <script type="text/html" id="barDemo">
  53. <input type="button" class="layui-btn layui-btn-xs" lay-event="del" value="删除">
  54. <a href="addbts?id={{d.id}}" class="layui-btn layui-btn-xs" >编辑</a>
  55. </script>
  56. {include file="common/footer"/}
  57. <script src="/static/plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
  58. <script>
  59. layui.use(['form', 'table'], function () {
  60. var $ = layui.jquery,
  61. form = layui.form,
  62. table = layui.table;
  63. var tableIn = table.render({
  64. elem: '#list',
  65. url: '{:url("bts")}',
  66. method: 'post',
  67. title: '反馈意见',
  68. loading: true,
  69. toolbar: '#toolbar', //开启头部工具栏,并为其绑定左侧模板
  70. defaultToolbar: ['filter', 'exports', 'print', "excel", { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
  71. title: '提示'
  72. , layEvent: 'LAYTABLE_TIPS'
  73. , icon: 'layui-icon-tips'
  74. }],
  75. cols: [[
  76. // {checkbox: true, fixed: true},
  77. {field: 'id', title: 'ID', width: 80, fixed: true, sort: true},
  78. {field: 'num', title: '数量', width: 120, sort: true},
  79. {field: 'mining', title: '矿池数量', width: 120, sort: true},
  80. {field: 'enlarge_quota', title: '放大额度', width: 120, sort: true},
  81. {field: 'ensure_money', title: '保证金', width: 120, sort: true},
  82. {field: 'tong_money', title: '通证余额 手续费', width: 120},
  83. {field: 'out_game', title: '出局手续费', width: 120},
  84. {field: 'direct_push', title: '直推获得', width: 120},
  85. {field: 'second_push', title: '次推获得', width: 120},
  86. {field: 'breach_money', title: '违约金', width: 120},
  87. {field: 'status', title: '状态', width: 120,templet:'#status'},
  88. // {field: 'status', title: '订单状态', width: 120, sort: true},
  89. {title: '操作', width: 150, align: "center", toolbar: "#barDemo"},
  90. ]],
  91. limits: [10, 15, 20, 25, 50, 100],
  92. limit: 10,
  93. page: true
  94. });
  95. table.on('tool(list)', function (obj) {
  96. var data = obj.data;
  97. let event = obj.event;
  98. switch (event) {
  99. case "del":
  100. layer.confirm('确定要删除吗', function (index) {
  101. loading = layer.load(1, {shade: [0.1, '#fff']});
  102. $.post("{:url('del_mining')}", {id: data.id}, function (res) {
  103. layer.close(loading);
  104. layer.close(index);
  105. if (res.code == 200) {
  106. layer.msg(res.msg, {time: 1000, icon: 1});
  107. tableIn.reload();
  108. } else {
  109. layer.msg(res.msg, {time: 1000, icon: 2});
  110. }
  111. }, "json")
  112. })
  113. break;
  114. }
  115. });
  116. form.on('switch(status)', function(data){
  117. loading =layer.load(1, {shade: [0.1,'#fff']});
  118. $.post("{:url('update_bts_status')}",{id:data.value},function(res){
  119. layer.close(loading);
  120. if(res.code==200){
  121. layer.msg(res.msg,{time:1000,icon:1});
  122. }else{
  123. layer.msg(res.msg,{time:1000,icon:2});
  124. }
  125. },"json");
  126. });
  127. $('#search').click(function () {
  128. var $keys = $('#name').val();
  129. if (!$keys) {
  130. return layer.msg('请输入关键词');
  131. }
  132. tableIn.reload({page: {page: 1}, where: {name: $keys}});
  133. })
  134. // setInterval(function () {
  135. // tableIn.reload();
  136. // }, 50000)
  137. });
  138. </script>