index.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>友期APP</title>
  7. <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
  8. </head>
  9. <style>
  10. body {
  11. font-family: "pingfang SC", "MicrosoftYaHei";
  12. font-size: 16px;
  13. -webkit-font-smoothing: antialiased;
  14. }
  15. * {
  16. -webkit-tap-highlight-color: transparent;
  17. margin: 0;
  18. padding: 0;
  19. }
  20. .bar {
  21. width: 100%;
  22. box-sizing: border-box;
  23. padding: 8px 15px;
  24. background: #ffffff;
  25. display: flex;
  26. justify-content: space-between;
  27. align-items: center;
  28. position: fixed;
  29. bottom: 0;
  30. }
  31. .bar>img {
  32. width: 90px;
  33. height: 33px;
  34. }
  35. .bar>a {
  36. /* width: 6.875rem; */
  37. padding: 0 10px;
  38. height: 2.25rem;
  39. background-image: linear-gradient(90deg, #9C6CFA, #4979FF);
  40. border-radius: 1.25rem;
  41. color: #ffffff;
  42. display: flex;
  43. justify-content: center;
  44. align-items: center;
  45. text-decoration: none;
  46. font-size: 14px;
  47. }
  48. .iphoneX {
  49. display: none;
  50. width: 100%;
  51. height: 34px;
  52. }
  53. .main {
  54. width: 100%;
  55. }
  56. .main img{
  57. width: 100%;
  58. height: auto;
  59. }
  60. </style>
  61. <body>
  62. <div class="main">
  63. <img src="./img/page.png">
  64. <div style="width: 100%;height: 49px;"></div>
  65. <div class="iphoneX"></div>
  66. </div>
  67. <div class="bar">
  68. <img src="./img/logo.png">
  69. <a href="https://friendshipout.oss-cn-shenzhen.aliyuncs.com/package/uqchat.apk" class="btn">右上角浏览器打开</a>
  70. </div>
  71. </body>
  72. <script>
  73. const baseSize = 16
  74. function setRem() {
  75. const scale = document.documentElement.clientWidth / 375
  76. document.documentElement.style.fontSize = baseSize * scale + 'px'
  77. }
  78. setRem()
  79. window.onresize = function () {
  80. setRem()
  81. }
  82. function isIPhoneX() {
  83. var u = navigator.userAgent,
  84. isX;
  85. var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  86. if (isIOS) {
  87. if (screen.height == 812 && screen.width == 375) {
  88. isX = true
  89. } else {
  90. isX = false
  91. }
  92. }
  93. return isX
  94. }
  95. if (isIPhoneX()) {
  96. document.querySelector('.bar').style.padding = "8px 15px 42px"
  97. document.querySelector('.iphoneX').style.display = "block"
  98. }
  99. let u = navigator.userAgent,
  100. ios = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
  101. a = document.querySelector('.bar>a');
  102. if (ios) {
  103. a.innerText = '下载友期APP';//下载友期APP
  104. a.setAttribute("href", "https://testflight.apple.com/join/rrmteeVy");
  105. }
  106. if (navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger") {
  107. console.log('当前环境为微信环境')
  108. }else{
  109. a.innerText = '下载友期APP';
  110. }
  111. </script>
  112. <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
  113. <script src="./js/main.js"></script>
  114. </html>