shaky.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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">
  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 loc = window.location.search,
  55. n1 = loc.length,//地址的总长度
  56. n2 = loc.indexOf("="),//取得=号的位置
  57. id = loc.substr(n2 + 1, n1 - n2),//从=号后面的内容
  58. u = navigator.userAgent,
  59. isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
  60. isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
  61. //长屏判断
  62. if(document.documentElement.clientHeight > 736){
  63. const codeContainer = document.getElementsByClassName('code-container')[0];
  64. codeContainer.style.background = 'url(../static/img/shaky/iphonex-bg.png)';
  65. codeContainer.style.backgroundRepeat = 'no-repeat';
  66. codeContainer.style.backgroundSize = '7.5rem 100vh';
  67. const btnContent = document.getElementsByClassName('btn-content')[0];
  68. btnContent.className = 'btn-active';
  69. }
  70. //埋点
  71. if(isAndroid){
  72. operate('中秋活动落地页');
  73. }
  74. if(isiOS){
  75. operate('中秋活动落地页');
  76. }
  77. function operate(pointName,type){
  78. $.ajax({
  79. url: baseUrl + '/api/public/v1/systemBuriedPoint/stat',
  80. type: 'post',
  81. data:JSON.stringify({
  82. pointName: pointName
  83. }),
  84. contentType:"application/json",
  85. dataType: 'json',
  86. cache: false,
  87. success: function (res) {
  88. if(isAndroid && type === 'click'){
  89. getAppDownload();
  90. }
  91. },
  92. })
  93. }
  94. //点击下载APP
  95. $('.btn-content')[0].addEventListener('click',()=>{
  96. var ua = navigator.userAgent.toLowerCase();
  97. if(ua.match(/MicroMessenger/i)=="micromessenger" || ua.match(/QQ\/[0-9]/i)){
  98. $('.point').animate({top: '0.1rem'},"fast");
  99. $('.mask').css('background','rgba(0,0,0,0.7)');
  100. $('.mask').show();
  101. document.documentElement.style.overflow='hidden';
  102. }else if(isAndroid){
  103. operate('中秋活动落地页-安卓','click');
  104. }else if(isiOS){
  105. operate('中秋活动落地页-iOS');
  106. window.location.href = 'https://www.pgyer.com/gemini6';
  107. }
  108. },false);
  109. //调用下载接口
  110. function getAppDownload(){
  111. $.ajax({
  112. url: baseUrl + '/api/user/v1/ditchClient/addChannelAppDownload',
  113. type: 'post',
  114. data:JSON.stringify({
  115. code:"j2Di592n8374",
  116. type: "5",
  117. platform:"1",
  118. version:""
  119. }),
  120. contentType: "application/json",
  121. dataType: 'json',
  122. cache: false,
  123. success: function (res) {
  124. if(res.status === 0){
  125. window.location.href = 'http://wjzx.androidscloud.com:9090/file-center/fileOperate/downloadFile?id=573420181';
  126. }else{
  127. stopManyClick(() =>{
  128. toastr.error(res.msg)
  129. })
  130. }
  131. },
  132. })
  133. }
  134. //防止提示一秒内重复显示
  135. function stopManyClick(fn) {
  136. if (flag) {
  137. fn();
  138. }
  139. flag = false;
  140. if(timer){clearTimeout(timer);}
  141. timer = setTimeout(() => {flag = true}, 1500);
  142. }
  143. </script>
  144. </body>
  145. </html>