| | |
| | | <!-- |
| | | * @Author: daidai |
| | | * @Date: 2022-01-12 14:23:32 |
| | | * @LastEditors: Please set LastEditors |
| | | * @LastEditTime: 2022-09-09 14:47:24 |
| | | * @FilePath: \web-pc\src\pages\big-screen\view\home.vue |
| | | --> |
| | | <template> |
| | | <!-- <div id="index" ref="appRef" class="index_home" :class="{ pageisScale: isScale }"> --> |
| | | <ScaleScreen |
| | | :width="1920" |
| | | :height="1080" |
| | |
| | | :selfAdaption="$store.state.setting.isScale" |
| | | > |
| | | <div class="bg"> |
| | | <!-- å
¨å±é®ç½©å± --> |
| | | <div v-if="showMask" class="fullscreen-mask" @click="enterFullscreen"> |
| | | <button class="fullscreen-button">ç¹å»å
¨å±æ¾ç¤º</button> |
| | | </div> |
| | | |
| | | <dv-loading v-if="loading">Loading...</dv-loading> |
| | | <div v-else class="host-body"> |
| | | <!-- å¤´é¨ s --> |
| | |
| | | </div> |
| | | <Setting ref="setting" /> |
| | | </ScaleScreen> |
| | | <!-- </div> --> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | dateYear: null, |
| | | dateWeek: null, |
| | | weekday: ["卿¥", "å¨ä¸", "å¨äº", "å¨ä¸", "å¨å", "å¨äº", "å¨å
"], |
| | | showMask: true // æ§å¶é®ç½©å±æ¾ç¤º |
| | | }; |
| | | }, |
| | | filters: { |
| | |
| | | mounted() { |
| | | this.timeFn(); |
| | | this.cancelLoading(); |
| | | |
| | | // çå¬å
¨å±åå |
| | | document.addEventListener('fullscreenchange', this.handleFullscreenChange); |
| | | }, |
| | | beforeDestroy() { |
| | | clearInterval(this.timing); |
| | | document.removeEventListener('fullscreenchange', this.handleFullscreenChange); |
| | | }, |
| | | methods: { |
| | | showSetting() { |
| | |
| | | cancelLoading() { |
| | | let timer = setTimeout(() => { |
| | | this.loading = false; |
| | | clearTimeout(timer); |
| | | }, 500); |
| | | }, 100); |
| | | }, |
| | | // è¿å
¥å
¨å± |
| | | enterFullscreen() { |
| | | const element = document.documentElement; |
| | | if (element.requestFullscreen) { |
| | | element.requestFullscreen(); |
| | | } else if (element.webkitRequestFullscreen) { |
| | | element.webkitRequestFullscreen(); |
| | | } else if (element.msRequestFullscreen) { |
| | | element.msRequestFullscreen(); |
| | | } |
| | | }, |
| | | // å¤çå
¨å±åå |
| | | handleFullscreenChange() { |
| | | this.showMask = !document.fullscreenElement; |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | @import "./home.scss"; |
| | | </style> |
| | | |
| | | .fullscreen-mask { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: rgba(0, 0, 0, 0.8); |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | z-index: 9999; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .fullscreen-button { |
| | | padding: 15px 30px; |
| | | font-size: 18px; |
| | | background-color: #1a5cd7; |
| | | color: white; |
| | | border: none; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | transition: all 0.3s; |
| | | |
| | | &:hover { |
| | | background-color: #0d4bc2; |
| | | transform: scale(1.05); |
| | | } |
| | | } |
| | | </style> |