maJiaBaoGoApp.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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="top-Text">
  17. <img class="img-container" src="../static/img/maJiaBaoGoAppText.png" />
  18. </div>
  19. <div class="btn-content">
  20. <img class="download-app" src="../static/img/downLoadApp.png" />
  21. <img class="download-text" src="../static/img/downLoadText.png" />
  22. </div>
  23. </div>
  24. <script>
  25. toastr.options.positionClass = 'toast-center-center';
  26. toastr.options.timeOut = '1500';
  27. </script>
  28. <script type="text/javascript">
  29. // var baseUrl = 'http://14.215.128.96/'
  30. let timer,flag = true;
  31. var url = window.location.href;
  32. url = url.split('/')
  33. var loc = window.location.search,
  34. n1 = loc.length,//地址的总长度
  35. n2 = loc.indexOf("="),//取得=号的位置
  36. id = loc.substr(n2 + 1, n1 - n2),//从=号后面的内容
  37. u = navigator.userAgent,
  38. isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
  39. isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
  40. //埋点
  41. (function (){
  42. $.ajax({
  43. url: baseUrl + '/api/public/v1/game/user/operate',
  44. type: 'post',
  45. headers: {
  46. 'Authorization': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyYW5kb20iOiIwNDM1MyIsImNsaWVudCI6IjIiLCJleHAiOjE2MzEwNjc1NDksInVzZXJuYW1lIjoiQ3Fvd3QxNjAzMjYyMjU4In0.kaqR4ObPdr336zkr26xdrdmOlPgI9xych2qJ2pSd1lI' //id
  47. },
  48. data:JSON.stringify({
  49. accessType: 4,
  50. entrance: 3,
  51. url: window.location.href
  52. }),
  53. contentType:"application/json",
  54. dataType: 'json',
  55. cache: false,
  56. success: function (res) {
  57. console.log(res)
  58. },
  59. })
  60. })();
  61. $('.btn-content')[0].addEventListener('click',getAppDownload,false);
  62. //点击下载APP
  63. function getAppDownload(){
  64. $.ajax({
  65. url: baseUrl + '/api/user/v1/ditchClient/addChannelAppDownload',
  66. type: 'post',
  67. data:JSON.stringify({
  68. code:"Q4796f4k26ST",
  69. platform:"1",
  70. version:""
  71. }),
  72. contentType: "application/json",
  73. dataType: 'json',
  74. cache: false,
  75. success: function (res) {
  76. if(res.status === 0){
  77. }else{
  78. stopManyClick(() =>{
  79. toastr.error(res.msg)
  80. })
  81. }
  82. },
  83. })
  84. }
  85. //防止提示一秒内重复显示
  86. function stopManyClick(fn) {
  87. if (flag) {
  88. fn();
  89. }
  90. flag = false;
  91. if(timer){clearTimeout(timer);}
  92. timer = setTimeout(() => {flag = true}, 1500);
  93. }
  94. </script>
  95. </body>
  96. </html>