resource.tpl 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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({{.Player_id}}, {{.Item_id}})">
  15. <div class="x-body layui-anim layui-anim-up">
  16. <blockquote class="layui-elem-quote">
  17. 玩家ID:<input id="player_id" type="text" />
  18. 资源ID:<input id="item_id" type="text" />
  19. <br>
  20. 开始时间:
  21. <input type="date" id="start_time" name="trip-start" value={{.Start_time}} min="2018-01-01 00:00:00" max="2018-12-31 00:00:00" />
  22. 结束时间:
  23. <input type="date" id="end_time" name="trip-start" value={{.End_time}} min="2018-01-01 23:59:59" max="2018-12-31 23:59:59" />
  24. <br>
  25. <br>
  26. <input class="layui-btn" type="button" onclick="submitUpdate()" value=查询>
  27. <input class="layui-btn" type="button" onclick="submitDownload()" value=下载>
  28. </blockquote>
  29. </div>
  30. <table border="1">
  31. <thead>
  32. <th style="width:256px;">时间</th>
  33. <th style="width:128px;">玩家ID</th>
  34. <th style="width:256px;">事件ID</th>
  35. <th style="width:100px;">物品ID</th>
  36. <th style="width:100px;">变化数量</th>
  37. <th style="width:128px;">变化后剩余数量</th>
  38. </thead>
  39. <tbody>
  40. {{range .Events}}
  41. <tr>
  42. <td style = "text-align:center;">{{.EventTime}}</td>
  43. <td style = "text-align:center;">{{.Uid}}</td>
  44. <td style = "text-align:center;">{{.Event}}</td>
  45. <td style = "text-align:center;">{{.ItemId}}</td>
  46. <td style = "text-align:center;">{{.DeltaCount}}</td>
  47. <td style = "text-align:center;">{{.RemainCount}}</td>
  48. </tr>
  49. {{end}}
  50. </tbody>
  51. </table>
  52. <script language="JavaScript">
  53. function InitParams(PlayerId, ItemId) {
  54. if (PlayerId == null || PlayerId.length == 0) {
  55. PlayerId = "1000000"
  56. }
  57. document.getElementById("player_id").value = PlayerId;
  58. if (ItemId > 0) {
  59. document.getElementById("item_id").value = ItemId;
  60. }
  61. }
  62. function submitUpdate () {
  63. var uid = document.getElementById("player_id").value;
  64. var item_id = document.getElementById("item_id").value;
  65. var start_time = document.getElementById("start_time").value;
  66. var end_time = document.getElementById("end_time").value;
  67. var text = "uid=" + encodeURI(uid) + "&item_id=" + encodeURI(item_id) + "&start_time=" + encodeURI(start_time) + "&end_time=" + encodeURI(end_time) + "&action=query";
  68. $.ajax({
  69. type:"get",
  70. url:"/resource?" + text,
  71. success:function (data) {
  72. // alert(data.status);
  73. if (data.status){
  74. window.location.href="/resource?"+text;
  75. if (data.info){
  76. layer.msg(data.info,{icon:1,time:1000});
  77. }
  78. }else{
  79. if (data.info){
  80. alert(data.info);
  81. }else{
  82. window.location.href="/resource?"+text;
  83. }
  84. }
  85. }
  86. });
  87. }
  88. function submitDownload () {
  89. var uid = document.getElementById("player_id").value;
  90. var item_id = document.getElementById("item_id").value;
  91. var start_time = document.getElementById("start_time").value;
  92. var end_time = document.getElementById("end_time").value;
  93. var text = "uid=" + encodeURI(uid) + "&item_id=" + encodeURI(item_id) + "&start_time=" + encodeURI(start_time) + "&end_time=" + encodeURI(end_time) + "&querydata=resource";
  94. $.ajax({
  95. type:"get",
  96. url:"/resource?" + text,
  97. success:function (data) {
  98. // alert(data.status);
  99. if (data.status){
  100. window.location.href="/resource?"+text;
  101. if (data.info){
  102. layer.msg(data.info,{icon:1,time:1000});
  103. }
  104. }else{
  105. if (data.info){
  106. alert(data.info);
  107. }else{
  108. window.location.href="/resource?"+text;
  109. }
  110. }
  111. }
  112. });
  113. }
  114. </script>
  115. </body>
  116. </html>