shaky.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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: 5.52rem;
  22. left: 2.12rem;
  23. }
  24. .download-app{
  25. width: 3.26rem;
  26. height: 0.88rem;
  27. }
  28. </style>
  29. </head>
  30. <body>
  31. <div class="code-container">
  32. <div class="btn-content">
  33. <img class="download-app" src="../static/img/shaky/btn.png" />
  34. </div>
  35. <div class="mask">
  36. <div class="point">
  37. <img class="point-img" src="../static/img/point.png" />
  38. </div>
  39. </div>
  40. </div>
  41. <script>
  42. toastr.options.positionClass = 'toast-center-center';
  43. toastr.options.timeOut = '1500';
  44. </script>
  45. <script type="text/javascript">
  46. let timer,flag = true;
  47. var url = window.location.href;
  48. url = url.split('/')
  49. var loc = window.location.search,
  50. n1 = loc.length,//地址的总长度
  51. n2 = loc.indexOf("="),//取得=号的位置
  52. id = loc.substr(n2 + 1, n1 - n2),//从=号后面的内容
  53. u = navigator.userAgent,
  54. isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
  55. isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
  56. //埋点
  57. if(isAndroid){
  58. operate('中秋活动落地页');
  59. }
  60. if(isiOS){
  61. operate('中秋活动落地页');
  62. }
  63. function operate(pointName,type){
  64. $.ajax({
  65. url: baseUrl + '/api/public/v1/systemBuriedPoint/stat',
  66. type: 'post',
  67. data:JSON.stringify({
  68. pointName: pointName
  69. }),
  70. contentType:"application/json",
  71. dataType: 'json',
  72. cache: false,
  73. success: function (res) {
  74. if(isAndroid && type === 'click'){
  75. getAppDownload();
  76. }
  77. },
  78. })
  79. }
  80. //点击下载APP
  81. $('.btn-content')[0].addEventListener('click',()=>{
  82. var ua = navigator.userAgent.toLowerCase();
  83. if(ua.match(/MicroMessenger/i)=="micromessenger" || ua.match(/QQ\/[0-9]/i)){
  84. $('.point').animate({top: '0.1rem'},"fast");
  85. $('.mask').css('background','rgba(0,0,0,0.7)');
  86. $('.mask').show();
  87. document.documentElement.style.overflow='hidden';
  88. }else if(isAndroid){
  89. operate('中秋活动落地页-安卓','click');
  90. }else if(isiOS){
  91. operate('中秋活动落地页-iOS');
  92. window.location.href = 'https://www.pgyer.com/gemini6';
  93. }
  94. },false);
  95. //调用下载接口
  96. function getAppDownload(){
  97. $.ajax({
  98. url: baseUrl + '/api/user/v1/ditchClient/addChannelAppDownload',
  99. type: 'post',
  100. data:JSON.stringify({
  101. code:"j2Di592n8374",
  102. type: "5",
  103. platform:"1",
  104. version:""
  105. }),
  106. contentType: "application/json",
  107. dataType: 'json',
  108. cache: false,
  109. success: function (res) {
  110. if(res.status === 0){
  111. window.location.href = 'http://wjzx.androidscloud.com:9090/file-center/fileOperate/downloadFile?id=573420181';
  112. }else{
  113. stopManyClick(() =>{
  114. toastr.error(res.msg)
  115. })
  116. }
  117. },
  118. })
  119. }
  120. //防止提示一秒内重复显示
  121. function stopManyClick(fn) {
  122. if (flag) {
  123. fn();
  124. }
  125. flag = false;
  126. if(timer){clearTimeout(timer);}
  127. timer = setTimeout(() => {flag = true}, 1500);
  128. }
  129. </script>
  130. </body>
  131. </html>