accountquery.tpl 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>欢迎页面-X-admin2.0</title>
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  8. <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
  9. <link rel="stylesheet" href="./static/css/font.css">
  10. <link rel="stylesheet" href="./static/css/xadmin.css">
  11. <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  12. <script src="http://code.highcharts.com/highcharts.js"></script>
  13. </head>
  14. <body onload="InitParams({{.uid}}, {{.account}})">
  15. <div class="x-body layui-anim layui-anim-up">
  16. <blockquote class="layui-elem-quote">
  17. 玩家ID:
  18. <input id="uid" type="text">
  19. <input class="layui-btn" type="button" onclick="submitQuery()" value=查询>
  20. <br>
  21. 玩家账号:
  22. <input id="account" type="text">
  23. <input class="layui-btn" type="button" onclick="submitQuery()" value=查询>
  24. <br>
  25. <br>
  26. <span id ="account_status" style="font-size:20px;"> 账号状态 : 正常 </span>
  27. <br>
  28. <input class="layui-btn" type="button" onclick="submitBan()" value=封禁>
  29. <input class="layui-btn" type="button" onclick="submitUnban()" value=解禁>
  30. </blockquote>
  31. </div>
  32. <table border="1">
  33. <thead>
  34. <th style="width:128px;">角色ID</th>
  35. <th style="width:128px;">角色昵称</th>
  36. <th style="width:256px;">账号</th>
  37. <th style="width:256px;">服务器名</th>
  38. <th style="width:150px;">服务器id</th>
  39. <th style="width:150px;">角色状态</th>
  40. <th style="width:150px;">是否在线</th>
  41. <th style="width:150px;">角色等级</th>
  42. <th style="width:200px;">角色战力</th>
  43. <th style="width:256px;">创角时间</th>
  44. <th style="width:256px;">最近登入时间</th>
  45. <th style="width:256px;">最近登出时间</th>
  46. </thead>
  47. <tbody>
  48. {{range .role_map}}
  49. <tr>
  50. <td style = "text-align:center;">{{.pid}}</td>
  51. <td style = "text-align:center;">{{.name}}</td>
  52. <td style = "text-align:center;">{{.account}}</td>
  53. <td style = "text-align:center;">{{.server_name}}</td>
  54. <td style = "text-align:center;">{{.server_id}}</td>
  55. <td style = "text-align:center;">{{.status}}</td>
  56. <td style = "text-align:center;">{{.is_online}}</td>
  57. <td style = "text-align:center;">{{.grade}}</td>
  58. <td style = "text-align:center;">{{.power}}</td>
  59. <td style = "text-align:center;">{{.create_time}}</td>
  60. <td style = "text-align:center;">{{.login_time}}</td>
  61. <td style = "text-align:center;">{{.logout_time}}</td>
  62. </tr>
  63. {{end}}
  64. </tbody>
  65. </table>
  66. <script language="JavaScript">
  67. var status = {{.account_status}};
  68. updateStatus(status)
  69. function InitParams(uid, account) {
  70. if (uid > 0) {
  71. document.getElementById("uid").value = uid;
  72. }
  73. if (account.length > 0) {
  74. document.getElementById("account").value = account;
  75. }
  76. }
  77. function submitQuery () {
  78. var uid = document.getElementById("uid").value;
  79. var account = document.getElementById("account").value;
  80. var text = "uid=" + encodeURI(uid) + "&account=" + encodeURI(account) + "&action=query";
  81. $.ajax({
  82. type:"get",
  83. url:"/accountquery?" + text,
  84. success:function (data) {
  85. // alert(data.status);
  86. if (data.status){
  87. window.location.href="/accountquery?"+text;
  88. }else{
  89. if (data.info){
  90. alert(data.info);
  91. }else{
  92. window.location.href="/accountquery?"+text;
  93. }
  94. }
  95. }
  96. });
  97. }
  98. function submitBan () {
  99. var uid = document.getElementById("uid").value;
  100. var account = document.getElementById("account").value;
  101. var text = "uid=" + encodeURI(uid) + "&account=" + encodeURI(account) + "&isban=" + encodeURI(1) + "&action=update";
  102. $.ajax({
  103. type:"put",
  104. url:"/accountquery?" + text,
  105. success:function (data) {
  106. if (data.info){
  107. alert(data.info);
  108. }
  109. window.location.href="/accountquery?"+"uid=" + encodeURI(uid) + "&account=" + encodeURI(account) + "&action=query";
  110. }
  111. });
  112. }
  113. function submitUnban () {
  114. var uid = document.getElementById("uid").value;
  115. var account = document.getElementById("account").value;
  116. var text = "uid=" + encodeURI(uid) + "&account=" + encodeURI(account) + "&isban=" + encodeURI(0) + "&action=update";
  117. $.ajax({
  118. type:"put",
  119. url:"/accountquery?" + text,
  120. success:function (data) {
  121. if (data.info){
  122. alert(data.info);
  123. }
  124. window.location.href="/accountquery?"+"uid=" + encodeURI(uid) + "&account=" + encodeURI(account) + "&action=query";
  125. }
  126. });
  127. }
  128. function updateStatus (status) {
  129. document.getElementById('account_status').innerText="账号状态 : "+status;
  130. }
  131. </script>
  132. </body>
  133. </html>