<template>
  <view class="app-container">
    <ProfileView />
  </view>
</template>

<script setup lang="ts">
import { onShow } from '@dcloudio/uni-app'
import { useAuthStore } from '@/stores/auth'
import ProfileView from '@/components/my/ProfileView.vue'

const authStore = useAuthStore()

onShow(() => {
  const pages = getCurrentPages()
  const page = pages[pages.length - 1] as any
  const role = authStore.userRole
  const index = role === 'dispatch' ? 3 : 2
  page?.getTabBar?.()?.setSelected?.(index)
})
</script>
