Files
web-fusion/src/views/pk-mini/Forum.vue

95 lines
1.7 KiB
Vue
Raw Normal View History

2026-02-08 15:33:10 +08:00
<template>
<!-- 站内信页面 -->
<div class="forum">
<div class="forum-list">
<el-card
v-for="(item, index) in noticeList"
:key="index"
class="notice-card"
>
<template #header>
<div class="card-header">{{ item.title }}</div>
</template>
<div class="card-body">{{ item.content }}</div>
<template #footer>
<div class="card-footer">{{ item.time }}</div>
</template>
</el-card>
<div v-if="noticeList.length === 0" class="empty-tip">暂无站内信</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { getNoticeList } from '@/api/pk-mini'
const noticeList = ref([])
const page = ref(0)
async function loadNotices() {
try {
const res = await getNoticeList({ page: page.value, size: 20 })
noticeList.value = res || []
} catch (e) {
console.error('加载站内信失败', e)
}
}
onMounted(() => {
loadNotices()
})
</script>
<style scoped lang="less">
.forum {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: flex-start;
padding: 20px;
background: white;
border-radius: 16px;
overflow: auto;
}
.forum-list {
width: 90%;
max-width: 800px;
}
.notice-card {
margin-bottom: 20px;
border-radius: 16px;
border: 1px solid #4fcacd;
background: linear-gradient(180deg, #e4ffff, #ffffff);
}
.card-header {
font-size: 18px;
font-weight: bold;
text-align: center;
}
.card-body {
color: #333;
font-size: 16px;
line-height: 1.6;
}
.card-footer {
font-size: 14px;
color: #999;
text-align: right;
}
.empty-tip {
text-align: center;
padding: 50px;
color: #999;
font-size: 16px;
}
</style>