home.vue 1.1 KB

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