|
|
@@ -91,7 +91,7 @@ import { ref, computed } from 'vue'
|
|
|
import BottomNav from '../../components/common/BottomNav.vue'
|
|
|
import { useAuthStore } from '../../stores/auth'
|
|
|
import { useNotificationStore } from '../../stores/notification'
|
|
|
-import { navigateTo, redirectTo, showModal } from '../../utils'
|
|
|
+import { navigateTo, showModal, showToast } from '../../utils'
|
|
|
|
|
|
const authStore = useAuthStore()
|
|
|
const notificationStore = useNotificationStore()
|
|
|
@@ -107,13 +107,13 @@ const userPhone = computed(() => {
|
|
|
const unreadCount = computed(() => notificationStore.unreadCount)
|
|
|
|
|
|
const navItems = [
|
|
|
- { text: '首页', path: '/pages/construction/home', icon: '' },
|
|
|
- { text: '任务', path: '/pages/construction/taskList', icon: '' },
|
|
|
- { text: '我的', path: '/pages/construction/myPage', icon: '' },
|
|
|
+ { text: '首页', path: '/pages/construction/home', icon: 'uniui-home-filled' },
|
|
|
+ { text: '任务', path: '/pages/construction/taskList', icon: 'uniui-flag-filled' },
|
|
|
+ { text: '我的', path: '/pages/construction/myPage', icon: 'uniui-person-filled' },
|
|
|
]
|
|
|
|
|
|
function onNavChange(path: string) {
|
|
|
- uni.navigateTo({ url: path })
|
|
|
+ uni.reLaunch({ url: path })
|
|
|
}
|
|
|
|
|
|
function goToBasicInfo() {
|
|
|
@@ -138,10 +138,11 @@ function logout() {
|
|
|
content: '确定要退出登录吗?',
|
|
|
showCancel: true,
|
|
|
confirmText: '退出',
|
|
|
- success: (res) => {
|
|
|
+ success: async (res: any) => {
|
|
|
if (res.confirm) {
|
|
|
- authStore.logout()
|
|
|
- redirectTo('/pages/login/login')
|
|
|
+ await authStore.doLogout()
|
|
|
+ showToast('已退出登录')
|
|
|
+ uni.reLaunch({ url: '/pages/login/login' })
|
|
|
}
|
|
|
}
|
|
|
})
|