Commit 1e37fd4dd3e9e425e7063c51cdd2fa3662a6bb47

Authored by ww
1 parent 6f300d7c

fix: tabbar badge not real update

@@ -165,7 +165,7 @@ @@ -165,7 +165,7 @@
165 const res = await uni.$u.http.get('/yt/homepage/app?login=true'); 165 const res = await uni.$u.http.get('/yt/homepage/app?login=true');
166 if (res) { 166 if (res) {
167 //异步实时更新告警徽标数 167 //异步实时更新告警徽标数
168 - this.updateBadgeTotal(res.totalAlarm?.activedAlarm); 168 + await this.updateBadgeTotal(res.totalAlarm?.activedAlarm);
169 } 169 }
170 }, 500); 170 }, 500);
171 } 171 }
@@ -97,7 +97,7 @@ @@ -97,7 +97,7 @@
97 url: 'pages/alarm/alarm', 97 url: 'pages/alarm/alarm',
98 icon: '../../../static/alert-un.png', 98 icon: '../../../static/alert-un.png',
99 iconFill: '../../../static/alert-yes.png', 99 iconFill: '../../../static/alert-yes.png',
100 - badge: this.getAlarmBadge 100 + badge: this.$store.state.badgeInfo
101 }, 101 },
102 { 102 {
103 name: '我的', 103 name: '我的',
@@ -125,7 +125,7 @@ @@ -125,7 +125,7 @@
125 url: 'pages/alarm/alarm', 125 url: 'pages/alarm/alarm',
126 icon: '/static/alert-un.png', 126 icon: '/static/alert-un.png',
127 iconFill: '/static/alert-yes.png', 127 iconFill: '/static/alert-yes.png',
128 - badge: this.getAlarmBadge 128 + badge: this.$store.state.badgeInfo
129 }, 129 },
130 { 130 {
131 name: '我的', 131 name: '我的',
@@ -157,7 +157,7 @@ @@ -157,7 +157,7 @@
157 }, 157 },
158 methods: { 158 methods: {
159 onTabbar(index) { 159 onTabbar(index) {
160 - this.list[2].badge = this.getAlarmBadge; 160 + // this.list[2].badge = this.getAlarmBadge;
161 161
162 if (this.list[index].url) { 162 if (this.list[index].url) {
163 if (this.path !== this.list[index].url) { 163 if (this.path !== this.list[index].url) {
@@ -173,8 +173,9 @@ @@ -173,8 +173,9 @@
173 const oldRecord = this.list[2] 173 const oldRecord = this.list[2]
174 this.$set(this.list, 2, { 174 this.$set(this.list, 2, {
175 ...oldRecord, 175 ...oldRecord,
176 - badge: newValue 176 + badge: this.$store.state.badgeInfo
177 }) 177 })
  178 +
178 } 179 }
179 } 180 }
180 }; 181 };