安卓和iOS统一下载页面 - 刘曙尘

时间:2024-02-25 08:50:57

安卓和iOS统一下载页面

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>二维码下载</title>
</head>

<body>
  <div class="download">
    <img src="./img/512.png" alt="" class="downloadimg">
    <p class="downloadtextNews">海屯天地</p>
    <p class="downloadtext">请您耐心等待,页面加载中...</p>
  </div>

  <script>
    window.onload = function () {
      //写具体的逻辑代码
	  if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
        window.location = "https://apps.apple.com/cn/app/%E6%B5%B7%E5%B1%AF%E5%A4%A9%E5%9C%B0/id1476184172?uo=4";
      } else (/android/i.test(navigator.userAgent)) {
        window.location = "https://www.baidu.com";
      }
    }
  </script>

  <style>
    .download {
      background: #fff;
      padding-bottom: 12rem;
      font-size: .75rem;

    }

    .downloadimg {
      width: 200px;
      height: 200px;
      display: block;
      margin: 80px auto;
    }

    .downloadtextNews {
      text-align: center;
      font-size: 28px;
      position: relative;
      top: -60px;
    }

    .downloadtext {
      font-size: 16px;
      text-align: center;
      line-height: 30px;
    }
  </style>
</body>

</html>