diff --git a/resources/assets/js/functions/web.js b/resources/assets/js/functions/web.js index 16ffb726c..e40e91297 100755 --- a/resources/assets/js/functions/web.js +++ b/resources/assets/js/functions/web.js @@ -102,13 +102,11 @@ * @returns {*|string} */ formatTime(date) { - let time = $A.Date(date, true), - now = $A.Time(), + let now = $A.Time(), + time = $A.Date(date, true), string = ''; - if ($A.formatDate('Ymd', now) === $A.formatDate('Ymd', time)) { + if (now - time < 3600 * 6 || $A.formatDate('Ymd', now) === $A.formatDate('Ymd', time)) { string = $A.formatDate('H:i', time) - } else if (now - time < 86400 * 7) { - string = $A.formatDate('m-d H:i', time) } else if ($A.formatDate('Y', now) === $A.formatDate('Y', time)) { string = $A.formatDate('m-d', time) } else { diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue index 8d916175c..0e14f9994 100644 --- a/resources/assets/js/pages/manage.vue +++ b/resources/assets/js/pages/manage.vue @@ -907,7 +907,10 @@ export default { return; // 可见 且 路由匹配时 } // - const {id, dialog_id, type, msg} = data; + const {id, dialog_id, type, msg, userid} = data; + if (userid == this.userId) { + return; // 自己的消息不弹出通知 + } let body = ''; switch (type) { case 'text': diff --git a/resources/assets/js/pages/manage/components/DialogView.vue b/resources/assets/js/pages/manage/components/DialogView.vue index eee7ff5fa..302043f0f 100644 --- a/resources/assets/js/pages/manage/components/DialogView.vue +++ b/resources/assets/js/pages/manage/components/DialogView.vue @@ -47,7 +47,8 @@
-
{{$A.formatTime(msgData.created_at)}}
+
{{msgData.created_at}}
+
{{$A.formatTime(msgData.created_at)}}
{ - this.$store.dispatch("getDialogs", true).catch(() => {}); + if (this.tabActive === 'dialog') { + this.$store.dispatch("getDialogs", true).catch(() => {}); + } }, 2000) }, }