diff --git a/resources/assets/js/components/Mobile/Tabbar.vue b/resources/assets/js/components/Mobile/Tabbar.vue
index f94077e70..2cb2c8b99 100644
--- a/resources/assets/js/components/Mobile/Tabbar.vue
+++ b/resources/assets/js/components/Mobile/Tabbar.vue
@@ -2,7 +2,11 @@
- -
+
-
{{ $L(item.label) }}
@@ -41,6 +45,14 @@ export default {
};
},
+ mounted() {
+ emitter.on('dialogMsgPush', this.updateBadge);
+ },
+
+ beforeDestroy() {
+ emitter.off('dialogMsgPush', this.updateBadge);
+ },
+
computed: {
...mapState(['cacheDialogs', 'reportUnreadNumber', 'approveUnreadNumber']),
...mapGetters(['dashboardTask']),
@@ -149,14 +161,8 @@ export default {
},
watch: {
- windowActive(active) {
- if (active) {
- return
- }
- $A.eeuiAppSendMessage({
- action: 'setBdageNotify',
- bdage: this.unreadAndOverdue,
- });
+ windowActive() {
+ this.updateBadge();
},
},
@@ -187,6 +193,16 @@ export default {
}
this.goForward(location);
},
+
+ updateBadge() {
+ if (this.windowActive) {
+ return
+ }
+ $A.eeuiAppSendMessage({
+ action: 'setBdageNotify',
+ bdage: this.unreadAndOverdue,
+ });
+ },
},
};
diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue
index 5f53cd250..df7a2c55e 100644
--- a/resources/assets/js/pages/manage.vue
+++ b/resources/assets/js/pages/manage.vue
@@ -1293,7 +1293,10 @@ export default {
});
},
- addDialogMsg(data) {
+ addDialogMsg({silence, data}) {
+ if (silence) {
+ return; // 静默消息不通知
+ }
if (!this.natificationReady && !this.$isEEUIApp) {
return; // 通知未准备好不通知
}
diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js
index 4286e4b74..6f58737db 100644
--- a/resources/assets/js/store/actions.js
+++ b/resources/assets/js/store/actions.js
@@ -4552,9 +4552,7 @@ export default {
dispatch("saveDialog", newData)
}
}
- if (!silence) {
- emitter.emit('dialogMsgPush', data);
- }
+ emitter.emit('dialogMsgPush', {silence, data});
}
}
const saveMsg = (data, count) => {