Browse Source

feat: 🚀 添加初始化进入自动弹屏保弹框

pull/1/head
jiangx 3 years ago
parent
commit
2df96313fb
  1. 23
      src/components/PublicComponent/PublicComponent.vue
  2. 3
      src/composables/useHandleScreen.ts

23
src/components/PublicComponent/PublicComponent.vue

@ -27,9 +27,19 @@ const AutoBackNotification = defineAsyncComponent(() => import('@/base/AutoBackN
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const store = useRootStore() const store = useRootStore()
const { language, showSearch, showDetail } = storeToRefs(store)
const { checkHandleScreen, showCountDownDialog, title, toIndexTime, toWallpaperTime, isWallpaper, setLogout, resetClickNumber, logout } =
useHandleScreen(handleScreen)
const { language, showSearch, showDetail, mapStatus } = storeToRefs(store)
const {
checkHandleScreen,
showCountDownDialog,
title,
toIndexTime,
toWallpaperTime,
isWallpaper,
setLogout,
resetClickNumber,
logout,
sleepToWallpaper
} = useHandleScreen(handleScreen)
// //
function handleScreen() { function handleScreen() {
@ -54,6 +64,13 @@ onBeforeUnmount(() => {
window.removeEventListener('touchend', checkHandleScreen) window.removeEventListener('touchend', checkHandleScreen)
}) })
watch(mapStatus, newVal => {
//便
if (newVal) {
sleepToWallpaper()
}
})
watch(route, to => { watch(route, to => {
if (to.fullPath === '/' || to.fullPath === '/nav') { if (to.fullPath === '/' || to.fullPath === '/nav') {
window?.Map_QM?.startRender() window?.Map_QM?.startRender()

3
src/composables/useHandleScreen.ts

@ -68,7 +68,7 @@ export const useHandleScreen = (callback: () => void) => {
callback() callback()
} }
//没有屏保的话不允许弹出屏保弹框 TODO:后期由容器通知
//时间为-1时的话不允许弹出屏保弹框 TODO:后期由容器通知
if (toWallpaperTime.value === -1) { if (toWallpaperTime.value === -1) {
return return
} }
@ -105,6 +105,7 @@ export const useHandleScreen = (callback: () => void) => {
logout, logout,
checkHandleScreen, checkHandleScreen,
resetClickNumber, resetClickNumber,
sleepToWallpaper,
setLogout setLogout
} }
} }

Loading…
Cancel
Save