Files
ys-app/src/pages/loading/loading.vue
2025-07-31 17:36:27 +08:00

74 lines
1.7 KiB
Vue

<template>
<view>
<view class="container" :style="{ height: `100vh` }">
<view class="bg"></view>
<view class="version">Version {{ version }}</view>
<view class="bottom-bg"></view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { useUserStore } from '@/stores/user';
const userStore = useUserStore();
let version = ref("1.0.0");
const systemInfo = uni.getSystemInfoSync();
// #ifdef APP-PLUS
version = systemInfo.appWgtVersion,//当前版本号
// #endif
// #ifdef H5
version = systemInfo.appVersion,
// #endif
onLoad((opt) => {
console.log("onLoad");
// 检查是否已登录 并 获取用户信息
if (userStore.isLogin) {
// userStore.getUser()
// TODO 未登录会在拦截器中处理跳转登录页, 请在 xxx 配置登录页路径
uni.reLaunch({
url: '/pages/deviceAuth/deviceAuth',
});
}else{
uni.reLaunch({
url: '/pages/login/login',
});
}
});
</script>
<style>
.container {
background:#307AF5 !important;
height:100vh !important;
position: relative;
}
.container .bg{
background:url('@/static/images/loading-logo.png') no-repeat;
background-size:700rpx 800rpx;
width: 700rpx;
height: 800rpx;
margin:0 auto;
}
.container .version{
color:#A8D4FF;
font-size:32rpx;
text-align: center;
margin-top:35rpx;
}
.container .bottom-bg{
background:url('@/static/images/loading-txt.png') no-repeat;
background-size:656rpx 123rpx;
width: 656rpx;
height: 123rpx;
position: absolute;
bottom:48rpx;
left:50%;
margin-left:-328rpx;
}
</style>