mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 20:12:48 +00:00
feat: 添加判断是否为iPad的功能,并在预加载时处理安全区域
This commit is contained in:
parent
717e87cfa9
commit
d48287f93a
9
resources/assets/js/functions/common.js
vendored
9
resources/assets/js/functions/common.js
vendored
@ -466,6 +466,15 @@ const timezone = require("dayjs/plugin/timezone");
|
|||||||
return ua && /iphone|ipad|ipod|ios/.test(ua);
|
return ua && /iphone|ipad|ipod|ios/.test(ua);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否iPad
|
||||||
|
* @returns {boolean|string}
|
||||||
|
*/
|
||||||
|
isIpad() {
|
||||||
|
let ua = typeof window !== 'undefined' && window.navigator.userAgent.toLowerCase();
|
||||||
|
return ua && /ipad/.test(ua);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否安卓
|
* 是否安卓
|
||||||
* @returns {boolean|string}
|
* @returns {boolean|string}
|
||||||
|
|||||||
12
resources/assets/js/functions/eeui.js
vendored
12
resources/assets/js/functions/eeui.js
vendored
@ -362,6 +362,18 @@ import {languageName} from "../language";
|
|||||||
reject(e);
|
reject(e);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 判断是否窗口化
|
||||||
|
eeuiAppIsWindowed() {
|
||||||
|
return new Promise(async resolve => {
|
||||||
|
try {
|
||||||
|
const eeui = await $A.eeuiModulePromise();
|
||||||
|
resolve(eeui.isFullscreen() === false || eeui.isFullscreen() === 0);
|
||||||
|
} catch (e) {
|
||||||
|
resolve(false);
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
2
resources/assets/js/store/actions.js
vendored
2
resources/assets/js/store/actions.js
vendored
@ -177,7 +177,7 @@ export default {
|
|||||||
if (!state.isFirstPage) {
|
if (!state.isFirstPage) {
|
||||||
return resolve(null)
|
return resolve(null)
|
||||||
}
|
}
|
||||||
$A.eeuiAppGetSafeAreaInsets().then(data => {
|
$A.eeuiAppGetSafeAreaInsets().then(async data => {
|
||||||
data.top = data.top || state.safeAreaSize?.data?.top || 0
|
data.top = data.top || state.safeAreaSize?.data?.top || 0
|
||||||
data.bottom = data.bottom || state.safeAreaSize?.data?.bottom || 0
|
data.bottom = data.bottom || state.safeAreaSize?.data?.bottom || 0
|
||||||
const proportion = data.height / window.outerHeight
|
const proportion = data.height / window.outerHeight
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 65fddcf2cdfa4c5dbc9bef60a5c8b66575f2f30f
|
Subproject commit 4302914539ca3aae58e3724250abafa1a2124233
|
||||||
Loading…
x
Reference in New Issue
Block a user