xiongzhu 4 years ago
parent
commit
f78d0e6f1b
1 changed files with 12 additions and 12 deletions
  1. 12 12
      src/main.js

+ 12 - 12
src/main.js

@@ -114,6 +114,9 @@ const loadSplash = (onload, onerror) =>
         splash.className = 'splash-screen';
         splash.onload = () => {
             onload && onload();
+            setTimeout(() => {
+                hideSplash();
+            }, 2000);
         };
         splash.onerror = () => {
             hideSplash();
@@ -121,7 +124,7 @@ const loadSplash = (onload, onerror) =>
         };
         setTimeout(() => {
             hideSplash();
-        }, 2000);
+        }, 5000);
         splash.src = 'https://raex-meta.oss-cn-shenzhen.aliyuncs.com/splash.jpg?ts=' + new Date().getTime();
         document.body.append(splash);
     });
@@ -130,9 +133,12 @@ if (navigator.userAgent.includes('#cordova#')) {
         'deviceready',
         function () {
             StatusBar.overlaysWebView(true);
+            window.$vm = app.mount('#app');
             loadSplash(
                 () => {
-                    navigator.splashscreen.hide();
+                    setTimeout(() => {
+                        navigator.splashscreen.hide();
+                    }, 100);
                 },
                 () => {
                     navigator.splashscreen.hide();
@@ -142,7 +148,6 @@ if (navigator.userAgent.includes('#cordova#')) {
                 StatusBar.backgroundColorByHexString('#F5F7FA');
                 StatusBar.styleDefault();
             });
-            window.$vm = app.mount('#app');
 
             if (/iphone|ipad|ipod/i.test(navigator.userAgent)) {
                 style.setProperty('--safe-top', 'env(safe-area-inset-top)');
@@ -202,19 +207,14 @@ if (navigator.userAgent.includes('#cordova#')) {
                 false
             );
 
-            if (
-                !(
-                    /.+\.raex\.vip/.test(location.host) ||
-                    /^http:\/\/192\.168\.\d{1,3}\.\d{1,3}((:\d+)?)$/.test(location.host)
-                )
-            ) {
-                if (!/iphone|ipad|ipod/i.test(navigator.userAgent)) {
+            if (!(/.+\.raex\.vip/.test(location.host) || /192\.168/.test(location.host))) {
+                if (!/iphone|ipad|ipod|Macintosh/i.test(navigator.userAgent)) {
                     window.$vm.$dialog.alert({
                         message: '检测到新版本,请下载更新',
                         confirmButtonText: '下载更新',
                         beforeClose(action, done) {
                             console.log(action);
-                            if (/iphone|ipad|ipod/.test(navigator.userAgent)) {
+                            if (/iphone|ipad|ipod|Macintosh/i.test(navigator.userAgent)) {
                                 //location.href = 'https://apps.apple.com/cn/app/id1598469798';
                             } else {
                                 location.href = 'http://download.raex.vip';
@@ -224,7 +224,7 @@ if (navigator.userAgent.includes('#cordova#')) {
                 }
             }
 
-            if (window.store && /iphone|ipad|ipod/i.test(navigator.userAgent)) {
+            if (window.store && /iphone|ipad|ipod|Macintosh/i.test(navigator.userAgent)) {
                 window.store.register({
                     id: '358',
                     alias: '358',