You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.3 KiB
Vue
64 lines
1.3 KiB
Vue
6 months ago
|
<script setup>
|
||
|
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
||
|
import { onBeforeUnmount } from 'vue'
|
||
|
|
||
|
// #ifdef APP
|
||
|
import { useSystemStore } from '@/store/system.js';
|
||
|
const systemStore = useSystemStore()
|
||
|
// #endif
|
||
|
|
||
|
onLaunch(() => {
|
||
|
console.log('App Launch')
|
||
|
// #ifdef APP
|
||
|
const appInfo = uni.getAppBaseInfo()
|
||
|
systemStore.setAppInfo(appInfo)
|
||
|
// #endif
|
||
|
})
|
||
|
|
||
|
onShow(() => {
|
||
|
console.log('App Show')
|
||
|
})
|
||
|
|
||
|
onHide(() => {
|
||
|
console.log('App Hide')
|
||
|
})
|
||
|
|
||
|
onBeforeUnmount(() => {
|
||
|
uni.removeStorage({ key: 'uId' })
|
||
|
})
|
||
|
|
||
|
// export default {
|
||
|
// onLaunch: function() {
|
||
|
// console.log('App Launch')
|
||
|
// },
|
||
|
// onShow: function() {
|
||
|
// console.log('App Show')
|
||
|
// // #ifdef APP
|
||
|
// checkUpdate().then(res => {
|
||
|
// console.log('检查更新结果:', res)
|
||
|
// }).catch(error => {
|
||
|
// console.log("检查更新错误:", error)
|
||
|
// })
|
||
|
// // #endif
|
||
|
// const appInfo = uni.getAppBaseInfo()
|
||
|
// console.log(appInfo)
|
||
|
// systemStore.setAppInfo(appInfo)
|
||
|
// },
|
||
|
// onHide: function() {
|
||
|
// console.log('App Hide')
|
||
|
// },
|
||
|
// beforeUnmount () {
|
||
|
// uni.removeStorage({ key: 'uId' })
|
||
|
// }
|
||
|
// }
|
||
|
</script>
|
||
|
|
||
|
<style>
|
||
|
#app {
|
||
|
min-height: 100vh;
|
||
|
background-color: #efeff4;
|
||
|
/* background-color: #000; */
|
||
|
/* height: auto; */
|
||
|
}
|
||
|
</style>
|