From e88374c377b3d51839e79060094dbd80092db88f Mon Sep 17 00:00:00 2001 From: Timi Date: Wed, 18 Nov 2026 16:15:51 +0800 Subject: [PATCH] fix(notify): update read status for tablet --- src/pages/notify/UserNotifyDetail.vue | 4 ++++ src/pages/notify/UserNotifyList.vue | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/pages/notify/UserNotifyDetail.vue b/src/pages/notify/UserNotifyDetail.vue index 6d07313..65a348f 100644 --- a/src/pages/notify/UserNotifyDetail.vue +++ b/src/pages/notify/UserNotifyDetail.vue @@ -57,6 +57,9 @@ const props = withDefaults(defineProps<{ }>(), { notifyId: "" }); +const emit = defineEmits<{ + read: []; +}>(); const route = useRoute(); const router = useRouter(); @@ -171,6 +174,7 @@ async function markRead(item: NotifyDetail, requestToken: number): Promise } try { await NotifyAPI.markInternalRead(item.id); + emit("read"); if (requestToken === loadToken && detail.value) { detail.value = { ...detail.value, diff --git a/src/pages/notify/UserNotifyList.vue b/src/pages/notify/UserNotifyList.vue index 72de29a..6a2adcd 100644 --- a/src/pages/notify/UserNotifyList.vue +++ b/src/pages/notify/UserNotifyList.vue @@ -94,6 +94,7 @@ @@ -233,6 +234,16 @@ async function refresh(): Promise { } } +async function handleDetailRead(): Promise { + try { + await reloadList(); + await loadUnreadCount(); + } catch (error) { + console.warn("已读通知刷新失败", error); + Message.error("通知列表刷新失败"); + } +} + // ---------- 操作 ---------- const isMarkingAllRead = ref(false);