| | |
| | | import { useGlobalWS } from '@/hooks/useGlobalWS.js' |
| | | // #ifdef APP-PLUS |
| | | import { keepAliveStart, requestIgnoreBatteryOptimization } from '@/uni_modules/keep-app' |
| | | import { openDialog,closeDialog } from '@/uni_modules/lgh-dialog' |
| | | import { openDialog, allowFloat,getBatteryCapacity } from '@/uni_modules/lgh-dialog' |
| | | // #endif |
| | | |
| | | const appStore = useAppStore() |
| | |
| | | const locationStore = useLocationStore() |
| | | |
| | | // #ifdef APP-PLUS |
| | | // import { getBatteryCapacity } from '@/uni_modules/lgh-getbatteryinfo' |
| | | // console.log('电池电量:', getBatteryCapacity()) |
| | | // const currentKey = ref(1) |
| | | // function testKeep() { |
| | | // setInterval(() => { |
| | | // currentKey.value = currentKey.value + 1 |
| | | // const val = '保活服务验证:' + currentKey.value |
| | | // console.log(val) |
| | | // uni.showToast({ title: val, icon: 'none' }) |
| | | // }, 1000) |
| | | // } |
| | | // testKeep() |
| | | |
| | | // 开启悬浮窗 |
| | | allowFloat() |
| | | // 假设五秒后来电 |
| | | setTimeout(() => { |
| | | openDialog() |
| | | }, 5000) |
| | | // #endif |
| | | |
| | | const currentKey = ref(1) |
| | | function tests() { |
| | | setInterval(() => { |
| | | currentKey.value = currentKey.value + 1 |
| | | const val = '保活服务验证:' + currentKey.value |
| | | console.log(val) |
| | | uni.showToast({ title: val, icon: 'none' }) |
| | | }, 1000) |
| | | } |
| | | |
| | | function popUpInterface() { |
| | | uni.showToast({ title: '弹框', icon: 'none' }) |
| | | openDialog() |
| | | } |
| | | |
| | | setTimeout(() => { |
| | | popUpInterface() |
| | | },10000) |
| | | |
| | | setTimeout(() => { |
| | | closeDialog() |
| | | },20000) |
| | | |
| | | tests() |
| | | useGlobalWS() |
| | | |
| | | onShow(async () => { |