orderquery.tpl 4.4 KB

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