From 310633feef20e9b77d44fd25e0b41778e033b33b Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期二, 11 十一月 2025 21:48:46 +0800
Subject: [PATCH] feat: 车辆GPS统计,并修改了一些变更任务状态的逻辑
---
app/pages/index.vue | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/app/pages/index.vue b/app/pages/index.vue
index ea9ae6d..72efa8a 100644
--- a/app/pages/index.vue
+++ b/app/pages/index.vue
@@ -196,6 +196,13 @@
}
},
onLoad() {
+ // 妫�鏌ョ敤鎴锋槸鍚﹀凡鐧诲綍
+ const userId = this.currentUser.userId
+ if (!userId) {
+ console.log('鐢ㄦ埛鏈櫥褰曪紝璺宠繃鍔犺浇鏁版嵁')
+ return
+ }
+
// 鍔犺浇鐢ㄦ埛缁戝畾杞﹁締淇℃伅
this.loadUserVehicle()
// 鍔犺浇姝e湪杩愯鐨勪换鍔�
@@ -204,6 +211,13 @@
this.loadUnreadMessageCount()
},
onShow() {
+ // 妫�鏌ョ敤鎴锋槸鍚﹀凡鐧诲綍
+ const userId = this.currentUser.userId
+ if (!userId) {
+ console.log('鐢ㄦ埛鏈櫥褰曪紝璺宠繃鍔犺浇鏁版嵁')
+ return
+ }
+
// 姣忔鏄剧ず椤甸潰鏃跺埛鏂颁换鍔″垪琛ㄣ�佺粦瀹氳溅杈嗗拰娑堟伅鏁伴噺
this.loadUserVehicle()
this.loadRunningTasks()
@@ -246,6 +260,13 @@
// 鍔犺浇鏈娑堟伅鏁伴噺
loadUnreadMessageCount() {
+ // 妫�鏌ョ敤鎴锋槸鍚﹀凡鐧诲綍
+ const userId = this.currentUser.userId
+ if (!userId) {
+ console.log('鐢ㄦ埛鏈櫥褰曪紝璺宠繃鑾峰彇鏈娑堟伅鏁伴噺')
+ return
+ }
+
getUnreadCount().then(response => {
if (response.code === 200) {
this.unreadMessageCount = response.data || 0
--
Gitblit v1.9.1