2025-06-04 09:00:34 +08:00
|
|
|
|
<script setup lang="ts">
|
2025-06-21 16:56:24 +08:00
|
|
|
|
import { onHide, onLaunch, onShow } from '@dcloudio/uni-app'
|
2025-08-07 18:22:57 +08:00
|
|
|
|
import { navigateToInterceptor } from '@/router/interceptor'
|
2025-06-21 16:56:24 +08:00
|
|
|
|
import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'
|
2025-06-04 12:25:13 +08:00
|
|
|
|
|
2025-08-07 18:22:57 +08:00
|
|
|
|
onLaunch((options) => {
|
2025-08-21 16:18:28 +08:00
|
|
|
|
console.log('App Launch', options)
|
2025-06-04 09:00:34 +08:00
|
|
|
|
})
|
2025-08-11 16:52:34 +08:00
|
|
|
|
onShow((options) => {
|
|
|
|
|
|
console.log('App Show', options)
|
2025-08-08 09:37:36 +08:00
|
|
|
|
// 处理直接进入页面路由的情况:如h5直接输入路由、微信小程序分享后进入等
|
|
|
|
|
|
// https://github.com/unibest-tech/unibest/issues/192
|
2025-08-07 18:25:21 +08:00
|
|
|
|
if (options?.path) {
|
2025-08-21 16:18:28 +08:00
|
|
|
|
navigateToInterceptor.invoke({ url: `/${options.path}`, query: options.query })
|
2025-08-07 18:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
navigateToInterceptor.invoke({ url: '/' })
|
|
|
|
|
|
}
|
2025-06-04 09:00:34 +08:00
|
|
|
|
})
|
|
|
|
|
|
onHide(() => {
|
|
|
|
|
|
console.log('App Hide')
|
|
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
swiper,
|
|
|
|
|
|
scroll-view {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
image {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|