lxr 2 месяцев назад
Родитель
Сommit
08834a55b5

+ 7 - 0
src/layouts/components/Header/components/NotificationDrawerContent.vue

@@ -180,6 +180,9 @@
         {{ currentDetail?.userName }} {{ currentDetail?.content }}
       </div>
       <div class="detail-dialog-content" v-else>
+        <div style=" font-size: 14px; font-weight: bold;text-align: left">
+          {{ currentDetail?.createTime }}
+        </div>
         {{ currentDetail?.content }}
       </div>
     </el-dialog>
@@ -212,6 +215,8 @@ interface NoticeItem {
   content: string;
   date: string;
   unread: boolean;
+  /** 原始创建时间(接口返回 createdTime) */
+  createTime?: string;
   /** 互动类可能有发送者与头像 */
   userName?: string;
   userImage?: string;
@@ -579,6 +584,7 @@ async function fetchNoticeList(catKey: string) {
         content,
         date: dateStr,
         unread: !item.isRead,
+        createTime: item.createdTime ?? "",
         type: item.type,
         ...(isRelated && {
           userName: item.userName ?? item.senderName ?? item.title ?? "",
@@ -645,6 +651,7 @@ async function handleViewDetail(item: NoticeItem) {
     try {
       const res: any = await readNoticeById({ id: item.id });
       const ok = res?.code === 200 || res?.code === "200";
+      console.log(res, "res");
       if (ok) {
         const key = activeCategory.value;
         const list = listByCategory.value[key] ?? [];