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"> <div class="mobile-tabbar">
<NetworkException v-if="windowPortrait" type="alert"/> <NetworkException v-if="windowPortrait" type="alert"/>
<ul class="tabbar-box"> <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> <i class="taskfont" v-html="item.icon"></i>
<div class="tabbar-title">{{ $L(item.label) }}</div> <div class="tabbar-title">{{ $L(item.label) }}</div>
<template v-if="item.name === 'dashboard'"> <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: { computed: {
...mapState(['cacheDialogs', 'reportUnreadNumber', 'approveUnreadNumber']), ...mapState(['cacheDialogs', 'reportUnreadNumber', 'approveUnreadNumber']),
...mapGetters(['dashboardTask']), ...mapGetters(['dashboardTask']),
@ -149,14 +161,8 @@ export default {
}, },
watch: { watch: {
windowActive(active) { windowActive() {
if (active) { this.updateBadge();
return
}
$A.eeuiAppSendMessage({
action: 'setBdageNotify',
bdage: this.unreadAndOverdue,
});
}, },
}, },
@ -187,6 +193,16 @@ export default {
} }
this.goForward(location); this.goForward(location);
}, },
updateBadge() {
if (this.windowActive) {
return
}
$A.eeuiAppSendMessage({
action: 'setBdageNotify',
bdage: this.unreadAndOverdue,
});
},
}, },
}; };
</script> </script>

View File

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

View File

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