shaky.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  6. <title>下载APP</title>
  7. <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
  8. <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
  9. <link rel="stylesheet" href="../static/css/maJiaBaoGoApp.css">
  10. <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
  11. <script src="../static/js/vender/toastr/toastr.min.js"></script>
  12. <script src="../static/js/vender/config.js"></script>
  13. <style>
  14. .code-container {
  15. background: url(../static/img/shaky/bg.png);
  16. background-repeat: no-repeat;
  17. background-size: 7.5rem 100vh;
  18. }
  19. .btn-content {
  20. position: absolute;
  21. bottom: 42.6vh;
  22. left: 2.12rem;
  23. }
  24. .btn-active {
  25. position: absolute;
  26. bottom: 48.5vh;
  27. left: 2.12rem;
  28. }
  29. .download-app{
  30. width: 3.26rem;
  31. height: 0.88rem;
  32. }
  33. </style>
  34. </head>
  35. <body>
  36. <div class="code-container">
  37. <div class="btn-content" id="js_btn">
  38. <img class="download-app" src="../static/img/shaky/btn.png" />
  39. </div>
  40. <div class="mask">
  41. <div class="point">
  42. <img class="point-img" src="../static/img/point.png" />
  43. </div>
  44. </div>
  45. </div>
  46. <script>
  47. toastr.options.positionClass = 'toast-center-center';
  48. toastr.options.timeOut = '1500';
  49. </script>
  50. <script type="text/javascript">
  51. let timer,flag = true;
  52. var url = window.location.href;
  53. url = url.split('/')
  54. // var baseUrl = 'https://test.androidscloud.com/'
  55. var loc = window.location.search,
  56. n1 = loc.length,//地址的总长度
  57. n2 = loc.indexOf("="),//取得=号的位置
  58. id = loc.substr(n2 + 1, n1 - n2),//从=号后面的内容
  59. u = navigator.userAgent,
  60. isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
  61. isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
  62. //长屏判断
  63. if(document.documentElement.clientHeight > 736){
  64. const codeContainer = document.getElementsByClassName('code-container')[0];
  65. codeContainer.style.background = 'url(../static/img/shaky/iphonex-bg.png)';
  66. codeContainer.style.backgroundRepeat = 'no-repeat';
  67. codeContainer.style.backgroundSize = '7.5rem 100vh';
  68. const btnContent = document.getElementsByClassName('btn-content')[0];
  69. btnContent.className = 'btn-active';
  70. }
  71. //埋点
  72. if(isAndroid){
  73. operate('中秋活动落地页');
  74. }
  75. if(isiOS){
  76. operate('中秋活动落地页');
  77. }
  78. function operate(pointName,type){
  79. $.ajax({
  80. url: baseUrl + '/api/public/v1/systemBuriedPoint/stat',
  81. type: 'post',
  82. data:JSON.stringify({
  83. pointName: pointName
  84. }),
  85. contentType:"application/json",
  86. dataType: 'json',
  87. cache: false,
  88. success: function (res) {
  89. if(isAndroid && type === 'click'){
  90. getAppDownload();
  91. }
  92. },
  93. })
  94. }
  95. //点击下载APP
  96. $('#js_btn')[0].addEventListener('click',()=>{
  97. var ua = navigator.userAgent.toLowerCase();
  98. if(ua.match(/MicroMessenger/i)=="micromessenger" || ua.match(/QQ\/[0-9]/i)){
  99. $('.point').animate({top: '0.1rem'},"fast");
  100. $('.mask').css('background','rgba(0,0,0,0.7)');
  101. $('.mask').show();
  102. document.documentElement.style.overflow='hidden';
  103. }else if(isAndroid){
  104. operate('中秋活动落地页-安卓','click');
  105. }else if(isiOS){
  106. operate('中秋活动落地页-iOS');
  107. window.location.href = 'https://www.pgyer.com/gemini6';
  108. }else{
  109. operate('中秋活动落地页-安卓','click');
  110. }
  111. },false);
  112. //调用下载接口
  113. function getAppDownload(){
  114. $.ajax({
  115. url: baseUrl + '/api/user/v1/ditchClient/addChannelAppDownload',
  116. type: 'post',
  117. data:JSON.stringify({
  118. code:"j2Di592n8374",
  119. type: "5",
  120. platform:"1",
  121. version:""
  122. }),
  123. contentType: "application/json",
  124. dataType: 'json',
  125. cache: false,
  126. success: function (res) {
  127. if(res.status === 0){
  128. window.location.href = 'https://wjzx.androidscloud.com:9091/file-center/fileOperate/downloadFile?id=573420181';
  129. }else{
  130. stopManyClick(() =>{
  131. toastr.error(res.msg)
  132. })
  133. }
  134. },
  135. })
  136. }
  137. //防止提示一秒内重复显示
  138. function stopManyClick(fn) {
  139. if (flag) {
  140. fn();
  141. }
  142. flag = false;
  143. if(timer){clearTimeout(timer);}
  144. timer = setTimeout(() => {flag = true}, 1500);
  145. }
  146. </script>
  147. </body>
  148. </html>