online.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. {{extend name="layout/content" /}
  2. {block name="header"}
  3. <title>踢下线</title>
  4. <link rel="stylesheet" href="__STATIC__/css/admin/bootstrap.min.css">
  5. <link rel="stylesheet" href="__STATIC__/css/FuzzySearch.css?v={$Think.STATIC_VERSION}">
  6. {/block} {block name="content"}
  7. <div class="x-body">
  8. <form class="layui-form" method="post">
  9. <div style="float: right;">
  10. <div class="layui-inline">
  11. <div class="layui-input-inline">
  12. <input class="layui-input" placeholder="请输入玩家名称" id="username" name="username" value="{:input('username')}">
  13. </div>
  14. </div>
  15. <div class="layui-inline">
  16. <div class="layui-input-inline FuzzySearch_Container">
  17. <div>
  18. <input type="hidden" id='gameid' name="gameid" value="{:input('gameid')}" />
  19. </div>
  20. </div>
  21. </div>
  22. <div class="layui-inline">
  23. <button class="layui-btn layui-btn-radius" lay-submit>查询</button>
  24. </div>
  25. </div>
  26. <div style="clear:both"></div>
  27. <table class="layui-table">
  28. <thead>
  29. <tr>
  30. <th>玩家id</th>
  31. <th>玩家名称</th>
  32. <th>操作</th>
  33. </tr>
  34. </thead>
  35. <tbody id="viewer_wrap">
  36. {foreach name="list" item="vo"}
  37. <tr>
  38. <td>
  39. {$vo.id ?? '暂无数据'}
  40. </td>
  41. <td>
  42. {$vo.username ?? '暂无数据'}
  43. </td>
  44. <td>
  45. {if condition="$vo.token"}
  46. <a href="javascript:;" onclick="do_downline(this, '{:url(\'downline\')}?token={:urlencode($vo.token)}')" >踢下线(仅限sdk)</a>
  47. {else/}
  48. 不在线
  49. {/if}
  50. </td>
  51. </tr>
  52. {/foreach}
  53. </tbody>
  54. </table>
  55. <div class="pager-container">
  56. <span>
  57. {$list_count}条记录
  58. </span>
  59. <!-- 无分页 -->
  60. </div>
  61. </form>
  62. </div>
  63. {/block}{block name="footer"}
  64. <script type="text/javascript" src="__STATIC__/js/admin/bootstrap.min.js" charset="utf-8"></script>
  65. <script type="text/javascript" src="__STATIC__/js/FuzzySearch.js?v={$Think.STATIC_VERSION}"></script>
  66. <script>
  67. $("#gameid").FuzzySearch({
  68. inputID : 'gameid',
  69. title : '请输入游戏名称',
  70. data :{:json_encode($game_list)},
  71. searchBtn :'J_submit',
  72. });
  73. function do_downline(obj, url) {
  74. layer.confirm('确定要踢下线吗?', {shade: 0.4}, function (index) {
  75. $.getJSON(url, function (res) {
  76. if (res.code) {
  77. layer.msg(res.msg, {
  78. icon: 1,
  79. shade: 0.4,
  80. time: 1000
  81. }, function () {
  82. location.href = res.url;
  83. });
  84. } else {
  85. layer.msg(res.msg, {
  86. icon: 1,
  87. shade: 0.4,
  88. time: 1000
  89. });
  90. }
  91. });
  92. });
  93. }
  94. </script>
  95. {/block}