maJiaBaoGoApp.html 4.0 KB

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