feat: 更新通知相关字段,修正数据结构以适应新 API 版本

This commit is contained in:
2026-01-08 23:44:50 +07:00
parent 2706807abd
commit 1e1cf00975
4 changed files with 13 additions and 13 deletions

View File

@@ -24,11 +24,11 @@ function getConfigByType(type: string) {
<!-- 图标和标题 -->
<div class="flex items-start gap-4">
<div class="bg-text-950 p-2.5 rounded-full shrink-0">
<Icon :icon="getConfigByType(data.type).icon" class="text-2xl" :style="{ color: getConfigByType(data.type).color }" />
<Icon :icon="getConfigByType(data.notification.type).icon" class="text-2xl" :style="{ color: getConfigByType(data.notification.type).color }" />
</div>
<div class="flex-1 min-w-0">
<div class="text-xl font-semibold wrap-break-word">
{{ data.title }}
{{ data.notification.title }}
</div>
<ion-note class="text-xs">
{{ useDateFormat(data.createdAt, 'YYYY-MM-DD HH:mm:ss') }}
@@ -41,7 +41,7 @@ function getConfigByType(type: string) {
<!-- 内容 -->
<div class="notification-content">
<p class="text-base leading-relaxed whitespace-pre-wrap wrap-break-word">
{{ data.content }}
{{ data.notification.content }}
</p>
</div>
</div>

View File

@@ -104,13 +104,13 @@ onBeforeMount(() => {
@click="handleItemClick(item)"
>
<div slot="start" class="bg-text-950 p-2.5 rounded-full">
<Icon :icon="getConfigByType(item.type).icon" class="text-2xl" :style="{ color: getConfigByType(item.type).color }" />
<Icon :icon="getConfigByType(item.notification.type).icon" class="text-2xl" :style="{ color: getConfigByType(item.notification.type).color }" />
</div>
<div class="pl-3 w-full">
<div class="flex items-center justify-between mb-1">
<div class="flex-center gap-2">
<div class="text-md font-semibold">
{{ item.title }}
{{ item.notification.title }}
</div>
<div v-show="item.status === 'unread'" class="h-2 w-2 bg-red-500 rounded-full" />
</div>
@@ -119,7 +119,7 @@ onBeforeMount(() => {
</ion-note>
</div>
<div class="text-xs overflow-hidden text-ellipsis">
{{ item.content }}
{{ item.notification.content }}
</div>
</div>
</ion-item>