orderquery.tpl 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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}}, {{.Player_name}})">
  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. 玩家昵称:<input id="player_name" type="text" />
  19. <br>
  20. 开始时间:<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" />
  21. 结束时间:<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" />
  22. <br>
  23. <h1 id="today_charge" value = "">
  24. <span id ="cur_charge" style="font-size:20px;"> 当日充值 : 0 </span>
  25. </h1>
  26. <h1 id="total_charge" value = "">
  27. <span id ="tol_charge" style="font-size:20px;"> 累计充值 : 0 </span>
  28. </h1>
  29. <br>
  30. <input class="layui-btn" type="button" onclick="submitUpdate()" value=查询>
  31. <input class="layui-btn" type="button" onclick="submitDownload()" value=下载>
  32. </blockquote>
  33. </div>
  34. <table border="1">
  35. <thead>
  36. <th style="width:256px;">时间</th>
  37. <th style="width:128px;">玩家ID</th>
  38. <th style="width:128px;">玩家昵称</th>
  39. <th style="width:256px;">订单ID</th>
  40. <th style="width:150px;">商品ID</th>
  41. <th style="width:150px;">价格(美分)</th>
  42. <th style="width:128px;">购买数量</th>
  43. </thead>
  44. <tbody>
  45. {{range .Events}}
  46. <tr>
  47. <td style = "text-align:center;">{{.EventTime}}</td>
  48. <td style = "text-align:center;">{{.Uid}}</td>
  49. <td style = "text-align:center;">{{.Name}}</td>
  50. <td style = "text-align:center;">{{.OrderId}}</td>
  51. <td style = "text-align:center;">{{.GoodsId}}</td>
  52. <td style = "text-align:center;">{{.Price}}</td>
  53. <td style = "text-align:center;">{{.BuyCount}}</td>
  54. </tr>
  55. {{end}}
  56. </tbody>
  57. </table>
  58. <script language="JavaScript">
  59. var TodayCharge = {{.Cur_charge}};
  60. var TotalCharge = {{.Tol_charge}};
  61. updateCharge(TodayCharge,TotalCharge)
  62. function InitParams(PlayerId, PlayerName) {
  63. if (PlayerId == 0) {
  64. PlayerId = "1000000"
  65. }
  66. document.getElementById("player_id").value = PlayerId;
  67. if (PlayerName.length > 0) {
  68. document.getElementById("player_name").value = PlayerName;
  69. }
  70. }
  71. function submitUpdate () {
  72. var uid = document.getElementById("player_id").value;
  73. var name = document.getElementById("player_name").value;
  74. var start_time = document.getElementById("start_time").value;
  75. var end_time = document.getElementById("end_time").value;
  76. var text = "uid=" + encodeURI(uid) + "&name=" + encodeURI(name) + "&start_time=" + encodeURI(start_time) + "&end_time=" + encodeURI(end_time) + "&action=query";
  77. $.ajax({
  78. type:"get",
  79. url:"/orderquery?" + text,
  80. success:function (data) {
  81. // alert(data.status);
  82. if (data.status){
  83. window.location.href="/orderquery?"+text;
  84. }else{
  85. if (data.info){
  86. alert(data.info);
  87. }else{
  88. window.location.href="/orderquery?"+text;
  89. }
  90. }
  91. }
  92. });
  93. }
  94. function submitDownload () {
  95. var uid = document.getElementById("player_id").value;
  96. var name = document.getElementById("player_name").value;
  97. var start_time = document.getElementById("start_time").value;
  98. var end_time = document.getElementById("end_time").value;
  99. var text = "uid=" + encodeURI(uid) + "&name=" + encodeURI(name) + "&start_time=" + encodeURI(start_time) + "&end_time=" + encodeURI(end_time) + "&querydata=orderquery";
  100. $.ajax({
  101. type:"get",
  102. url:"/orderquery?" + text,
  103. success:function (data) {
  104. // alert(data.status);
  105. if (data.status){
  106. window.location.href="/orderquery?"+text;
  107. }else{
  108. if (data.info){
  109. alert(data.info);
  110. }else{
  111. window.location.href="/orderquery?"+text;
  112. }
  113. }
  114. }
  115. });
  116. }
  117. function updateCharge (today,total) {
  118. document.getElementById('cur_charge').innerText="当日充值: "+today+"美分";
  119. document.getElementById('tol_charge').innerText="累计充值: "+total+"美分";
  120. }
  121. </script>
  122. </body>
  123. </html>