shuangzixingGoApp.html 3.7 KB

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