|
@@ -8,11 +8,12 @@
|
|
<audio
|
|
<audio
|
|
id="bg-music"
|
|
id="bg-music"
|
|
src="./configMultiMedia/music/music2.mp3"
|
|
src="./configMultiMedia/music/music2.mp3"
|
|
- style="opacity: 0;"
|
|
|
|
|
|
+ style="opacity: 0"
|
|
/>
|
|
/>
|
|
|
|
|
|
<!-- 平板横屏提示 -->
|
|
<!-- 平板横屏提示 -->
|
|
<div
|
|
<div
|
|
|
|
+ v-show="windowWidth >= 600"
|
|
id="prompt-box"
|
|
id="prompt-box"
|
|
class="landscape-prompt-box"
|
|
class="landscape-prompt-box"
|
|
>
|
|
>
|
|
@@ -35,10 +36,9 @@
|
|
import { ref, computed, watch, onMounted } from "vue"
|
|
import { ref, computed, watch, onMounted } from "vue"
|
|
import { useRoute, useRouter } from "vue-router"
|
|
import { useRoute, useRouter } from "vue-router"
|
|
import { useStore } from "vuex"
|
|
import { useStore } from "vuex"
|
|
-import {
|
|
|
|
-// checkLoginStatusAndProcess,
|
|
|
|
|
|
+import // checkLoginStatusAndProcess,
|
|
// getUserFromStorageIfNeed
|
|
// getUserFromStorageIfNeed
|
|
-} from '@/api.js'
|
|
|
|
|
|
+"@/api.js"
|
|
|
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
@@ -59,41 +59,63 @@ const store = useStore()
|
|
|
|
|
|
const time = ref(null)
|
|
const time = ref(null)
|
|
|
|
|
|
-function updateOrientationClass() {
|
|
|
|
- if (window.matchMedia('(orientation: landscape)').matches) {
|
|
|
|
- document.getElementById('prompt-box').classList.add('landscape')
|
|
|
|
- document.getElementById('prompt-box').classList.remove('portrait')
|
|
|
|
- } else {
|
|
|
|
- document.getElementById('prompt-box').classList.add('portrait')
|
|
|
|
- document.getElementById('prompt-box').classList.remove('landscape')
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+const windowWidth = ref(window.innerWidth)
|
|
|
|
|
|
function isNotMobile() {
|
|
function isNotMobile() {
|
|
const userAgent = navigator.userAgent || navigator.vendor || window.opera
|
|
const userAgent = navigator.userAgent || navigator.vendor || window.opera
|
|
const mobileKeywords = [
|
|
const mobileKeywords = [
|
|
- 'Android', 'webOS', 'iPhone', 'iPad', 'iPod', 'BlackBerry', 'Windows Phone',
|
|
|
|
- 'Opera Mini', 'IEMobile', 'Mobile', 'Android'
|
|
|
|
|
|
+ "Android",
|
|
|
|
+ "webOS",
|
|
|
|
+ "iPhone",
|
|
|
|
+ "iPad",
|
|
|
|
+ "iPod",
|
|
|
|
+ "BlackBerry",
|
|
|
|
+ "Windows Phone",
|
|
|
|
+ "Opera Mini",
|
|
|
|
+ "IEMobile",
|
|
|
|
+ "Mobile",
|
|
|
|
+ "Android",
|
|
]
|
|
]
|
|
|
|
|
|
// Check if any of the mobile keywords are present in the user agent string.
|
|
// Check if any of the mobile keywords are present in the user agent string.
|
|
- return !mobileKeywords.some(keyword => userAgent.toLowerCase().includes(keyword.toLowerCase()))
|
|
|
|
|
|
+ return !mobileKeywords.some((keyword) =>
|
|
|
|
+ userAgent.toLowerCase().includes(keyword.toLowerCase())
|
|
|
|
+ )
|
|
}
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
- const appDom = document.getElementById('#app')
|
|
|
|
|
|
+ const appDom = document.getElementById("#app")
|
|
if (isNotMobile) {
|
|
if (isNotMobile) {
|
|
// appDom.style.maxWidth = '390px'
|
|
// appDom.style.maxWidth = '390px'
|
|
// appDom.style.maxHeight = '844px'
|
|
// appDom.style.maxHeight = '844px'
|
|
// appDom.clientHeight = '844px'
|
|
// appDom.clientHeight = '844px'
|
|
// appDom.clientWidth = '390px'
|
|
// appDom.clientWidth = '390px'
|
|
}
|
|
}
|
|
|
|
+ console.log("当前window.innerWidth1", window.innerWidth)
|
|
|
|
|
|
- if ( window.innerWidth >= 600) {
|
|
|
|
|
|
+ if (window.innerWidth >= 600) {
|
|
|
|
+ console.log("当前window.innerWidth2", window.innerWidth)
|
|
// 初始化
|
|
// 初始化
|
|
- updateOrientationClass()
|
|
|
|
|
|
+ if (window.matchMedia("(orientation: landscape)").matches) {
|
|
|
|
+ document.getElementById("prompt-box").classList.add("landscape")
|
|
|
|
+ document.getElementById("prompt-box").classList.remove("portrait")
|
|
|
|
+ } else {
|
|
|
|
+ document.getElementById("prompt-box").classList.add("portrait")
|
|
|
|
+ document.getElementById("prompt-box").classList.remove("landscape")
|
|
|
|
+ }
|
|
// 监听窗口尺寸变化
|
|
// 监听窗口尺寸变化
|
|
- window.addEventListener('resize', updateOrientationClass)
|
|
|
|
|
|
+ window.addEventListener("resize", () => {
|
|
|
|
+ // alert(store.state.isInputing)
|
|
|
|
+ if (!store.state.isInputing) {
|
|
|
|
+ if (window.matchMedia("(orientation: landscape)").matches) {
|
|
|
|
+ document.getElementById("prompt-box").classList.add("landscape")
|
|
|
|
+ document.getElementById("prompt-box").classList.remove("portrait")
|
|
|
|
+ } else {
|
|
|
|
+ document.getElementById("prompt-box").classList.add("portrait")
|
|
|
|
+ document.getElementById("prompt-box").classList.remove("landscape")
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
window.addEventListener(
|
|
window.addEventListener(
|
|
@@ -115,9 +137,7 @@ onMounted(() => {
|
|
},
|
|
},
|
|
true
|
|
true
|
|
)
|
|
)
|
|
-
|
|
|
|
})
|
|
})
|
|
-
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|
|
@@ -134,8 +154,10 @@ body {
|
|
}
|
|
}
|
|
|
|
|
|
.landscape {
|
|
.landscape {
|
|
- /* 横屏样式 */
|
|
|
|
- position: fixed;
|
|
|
|
|
|
+ display: none;
|
|
|
|
+ @media screen and (min-width: 1000px) and (min-height: 600px) {
|
|
|
|
+ /* 横屏样式 */
|
|
|
|
+ position: fixed;
|
|
top: 0;
|
|
top: 0;
|
|
left: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
width: 100%;
|
|
@@ -148,51 +170,33 @@ body {
|
|
font-family: KaiTi;
|
|
font-family: KaiTi;
|
|
z-index: 2024;
|
|
z-index: 2024;
|
|
color: white;
|
|
color: white;
|
|
- img{
|
|
|
|
- width: 13%;
|
|
|
|
- margin-bottom: 15px;
|
|
|
|
- }
|
|
|
|
- div{
|
|
|
|
- color: white;
|
|
|
|
- font-family: KaiTi;
|
|
|
|
- font-size: 24px;
|
|
|
|
- margin-top: 10px;
|
|
|
|
|
|
+ img {
|
|
|
|
+ display: block;
|
|
|
|
+ width: 13%;
|
|
|
|
+ margin-bottom: 15px;
|
|
|
|
+ }
|
|
|
|
+ div {
|
|
|
|
+ display: block;
|
|
|
|
+ color: white;
|
|
|
|
+ font-family: KaiTi;
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ margin-top: 10px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
.portrait {
|
|
.portrait {
|
|
display: none;
|
|
display: none;
|
|
|
|
+ // img{
|
|
|
|
+ // display: none;
|
|
|
|
+ // }
|
|
|
|
+ // div{
|
|
|
|
+ // display: none;
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
|
|
-// .landscape-prompt-box{
|
|
|
|
-// display: none;
|
|
|
|
-// @media screen and (min-width: 600px) and (orientation: landscape) {
|
|
|
|
-// position: fixed;
|
|
|
|
-// top: 0;
|
|
|
|
-// left: 0;
|
|
|
|
-// width: 100%;
|
|
|
|
-// height: 100%;
|
|
|
|
-// background: url(@/assets/images/pad-l-bg.png);
|
|
|
|
-// display: flex;
|
|
|
|
-// flex-direction: column;
|
|
|
|
-// align-items: center;
|
|
|
|
-// justify-content: center;
|
|
|
|
-// font-family: KaiTi;
|
|
|
|
-// z-index: 2024;
|
|
|
|
-// color: white;
|
|
|
|
-// }
|
|
|
|
-// img{
|
|
|
|
-// width: 13%;
|
|
|
|
-// margin-bottom: 15px;
|
|
|
|
-// }
|
|
|
|
-// div{
|
|
|
|
-// color: white;
|
|
|
|
-// font-family: KaiTi;
|
|
|
|
-// font-size: 24px;
|
|
|
|
-// margin-top: 10px;
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
|
|
+.landscape-prompt-box {
|
|
|
|
+}
|
|
|
|
|
|
// 360浏览器不支持not()
|
|
// 360浏览器不支持not()
|
|
input,
|
|
input,
|
|
@@ -217,13 +221,13 @@ textarea {
|
|
|
|
|
|
// 字体
|
|
// 字体
|
|
@font-face {
|
|
@font-face {
|
|
- font-family: 'KingHwa_OldSong';
|
|
|
|
- src: url('@/assets/style/KingHwa_OldSong.TTF');
|
|
|
|
|
|
+ font-family: "KingHwa_OldSong";
|
|
|
|
+ src: url("@/assets/style/KingHwa_OldSong.TTF");
|
|
}
|
|
}
|
|
|
|
|
|
@font-face {
|
|
@font-face {
|
|
- font-family: 'KaiTi';
|
|
|
|
- src: url('@/assets/style/SIMKAI.woff2');
|
|
|
|
|
|
+ font-family: "KaiTi";
|
|
|
|
+ src: url("@/assets/style/SIMKAI.woff2");
|
|
}
|
|
}
|
|
|
|
|
|
// 滚动条,只设置某一项可能导致不生效。
|
|
// 滚动条,只设置某一项可能导致不生效。
|
|
@@ -285,7 +289,6 @@ textarea {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// 不断渐变显隐,显示时间较长 animation
|
|
// 不断渐变显隐,显示时间较长 animation
|
|
.animation-show-long-hide {
|
|
.animation-show-long-hide {
|
|
animation: show-long-hide 2.5s infinite;
|
|
animation: show-long-hide 2.5s infinite;
|
|
@@ -328,8 +331,12 @@ textarea {
|
|
z-index: 2016;
|
|
z-index: 2016;
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
- font-size: calc(24 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
|
- line-height: calc(30 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
|
|
|
+ font-size: calc(
|
|
|
|
+ 24 / v-bind("windowSizeWhenDesignForRef") * v-bind("windowSizeInCssForRef")
|
|
|
|
+ );
|
|
|
|
+ line-height: calc(
|
|
|
|
+ 30 / v-bind("windowSizeWhenDesignForRef") * v-bind("windowSizeInCssForRef")
|
|
|
|
+ );
|
|
font-family: KaiTi;
|
|
font-family: KaiTi;
|
|
color: white;
|
|
color: white;
|
|
transition: all 0.5s;
|
|
transition: all 0.5s;
|
|
@@ -337,7 +344,7 @@ textarea {
|
|
font-size: 26px;
|
|
font-size: 26px;
|
|
// line-height: calc(34 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
// line-height: calc(34 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
}
|
|
}
|
|
- >img{
|
|
|
|
|
|
+ > img {
|
|
width: 30px;
|
|
width: 30px;
|
|
height: 30px;
|
|
height: 30px;
|
|
margin-left: 10px;
|
|
margin-left: 10px;
|
|
@@ -347,7 +354,7 @@ textarea {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-.viewer-button-home{
|
|
|
|
|
|
+.viewer-button-home {
|
|
background: url(@/assets/images/icon_cancel.png);
|
|
background: url(@/assets/images/icon_cancel.png);
|
|
background-size: 100% 100%;
|
|
background-size: 100% 100%;
|
|
background-color: rgba(0, 0, 0, 0) !important;
|
|
background-color: rgba(0, 0, 0, 0) !important;
|
|
@@ -356,9 +363,9 @@ textarea {
|
|
top: 10px !important;
|
|
top: 10px !important;
|
|
width: 40px !important;
|
|
width: 40px !important;
|
|
border: none !important;
|
|
border: none !important;
|
|
- -webkit-tap-highlight-color:none !important;
|
|
|
|
|
|
+ -webkit-tap-highlight-color: none !important;
|
|
}
|
|
}
|
|
-.viewer-button-home::before{
|
|
|
|
|
|
+.viewer-button-home::before {
|
|
display: none !important;
|
|
display: none !important;
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|