| | |
| | | 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' |
| | | // #endif |
| | | |
| | | const appStore = useAppStore() |
| | |
| | | // console.log('电池电量:', getBatteryCapacity()) |
| | | // #endif |
| | | |
| | | const valuetest = ref(1) |
| | | const currentKey = ref(1) |
| | | function tests() { |
| | | setInterval(() => { |
| | | valuetest.value = valuetest.value + 1 |
| | | console.log('valuetest.value:', valuetest.value) |
| | | uni.showToast({ title: valuetest.value, icon: 'none' }) |
| | | 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() |
| | | |
| | |
| | | // #ifdef APP-PLUS |
| | | keepAliveStart() |
| | | // 请求用户允许忽略电池优化(重要:用于保活) |
| | | setTimeout(() => { |
| | | requestIgnoreBatteryOptimization() |
| | | }, 2000) |
| | | setTimeout(requestIgnoreBatteryOptimization, 2000) |
| | | // #endif |
| | | if (!userStore.userInfo) { |
| | | //不存在则跳转至登录页 |