shuangzixingGoApp.html 3.6 KB

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