home.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <script setup>
  2. import { onShow } from '@dcloudio/uni-app'
  3. import { useUserStore } from '@/stores/user'
  4. import { PAGE_PATHS } from '@/config/api'
  5. import { getSafeAreaStyle } from '@/utils/safeArea'
  6. const safeAreaStyle = getSafeAreaStyle()
  7. const userStore = useUserStore()
  8. onShow(() => {
  9. userStore.checkLoginStatus()
  10. if (!userStore.isLoggedIn) {
  11. uni.reLaunch({ url: PAGE_PATHS.login })
  12. }
  13. })
  14. const goWorkbench = () => {
  15. uni.reLaunch({ url: PAGE_PATHS.workbench })
  16. }
  17. </script>
  18. <template>
  19. <view class="mp-page mp-page--tab">
  20. <view class="sq-nav-header" :style="safeAreaStyle">
  21. <view class="sq-nav-header__nav">
  22. <view class="sq-nav-header__left">
  23. <text class="sq-nav-header__title">首页</text>
  24. </view>
  25. <view /><!-- 胶囊占位 -->
  26. </view>
  27. </view>
  28. <view class="mp-placeholder">
  29. <view class="mp-placeholder__icon" />
  30. <text class="mp-placeholder__title">首页功能建设中</text>
  31. <text class="mp-placeholder__desc">请从底部「工作台」进入 CRM、报销、地磅、运输业务办理。</text>
  32. <button class="mp-btn mp-btn--primary" style="margin-top: 40rpx; padding: 0 48rpx" @click="goWorkbench">
  33. 前往工作台
  34. </button>
  35. </view>
  36. </view>
  37. </template>