|
@@ -1,7 +1,11 @@
|
|
|
<template>
|
|
|
<div id="app">
|
|
|
<router-view />
|
|
|
- <div v-if="userAgentTipShow" class="userAgentTips">
|
|
|
+ <div
|
|
|
+ v-if="userAgentTipShow"
|
|
|
+ class="userAgentTips"
|
|
|
+ :class="[isPhone ? 'userAgentTips-phone' : '']"
|
|
|
+ >
|
|
|
<img src="./assets/userAgentWarning.png" width="32px" />
|
|
|
<span
|
|
|
>当前浏览器可能与网站不兼容!建议使用 chrome 浏览器获得最佳使用体验。
|
|
@@ -26,9 +30,12 @@ export default {
|
|
|
return {
|
|
|
userAgentTipShow: false,
|
|
|
timeOut: null,
|
|
|
+ isPhone: false,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ const regExp = /Android|webOS|iPhone|BlackBerry|IEMobile|Opera Mini/i;
|
|
|
+ this.isPhone = regExp.test(navigator.userAgent) && window.innerWidth < 860;
|
|
|
this.handleUserAgentRoot();
|
|
|
window.addEventListener("click", () => {
|
|
|
sessionStorage.setItem("lastClickTime", new Date().getTime());
|
|
@@ -50,7 +57,8 @@ export default {
|
|
|
handleUserAgentRoot() {
|
|
|
if (
|
|
|
!sessionStorage.getItem("useragent_root_close") &&
|
|
|
- navigator.userAgent.indexOf("Chrome") == -1
|
|
|
+ (navigator.userAgent.indexOf("Chrome") == -1 ||
|
|
|
+ navigator.userAgent.indexOf("CriOS") == -1)
|
|
|
) {
|
|
|
this.userAgentTipShow = true;
|
|
|
}
|
|
@@ -102,6 +110,11 @@ export default {
|
|
|
font-size: 16px;
|
|
|
line-height: 24px;
|
|
|
z-index: 3;
|
|
|
+ &-phone {
|
|
|
+ width: 100%;
|
|
|
+ left: 0;
|
|
|
+ margin-left: 0;
|
|
|
+ }
|
|
|
:nth-child(1) {
|
|
|
margin-right: 8px;
|
|
|
}
|