0元购的下载页面、隐私条款

android-mobile.html 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>开心0元购</title>
  7. <style>
  8. * {
  9. padding: 0;
  10. margin: 0;
  11. box-sizing: border-box;
  12. }
  13. body {
  14. width: 7.5rem;
  15. }
  16. .container {
  17. position: relative;
  18. }
  19. .conbg {
  20. width: 100%;
  21. display: block;
  22. }
  23. .btn {
  24. position: absolute;
  25. top: 11.3rem;
  26. left: calc(50% + 0.15rem);
  27. transform: translateX(-50%);
  28. width: 3.1rem;
  29. height: 0.85rem;
  30. }
  31. #adr-mask {
  32. background-color: rgba(0, 0, 0, .8);
  33. width: 100%;
  34. height: 100%;
  35. z-index: 99999;
  36. left: 0px;
  37. top: 0px;
  38. position: fixed;
  39. overflow: hidden;
  40. text-align: center;
  41. }
  42. </style>
  43. </head>
  44. <body>
  45. <div class="container">
  46. <div id="adr-mask" style="display: none;">
  47. <img src="/img/arrow.png" style="margin: 1rem 0 0 2.5rem;">
  48. <p style="color: #ffffff;font-size: 23px;margin:.5rem 0 .9rem 0;">请在浏览器中打开</p>
  49. <img src="/img/know.png" onclick="closeMask()" style="CURSOR: pointer">
  50. </div>
  51. <img class="conbg" src="/img/bg-img.png" alt="">
  52. <!-- <a href="https://s3.cn-northwest-1.amazonaws.com.cn/s3.jianos.com/Zero.apk" download=""> -->
  53. <div class="btn" onclick="download()"></div>
  54. <!-- </a> -->
  55. </div>
  56. <script>
  57. var downUrl = "https://s3.cn-northwest-1.amazonaws.com.cn/s3.jianos.com/Zero.apk";
  58. function requestApi(callback) {
  59. var url = 'https://apifreego.jianos.com/app_update';
  60. var xhr = new XMLHttpRequest();
  61. xhr.open('get', url, true);
  62. xhr.setRequestHeader("content-type", "application/json");
  63. xhr.onload = () => {
  64. // console.log('xhr.response = ', xhr.response)
  65. if (xhr.status == 200) {
  66. var result = JSON.parse(xhr.response);
  67. // console.log(222,result)
  68. if (result && result.data && result.data.src) {
  69. downUrl = result.data.src;
  70. //if(callback)callback(result.src);
  71. // console.log('得到的下载地址是 = ' + downUrl)
  72. }
  73. }
  74. }
  75. xhr.onerror = () => {
  76. console.log('xhr.onerror = ', xhr)
  77. }
  78. xhr.send();
  79. }
  80. requestApi();
  81. document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
  82. function download() {
  83. var ua = window.navigator.userAgent.toLowerCase();
  84. if (ua.match(/MicroMessenger/i) == 'micromessenger') {
  85. //是微信环境,弹出遮罩
  86. document.getElementById('adr-mask').style.display = 'block';
  87. return true;
  88. } else {
  89. // TODO 这里弱网环境会有问题
  90. //不是微信环境,直接下载,
  91. window.location.href = downUrl;
  92. return false;
  93. }
  94. }
  95. function closeMask() {
  96. document.getElementById('adr-mask').style.display = 'none';
  97. }
  98. </script>
  99. </body>
  100. </html>