修复ipad下无法更新全屏状态的BUG。禁用ipad双击放大功能。

This commit is contained in:
fangxiang 2022-09-22 19:58:41 +08:00
parent ce1b108f2a
commit 9a50790629
4 changed files with 51 additions and 3 deletions

View File

@ -241,6 +241,37 @@ export default defineComponent({
$store.commit("updateLandspace", landspace());
if (
$q.platform.is.ios ||
$q.platform.is.ipad ||
$q.platform.is.safari ||
$q.platform.is.iphone
) {
//
var lastTouchEnd = 0;
document.addEventListener("touchstart", function (event: any) {
if (event.touches.length > 1) {
event.preventDefault();
}
});
document.addEventListener(
"touchend",
function (event) {
var now = new Date().getTime();
if (now - lastTouchEnd <= 300) {
event.preventDefault();
}
lastTouchEnd = now;
},
false
);
//
document.addEventListener("gesturestart", function (event) {
event.preventDefault();
});
}
return {};
},
});

View File

@ -16,6 +16,10 @@
<meta name="screen-orientation" content="landscape" />
<meta name="x5-orientation" content="landscape" />
<meta name="google" content="notranslate" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<script>
/*@cc_on window.location.href="http://support.dmeng.net/upgrade-your-browser.html?referrer="+encodeURIComponent(window.location.href); @*/

View File

@ -404,7 +404,7 @@ export default defineComponent({
const data = reactive(new _Data());
const ____temp = $q.fullscreen.isActive;
const full_screen = ref(____temp);
const full_screen = computed(() => $q.fullscreen.isActive);
try {
(window as any).setPadTheme();
@ -432,8 +432,9 @@ export default defineComponent({
set: (val) => null,
});
$store.commit("updateLandspace", window.innerWidth > window.innerHeight);
EventBus.getInstance().on(EventNamesDefine.WindowResize, () => {
landspace.value = window.innerHeight < window.innerWidth;
$store.commit("updateLandspace", window.innerWidth > window.innerHeight);
});
onMounted(() => {
@ -660,7 +661,6 @@ export default defineComponent({
});
}
full_screen.value = $q.fullscreen.isActive;
return;
}
if ($q.fullscreen.isActive) {

View File

@ -71,6 +71,19 @@
</q-layout>
</template>
<style>
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
position: fixed;
top: 0;
bottom: 0;
left: 0px;
right: 0px;
}
</style>
<script lang="ts">
import { defineComponent, ref } from "vue";