From 3369fac628806392bb53e4d2ded256d414d1e828 Mon Sep 17 00:00:00 2001 From: jiannibang <271381693@qq.com> Date: Tue, 14 Feb 2023 16:43:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B0=B4=E7=89=8C=E9=A1=B5=3D=E5=B1=8F?= =?UTF-8?q?=E4=BF=9D=EF=BC=8C=E5=80=92=E8=AE=A1=E6=97=B6=E6=96=87=E6=A1=88?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E2=80=9C=E5=8D=B3=E5=B0=86=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E5=B1=8F=E4=BF=9D=E2=80=9D;=E4=BB=8E=E5=86=85=E4=B8=9A?= =?UTF-8?q?=E5=88=B0=E9=A6=96=E9=A1=B5=E4=B8=8D=E7=94=A8=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E4=BE=9D=E6=97=A7=E6=98=AF=E2=80=9C=E5=8D=B3=E5=B0=86=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E9=A6=96=E9=A1=B5=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PublicComponent/PublicComponent.vue | 15 +++++++++++++-- src/composables/useHandleScreen.js | 8 ++++---- 2 files changed, 17 insertions(+), 6 deletions(-) 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() }