From 1626d13ec8b1a63676e63cf95c5004c4118da3b3 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 26 十月 2025 14:59:48 +0800
Subject: [PATCH] feat:移除app 中我的栏目中不要的功能
---
app/pages/index.vue | 36 ++++++++++++++++++++----------------
1 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/app/pages/index.vue b/app/pages/index.vue
index 62a019b..ea9ae6d 100644
--- a/app/pages/index.vue
+++ b/app/pages/index.vue
@@ -163,6 +163,7 @@
import { getUserProfile } from '@/api/system/user'
import { getUserBoundVehicle } from '@/api/vehicle'
import { getUnreadCount } from '@/api/message'
+ import { formatDateTime } from '@/utils/common'
export default {
data() {
@@ -248,10 +249,26 @@
getUnreadCount().then(response => {
if (response.code === 200) {
this.unreadMessageCount = response.data || 0
+ // 鏇存柊TabBar寰芥爣
+ this.updateTabBarBadge(this.unreadMessageCount)
}
}).catch(error => {
console.error('鑾峰彇鏈娑堟伅鏁伴噺澶辫触:', error)
})
+ },
+
+ // 鏇存柊TabBar寰芥爣
+ updateTabBarBadge(count) {
+ if (count > 0) {
+ uni.setTabBarBadge({
+ index: 3, // 娑堟伅椤甸潰鍦╰abBar涓殑绱㈠紩
+ text: count > 99 ? '99+' : count.toString()
+ })
+ } else {
+ uni.removeTabBarBadge({
+ index: 3
+ })
+ }
},
// 鍔犺浇鐢ㄦ埛淇℃伅锛堜繚鐣欎互鍏煎涔嬪墠鐨勪唬鐮侊級
@@ -315,7 +332,7 @@
vehicleList: task.assignedVehicles || [],
startLocation: this.formatAddress(task.departureAddress || task.startLocation || '鏈缃�'),
endLocation: this.formatAddress(task.destinationAddress || task.endLocation || '鏈缃�'),
- startTime: task.plannedStartTime ? this.formatDateTime(task.plannedStartTime) : '鏈缃�',
+ startTime: task.plannedStartTime ? formatDateTime(task.plannedStartTime, 'YYYY-MM-DD HH:mm') : '鏈缃�',
assignee: task.assigneeName || '鏈垎閰�',
taskNo: task.taskCode || '鏈煡缂栧彿',
status: this.convertStatus(task.taskStatus) // 杞崲鐘舵�佹牸寮忎互鍏煎鏃I
@@ -324,19 +341,6 @@
}).catch(error => {
this.loading = false
console.error('鍔犺浇浠诲姟鍒楄〃澶辫触:', error)
- })
- },
-
- // 鏍煎紡鍖栨棩鏈熸椂闂�
- formatDateTime(dateTime) {
- if (!dateTime) return ''
- const date = new Date(dateTime)
- return date.toLocaleString('zh-CN', {
- year: 'numeric',
- month: '2-digit',
- day: '2-digit',
- hour: '2-digit',
- minute: '2-digit'
})
},
@@ -528,13 +532,13 @@
'MAINTENANCE': '缁翠慨淇濆吇',
'FUEL': '鍔犳补',
'OTHER': '鍏朵粬',
- 'EMERGENCY_TRANSFER': '鎬ユ晳杞繍',
+ 'EMERGENCY_TRANSFER': '杞繍浠诲姟',
'WELFARE': '绂忕杞�',
// 鏃ф牸寮忥紙UI绫诲瀷锛�
'maintenance': '缁翠慨淇濆吇',
'refuel': '鍔犳补',
'inspection': '宸℃',
- 'emergency': '鎬ユ晳杞繍',
+ 'emergency': '杞繍浠诲姟',
'welfare': '绂忕杞�'
}
return typeMap[type] || '鏈煡绫诲瀷'
--
Gitblit v1.9.1