|
|
@ -12,7 +12,7 @@ export const useHandleScreen = (callback: () => void) => { |
|
|
|
|
|
|
|
|
const router = useRouter() |
|
|
const router = useRouter() |
|
|
const store = useRootStore() |
|
|
const store = useRootStore() |
|
|
const { isAndroid, nativeMethods } = toRefs(store) |
|
|
|
|
|
|
|
|
const { device, nativeMethods, mapStatus } = toRefs(store) |
|
|
|
|
|
|
|
|
const { logout, resetClickNumber, setLogout, addTotalClick } = useLogout() |
|
|
const { logout, resetClickNumber, setLogout, addTotalClick } = useLogout() |
|
|
|
|
|
|
|
|
@ -59,7 +59,7 @@ export const useHandleScreen = (callback: () => void) => { |
|
|
window.sleepToWallpaper = sleepToWallpaper |
|
|
window.sleepToWallpaper = sleepToWallpaper |
|
|
|
|
|
|
|
|
async function checkHandleScreen(e: TouchEvent) { |
|
|
async function checkHandleScreen(e: TouchEvent) { |
|
|
!isAndroid && addTotalClick(e) |
|
|
|
|
|
|
|
|
device.value.label === 'windows' && addTotalClick(e) |
|
|
toIndexTime.value = totalTime.value[0] |
|
|
toIndexTime.value = totalTime.value[0] |
|
|
toWallpaperTime.value = totalTime.value[1] |
|
|
toWallpaperTime.value = totalTime.value[1] |
|
|
|
|
|
|
|
|
@ -85,10 +85,17 @@ export const useHandleScreen = (callback: () => void) => { |
|
|
|
|
|
|
|
|
//监听时间 大于等于0且小于等于5时显示弹框
|
|
|
//监听时间 大于等于0且小于等于5时显示弹框
|
|
|
watch([toIndexTime, toWallpaperTime], ([indexTime, wallpaperTime]) => { |
|
|
watch([toIndexTime, toWallpaperTime], ([indexTime, wallpaperTime]) => { |
|
|
if ((indexTime >= MIN_TIME && indexTime <= MAX_TIME) || (wallpaperTime >= MIN_TIME && wallpaperTime <= MAX_TIME)) { |
|
|
|
|
|
showCountDownDialog.value = true |
|
|
|
|
|
} else { |
|
|
|
|
|
showCountDownDialog.value = false |
|
|
|
|
|
|
|
|
showCountDownDialog.value = (indexTime >= MIN_TIME && indexTime <= MAX_TIME) || (wallpaperTime >= MIN_TIME && wallpaperTime <= MAX_TIME) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
watch(mapStatus, async (newVal: boolean) => { |
|
|
|
|
|
//当地图加载成功之后自动触发一次屏保弹框以便能进入屏保
|
|
|
|
|
|
if (newVal) { |
|
|
|
|
|
if (!nativeMethods.value?.hasProgram()) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
await sleepToWallpaper() |
|
|
|
|
|
nativeMethods.value?.goScreenSave() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
@ -111,7 +118,6 @@ export const useHandleScreen = (callback: () => void) => { |
|
|
logout, |
|
|
logout, |
|
|
checkHandleScreen, |
|
|
checkHandleScreen, |
|
|
resetClickNumber, |
|
|
resetClickNumber, |
|
|
sleepToWallpaper, |
|
|
|
|
|
setLogout |
|
|
setLogout |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|