resource.tpl 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>欢迎页面-X-admin2.0</title>
  6. <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  7. <script src="http://code.highcharts.com/highcharts.js"></script>
  8. </head>
  9. <body>
  10. 玩家ID:
  11. <input id="player_id" type="text" value={{.Player_id}}>
  12. <br>
  13. 资源ID:
  14. <input id="item_id" type="text" value={{.Item_id}}>
  15. <br>
  16. 开始时间:
  17. <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" />
  18. <br>
  19. 结束时间:
  20. <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" />
  21. <br>
  22. <br>
  23. <input class="layui-btn" type="button" onclick="submitUpdate()" value=查询>
  24. <input class="layui-btn" type="button" onclick="submitDownload()" value=下载>
  25. <br>
  26. <br>
  27. <table border="1">
  28. <thead>
  29. <th style="width:256px;">时间</th>
  30. <th style="width:128px;">玩家ID</th>
  31. <th style="width:256px;">事件ID</th>
  32. <th style="width:100px;">物品ID</th>
  33. <th style="width:100px;">变化数量</th>
  34. <th style="width:128px;">变化后剩余数量</th>
  35. </thead>
  36. <tbody>
  37. {{range .Events}}
  38. <tr>
  39. <td style = "text-align:center;">{{.EventTime}}</td>
  40. <td style = "text-align:center;">{{.Uid}}</td>
  41. <td style = "text-align:center;">{{.Event}}</td>
  42. <td style = "text-align:center;">{{.ItemId}}</td>
  43. <td style = "text-align:center;">{{.DeltaCount}}</td>
  44. <td style = "text-align:center;">{{.RemainCount}}</td>
  45. </tr>
  46. {{end}}
  47. </tbody>
  48. </table>
  49. <script language="JavaScript">
  50. function submitUpdate () {
  51. var uid = document.getElementById("player_id").value;
  52. var item_id = document.getElementById("item_id").value;
  53. var start_time = document.getElementById("start_time").value;
  54. var end_time = document.getElementById("end_time").value;
  55. var text = "uid=" + encodeURI(uid) + "&item_id=" + encodeURI(item_id) + "&start_time=" + encodeURI(start_time) + "&end_time=" + encodeURI(end_time) + "&action=query";
  56. $.ajax({
  57. type:"get",
  58. url:"/resource?" + text,
  59. success:function (data) {
  60. // alert(data.status);
  61. if (data.status){
  62. window.location.href="/resource?"+text;
  63. }else{
  64. if (data.info){
  65. alert(data.info);
  66. }else{
  67. window.location.href="/resource?"+text;
  68. }
  69. }
  70. }
  71. });
  72. }
  73. function submitDownload () {
  74. var uid = document.getElementById("player_id").value;
  75. var item_id = document.getElementById("item_id").value;
  76. var start_time = document.getElementById("start_time").value;
  77. var end_time = document.getElementById("end_time").value;
  78. var text = "uid=" + encodeURI(uid) + "&item_id=" + encodeURI(item_id) + "&start_time=" + encodeURI(start_time) + "&end_time=" + encodeURI(end_time) + "&querydata=resource";
  79. $.ajax({
  80. type:"get",
  81. url:"/resource?" + text,
  82. success:function (data) {
  83. // alert(data.status);
  84. if (data.status){
  85. window.location.href="/resource?"+text;
  86. }else{
  87. if (data.info){
  88. alert(data.info);
  89. }else{
  90. window.location.href="/resource?"+text;
  91. }
  92. }
  93. }
  94. });
  95. }
  96. </script>
  97. </body>
  98. </html>