|
@@ -121,6 +121,7 @@ const loadSplash = (onload, onerror) =>
|
|
|
const splash = document.createElement('img');
|
|
const splash = document.createElement('img');
|
|
|
splash.className = 'splash-screen';
|
|
splash.className = 'splash-screen';
|
|
|
splash.onload = () => {
|
|
splash.onload = () => {
|
|
|
|
|
+ console.log('splash onload');
|
|
|
onload && onload();
|
|
onload && onload();
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
hideSplash();
|
|
hideSplash();
|
|
@@ -133,7 +134,7 @@ const loadSplash = (onload, onerror) =>
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
hideSplash();
|
|
hideSplash();
|
|
|
}, 5000);
|
|
}, 5000);
|
|
|
- splash.src = 'https://cdn.raex.vip/splash.jpg?ts=' + new Date().getTime();
|
|
|
|
|
|
|
+ splash.src = 'https://cdn.raex.vip/splash.jpg';
|
|
|
document.body.append(splash);
|
|
document.body.append(splash);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -142,15 +143,37 @@ if (navigator.userAgent.includes('#cordova#')) {
|
|
|
'deviceready',
|
|
'deviceready',
|
|
|
function () {
|
|
function () {
|
|
|
StatusBar.overlaysWebView(true);
|
|
StatusBar.overlaysWebView(true);
|
|
|
- window.$vm = app.mount('#app');
|
|
|
|
|
|
|
+
|
|
|
|
|
+ function mountApp() {
|
|
|
|
|
+ window.$vm = app.mount('#app');
|
|
|
|
|
+ http.http
|
|
|
|
|
+ .get('/appVersion/checkUpdate', {
|
|
|
|
|
+ platform: window.cordova.platformId,
|
|
|
|
|
+ version: navigator.appInfo.version
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.needUpdate) {
|
|
|
|
|
+ window.$vm.$dialog.alert({
|
|
|
|
|
+ message: '检测到新版本,请下载更新',
|
|
|
|
|
+ confirmButtonText: '下载更新',
|
|
|
|
|
+ beforeClose(action, done) {
|
|
|
|
|
+ console.log(action);
|
|
|
|
|
+ location.href = 'http://download.raex.vip';
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
loadSplash(
|
|
loadSplash(
|
|
|
() => {
|
|
() => {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
navigator.splashscreen.hide();
|
|
navigator.splashscreen.hide();
|
|
|
}, 100);
|
|
}, 100);
|
|
|
|
|
+ mountApp();
|
|
|
},
|
|
},
|
|
|
() => {
|
|
() => {
|
|
|
navigator.splashscreen.hide();
|
|
navigator.splashscreen.hide();
|
|
|
|
|
+ mountApp();
|
|
|
}
|
|
}
|
|
|
).then(res => {
|
|
).then(res => {
|
|
|
StatusBar.overlaysWebView(false);
|
|
StatusBar.overlaysWebView(false);
|
|
@@ -158,7 +181,7 @@ if (navigator.userAgent.includes('#cordova#')) {
|
|
|
StatusBar.styleDefault();
|
|
StatusBar.styleDefault();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- if (/iphone|ipad|ipod/i.test(navigator.userAgent)) {
|
|
|
|
|
|
|
+ if ('ios' === window.cordova.platformId) {
|
|
|
style.setProperty('--safe-top', 'env(safe-area-inset-top)');
|
|
style.setProperty('--safe-top', 'env(safe-area-inset-top)');
|
|
|
style.setProperty('--safe-bottom', 'env(safe-area-inset-bottom)');
|
|
style.setProperty('--safe-bottom', 'env(safe-area-inset-bottom)');
|
|
|
style.setProperty('--safe-left', 'env(safe-area-inset-left)');
|
|
style.setProperty('--safe-left', 'env(safe-area-inset-left)');
|
|
@@ -216,24 +239,7 @@ if (navigator.userAgent.includes('#cordova#')) {
|
|
|
false
|
|
false
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- 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|Macintosh/i.test(navigator.userAgent)) {
|
|
|
|
|
- //location.href = 'https://apps.apple.com/cn/app/id1598469798';
|
|
|
|
|
- } else {
|
|
|
|
|
- location.href = 'http://download.raex.vip';
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (window.store && /iphone|ipad|ipod|Macintosh/i.test(navigator.userAgent)) {
|
|
|
|
|
|
|
+ if ('ios' === window.cordova.platformId) {
|
|
|
window.store.register({
|
|
window.store.register({
|
|
|
id: '358',
|
|
id: '358',
|
|
|
alias: '358',
|
|
alias: '358',
|