version.tpl 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>欢迎页面-X-admin2.0</title>
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  9. <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
  10. <link rel="stylesheet" href="./static/css/font.css">
  11. <link rel="stylesheet" href="./static/css/xadmin.css">
  12. <script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
  13. </head>
  14. <body onload="InitParams({{.Version}}, {{.IsCoverNext}}, {{.Adpull1}}, {{.Adpull2}}, {{.Url}})">
  15. <div class="x-body layui-anim layui-anim-up">
  16. <blockquote class="layui-elem-quote">
  17. 版本:<input id="version" type="text" name="iVersion" />
  18. <br>
  19. <br>
  20. <input class="layui-btn" type="button" onclick="submitAtom()" value=查看>
  21. <br>
  22. <br>
  23. <br>
  24. <br>
  25. 是否打开B包热更:
  26. <input id="b_hotfix" type="text" name="bHotfix">
  27. <br>
  28. adpull_1:
  29. <input id="adpull_1" type="text" name="Adpull_1">
  30. <br>
  31. adpull_2:
  32. <input id="adpull_2" type="text" name="Adpull_2">
  33. <br>
  34. B包更新地址:
  35. <input id="url" type="text" name="Url">
  36. <br>
  37. <br>
  38. <input class="layui-btn" type="button" onclick="submitUpdate()" value=更新>
  39. </blockquote>
  40. </div>
  41. </body>
  42. <script type="text/javascript">
  43. function InitParams(Version, IsCoverNext, Adpull1, Adpull2, Url) {
  44. if (Version.length > 0) {
  45. document.getElementById("version").value = Version;
  46. }
  47. if (IsCoverNext.length > 0) {
  48. document.getElementById("b_hotfix").value = IsCoverNext;
  49. }
  50. if (Adpull1.length > 0) {
  51. document.getElementById("adpull_1").value = Adpull1;
  52. }
  53. if (Adpull2.length > 0) {
  54. document.getElementById("adpull_2").value = Adpull2;
  55. }
  56. if (Url.length > 0) {
  57. document.getElementById("url").value = Url;
  58. }
  59. }
  60. function submitAtom () {
  61. var version = document.getElementById("version").value
  62. // var text = "action=get" + "&version=" + encodeURI(version)
  63. var text = "ver=" + encodeURI(version)
  64. $.ajax({
  65. type:"get",
  66. url:"/version?" + text,
  67. success:function (data) {
  68. // alert(data.status);
  69. if (data.status){
  70. window.location.href="/version?"+text;
  71. if (data.info){
  72. layer.msg(data.info,{icon:1,time:1000});
  73. }
  74. }else{
  75. if (data.info){
  76. alert(data.info);
  77. }else{
  78. window.location.href="/version?"+text;
  79. }
  80. }
  81. }
  82. });
  83. }
  84. function submitUpdate () {
  85. var version = document.getElementById("version").value;
  86. var b_hotfix = document.getElementById("b_hotfix").value;
  87. var adpull_1 = document.getElementById("adpull_1").value;
  88. var adpull_2 = document.getElementById("adpull_2").value;
  89. var url = document.getElementById("url").value;
  90. var text = "ver=" + encodeURI(version) + "&b_hotfix=" + encodeURI(b_hotfix) + "&adpull_1=" + encodeURI(adpull_1) + "&adpull_2=" + encodeURI(adpull_2) + "&url=" + encodeURI(url);
  91. $.ajax({
  92. type:"post",
  93. url:"/version?" + text,
  94. success:function (data) {
  95. // alert(data.status);
  96. if (data.status){
  97. window.location.href="/version?"+text;
  98. if (data.info){
  99. layer.msg(data.info,{icon:1,time:1000});
  100. }
  101. }else{
  102. if (data.info){
  103. alert(data.info);
  104. }else{
  105. window.location.href="/version?"+text;
  106. }
  107. }
  108. }
  109. });
  110. }
  111. </script>
  112. </html>