feat: 更新消息推送逻辑

This commit is contained in:
kuaifan 2025-11-03 00:45:34 +08:00
parent 5121739fe4
commit b445af932c
3 changed files with 30 additions and 13 deletions

View File

@ -2,7 +2,11 @@
<div class="mobile-tabbar">
<NetworkException v-if="windowPortrait" type="alert"/>
<ul class="tabbar-box">
<li v-for="item in navList" @click="toggleRoute(item.name)" :class="{active: activeName === item.name}">
<li
v-for="(item, index) in navList"
:key="index"
:class="{active: activeName === item.name}"
@click="toggleRoute(item.name)">
<i class="taskfont" v-html="item.icon"></i>
<div class="tabbar-title">{{ $L(item.label) }}</div>
<template v-if="item.name === 'dashboard'">
@ -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,
});
},
},
};
</script>

View File

@ -1293,7 +1293,10 @@ export default {
});
},
addDialogMsg(data) {
addDialogMsg({silence, data}) {
if (silence) {
return; //
}
if (!this.natificationReady && !this.$isEEUIApp) {
return; //
}

View File

@ -4552,9 +4552,7 @@ export default {
dispatch("saveDialog", newData)
}
}
if (!silence) {
emitter.emit('dialogMsgPush', data);
}
emitter.emit('dialogMsgPush', {silence, data});
}
}
const saveMsg = (data, count) => {