mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 12:02:51 +00:00
feat: 更新消息推送逻辑
This commit is contained in:
parent
5121739fe4
commit
b445af932c
@ -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>
|
||||
|
||||
@ -1293,7 +1293,10 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
addDialogMsg(data) {
|
||||
addDialogMsg({silence, data}) {
|
||||
if (silence) {
|
||||
return; // 静默消息不通知
|
||||
}
|
||||
if (!this.natificationReady && !this.$isEEUIApp) {
|
||||
return; // 通知未准备好不通知
|
||||
}
|
||||
|
||||
4
resources/assets/js/store/actions.js
vendored
4
resources/assets/js/store/actions.js
vendored
@ -4552,9 +4552,7 @@ export default {
|
||||
dispatch("saveDialog", newData)
|
||||
}
|
||||
}
|
||||
if (!silence) {
|
||||
emitter.emit('dialogMsgPush', data);
|
||||
}
|
||||
emitter.emit('dialogMsgPush', {silence, data});
|
||||
}
|
||||
}
|
||||
const saveMsg = (data, count) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user