mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-14 04:32:49 +00:00
perf: 优化iPadOS兼容性
This commit is contained in:
parent
43711a1a59
commit
618e482507
@ -204,7 +204,7 @@ export default {
|
||||
|
||||
&-close {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
top: var(--status-bar-height, 0);
|
||||
left: -40px;
|
||||
z-index: 1;
|
||||
width: 40px;
|
||||
|
||||
23
resources/assets/js/functions/common.js
vendored
23
resources/assets/js/functions/common.js
vendored
@ -1511,6 +1511,29 @@ const timezone = require("dayjs/plugin/timezone");
|
||||
};
|
||||
img.src = url;
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 是否全屏(根据尺寸对比)
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isFullScreen() {
|
||||
const windowWidth = $A(window).width();
|
||||
const windowHeight = $A(window).height();
|
||||
const screenWidth = window.screen.width;
|
||||
const screenHeight = window.screen.height;
|
||||
|
||||
// 如果高比宽大,对调宽高
|
||||
const adjustedWindowWidth = windowWidth > windowHeight ? windowWidth : windowHeight;
|
||||
const adjustedWindowHeight = windowWidth > windowHeight ? windowHeight : windowWidth;
|
||||
const adjustedScreenWidth = screenWidth > screenHeight ? screenWidth : screenHeight;
|
||||
const adjustedScreenHeight = screenWidth > screenHeight ? screenHeight : screenWidth;
|
||||
|
||||
// 判断是否全屏,误差1内视为全屏
|
||||
const widthDiff = Math.abs(adjustedWindowWidth - adjustedScreenWidth);
|
||||
const heightDiff = Math.abs(adjustedWindowHeight - adjustedScreenHeight);
|
||||
|
||||
return widthDiff <= 1 && heightDiff <= 1;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
2
resources/assets/js/store/actions.js
vendored
2
resources/assets/js/store/actions.js
vendored
@ -27,6 +27,8 @@ export default {
|
||||
state.windowLandscape = windowOrientation === 'landscape'
|
||||
state.windowPortrait = windowOrientation === 'portrait'
|
||||
|
||||
state.windowIsFullScreen = $A.isFullScreen()
|
||||
|
||||
state.formOptions = {
|
||||
class: windowWidth > 576 ? '' : 'form-label-weight-bold',
|
||||
labelPosition: windowWidth > 576 ? 'right' : 'top',
|
||||
|
||||
6
resources/assets/js/store/state.js
vendored
6
resources/assets/js/store/state.js
vendored
@ -1,6 +1,7 @@
|
||||
const windowWidth = $A(window).width(),
|
||||
windowHeight = $A(window).height(),
|
||||
windowOrientation = $A.screenOrientation()
|
||||
windowOrientation = $A.screenOrientation(),
|
||||
windowIsFullScreen = $A.isFullScreen();
|
||||
|
||||
export default {
|
||||
// 客户端ID(希望不变的,除非清除浏览器缓存或者卸载应用)
|
||||
@ -36,6 +37,9 @@ export default {
|
||||
windowLandscape: windowOrientation === 'landscape', // 横屏
|
||||
windowPortrait: windowOrientation === 'portrait', // 竖屏
|
||||
|
||||
// 是否全屏
|
||||
windowIsFullScreen: windowIsFullScreen,
|
||||
|
||||
// 表单布局
|
||||
formOptions: {
|
||||
class: windowWidth > 576 ? '' : 'form-label-weight-bold',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user