diff --git a/src/components/PublicComponent/PublicComponent.vue b/src/components/PublicComponent/PublicComponent.vue index d8de3c8..5140288 100644 --- a/src/components/PublicComponent/PublicComponent.vue +++ b/src/components/PublicComponent/PublicComponent.vue @@ -41,7 +41,18 @@ const store = useStore() const { shop, showSearch, sidebarList, language } = storeToRefs(store) const { logoutRef, resetClickNumber, setLogoutRef, addTotalClick } = useLogout() -const { title, countDownGif, isWall, countDownToWall, countDownNum, send, checkHandleScreen } = useHandleScreen(handleScreen) + +const screenSaveCallback = () => { + window.Map_QM.changeMapIPState(shop.value?.houseNum, shop.value?.formatColor) + setLogoutRef(false) + resetClickNumber() + store.SET_SELECTED_MODULE(sidebarList.value[0].title) + showSearch.value && store.SET_SHOW_SEARCH(false) + language.value !== 'zh' && store.SET_LANGUAGE('zh') + router.push('/billboard') +} + +const { title, countDownGif, isWall, countDownToWall, countDownNum, send, checkHandleScreen } = useHandleScreen(handleScreen, screenSaveCallback) function handleGO() { router.push('/nav') @@ -58,7 +69,7 @@ async function handleScreen() { store.SET_SELECTED_MODULE(sidebarList.value[0].title) showSearch.value && store.SET_SHOW_SEARCH(false) language.value !== 'zh' && store.SET_LANGUAGE('zh') - await router.push('/billboard') + await router.push('/index') } const timer = ref(null) diff --git a/src/composables/useHandleScreen.js b/src/composables/useHandleScreen.js index 046a4a7..f9fa0ce 100644 --- a/src/composables/useHandleScreen.js +++ b/src/composables/useHandleScreen.js @@ -4,7 +4,7 @@ import { useStore } from '@/store/root' import { useRouter } from 'vue-router' import { useStatistics } from '@/composables/useStatistics' -export const useHandleScreen = callback => { +export const useHandleScreen = (callback, screenSaveCallback) => { const router = useRouter() const store = useStore() const backSocket = computed(() => store.config?.backSocket) @@ -93,7 +93,7 @@ export const useHandleScreen = callback => { state.countDownGif = false state.isWall = false state.countDownToWall = state.times[1] - callback && callback() + screenSaveCallback && screenSaveCallback() send('pcscreensavers') resolve() } @@ -142,11 +142,11 @@ export const useHandleScreen = callback => { state.isWall = false state.autoTimer = setTimeout(async () => { if (state.times[0] !== 0) { - if (router.currentRoute.value.fullPath !== '/billboard') { + if (router.currentRoute.value.fullPath !== '/index') { await indexPromise() } - if ((state.times[1] === 0 && router.currentRoute.value.fullPath === '/billboard') || (state.times[0] === 0 && state.times[1] === 0)) { + if ((state.times[1] === 0 && router.currentRoute.value.fullPath === '/index') || (state.times[0] === 0 && state.times[1] === 0)) { await rootPromise() callback && callback() }