splash.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <ie-page :fix-height="true">
  3. <view class="flex-1 min-h-1 h-full flex items-center justify-center">
  4. <uv-image :src="imgLaunch" width="55vw" height="auto" mode="widthFix" bgColor="white" custom-class="-mt-300">
  5. <template #loading>
  6. <span></span>
  7. </template>
  8. </uv-image>
  9. </view>
  10. </ie-page>
  11. </template>
  12. <script lang="ts" setup>
  13. import config from '@/config';
  14. import { useAppStore } from '@/store/appStore';
  15. import { useAppConfig } from '@/hooks/useAppConfig';
  16. import { useUserStore } from '@/store/userStore';
  17. import { useTransferPage } from '@/hooks/useTransferPage';
  18. const appStore = useAppStore();
  19. const userStore = useUserStore();
  20. const { transferTo } = useTransferPage();
  21. // #ifdef H5
  22. uni.hideTabBar();
  23. // #endif
  24. const imgLaunch = computed(() => {
  25. return config.ossUrl + '/launch.png'
  26. });
  27. const handleLoad = () => {
  28. if (window.platform === 'wap2app') {
  29. window.webviewBridge.getStatusBarHeight().then(height => {
  30. appStore.statusBarHeight = height;
  31. });
  32. }
  33. // 执行初始化的操作:预加载字典、提前校验token是否有效等
  34. appStore.init().then(() => {
  35. setTimeout(() => {
  36. transferTo('/pagesMain/pages/index/index', {
  37. type: 'reLaunch'
  38. });
  39. }, 1200);
  40. });
  41. };
  42. onLoad(() => {
  43. handleLoad();
  44. });
  45. </script>
  46. <style></style>