diff --git a/resources/assets/js/pages/manage/messenger.vue b/resources/assets/js/pages/manage/messenger.vue
index a1f49d5c..6417bcbd 100644
--- a/resources/assets/js/pages/manage/messenger.vue
+++ b/resources/assets/js/pages/manage/messenger.vue
@@ -14,7 +14,7 @@
v-for="(item, key) in dialogType"
:key="key"
:class="{active:dialogActive==item.type}"
- @click="dialogActive=item.type">
+ @click="onActive(item.type)">
{{$L(item.name)}}
@@ -27,6 +27,7 @@
-
@@ -154,6 +155,8 @@ export default {
}
}
return true;
+ }).sort((a, b) => {
+ return $A.Date(a.last_at) - $A.Date(b.last_at);
})
},
@@ -219,6 +222,24 @@ export default {
}
},
+ onActive(type) {
+ if (this.dialogActive == type) {
+ // 再次点击滚动到未读条目
+ const dialog = this.dialogList.find(({unread}) => unread > 0)
+ if (dialog) {
+ try {
+ this.$refs[`dialog_${dialog.id}`][0].scrollIntoView({behavior: "smooth"});
+ } catch (e) {
+ scrollIntoView(this.$refs[`dialog_${dialog.id}`][0], {
+ behavior: 'smooth',
+ inline: 'end',
+ })
+ }
+ }
+ }
+ this.dialogActive = type
+ },
+
closeDialog() {
this.dialogId = 0;
$A.setStorage("messenger::dialogId", 0)