below.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <div class="below-layout">
  3. <div class="content">
  4. <img :src="a" alt="" />
  5. <p>无法打开页面,请升级或更换浏览器后重新打开</p>
  6. <span>建议使用以下浏览器</span>
  7. <div class="list">
  8. <div v-for="item in items">
  9. <img :src="item.icon" />
  10. <!-- <img :src="b" /> -->
  11. <p @click="useClickHandler(item.link)">{{ item.name }}</p>
  12. </div>
  13. </div>
  14. </div>
  15. </div>
  16. </template>
  17. <script lang="ts" setup>
  18. const a = "images/err.png";
  19. const b = "images/download.png";
  20. // 识别国产操作系统逻辑(示例覆盖常见标识,可根据需要补充)
  21. function isDomesticOS() {
  22. const userAgent = navigator.userAgent.toLowerCase();
  23. const platform = navigator.platform.toLowerCase();
  24. console.log(userAgent, platform, "浏览器标识");
  25. // 统信 UOS、银河麒麟、深度 Deepin、中标麒麟等标识
  26. return (
  27. /uos|kylin|deepin|neokylin/.test(userAgent) ||
  28. /linux/.test(platform) ||
  29. /国产|中国/.test(userAgent)
  30. );
  31. }
  32. // 国产浏览器
  33. const items = isDomesticOS()
  34. ? [
  35. {
  36. name: "Chromiun",
  37. icon: "./images/browser_Chromium.png",
  38. link: "./images/browser_Chromium.png",
  39. },
  40. {
  41. name: "奇安信可信浏览器",
  42. icon: "./images/browser_Qianxin.png",
  43. link: "./images/browser_Qianxin.png",
  44. },
  45. {
  46. name: "360安全浏览器",
  47. icon: "./images/browser_360.png",
  48. link: "./images/browser_360.png",
  49. },
  50. {
  51. name: "火狐",
  52. icon: "./images/browser_Firefox.png",
  53. link: "./images/browser_Firefox.png",
  54. },
  55. ]
  56. : [
  57. {
  58. name: "Firefox",
  59. icon: "images/ff.png",
  60. link: "http://www.firefox.com.cn/",
  61. },
  62. {
  63. name: "Microsoft Edge",
  64. icon: "images/eg.png",
  65. link: "https://www.microsoft.com/en-us/edge",
  66. },
  67. // {
  68. // icon: "images/safar.png",
  69. // link: "https://www.apple.com/safari/",
  70. // },
  71. {
  72. name: "Chrome",
  73. icon: "images/chrome.png",
  74. link: "https://www.google.com/chrome/",
  75. },
  76. ];
  77. const useClickHandler = (link: string) => {
  78. return;
  79. console.log(link);
  80. window.open(link);
  81. };
  82. </script>
  83. <style lang="scss" scoped>
  84. .below-layout {
  85. position: fixed;
  86. inset: 0;
  87. background: #f7f7f7;
  88. display: flex;
  89. align-items: center;
  90. justify-content: center;
  91. .content {
  92. color: #999;
  93. text-align: center;
  94. > img {
  95. width: 200px;
  96. }
  97. p {
  98. font-size: 16px;
  99. margin: 20px 0;
  100. }
  101. span {
  102. font-size: 14px;
  103. }
  104. }
  105. }
  106. .list {
  107. display: flex;
  108. align-items: center;
  109. justify-content: center;
  110. margin-top: 20px;
  111. p {
  112. color: #999;
  113. width: 100%;
  114. text-align: center;
  115. }
  116. > div {
  117. margin: 0 20px;
  118. > img {
  119. width: 70px !important;
  120. }
  121. }
  122. }
  123. </style>