Files
oa_app/pages/notice/list.vue
T
2026-09-23 17:47:57 +08:00

35 lines
1.2 KiB
Vue

<template>
<view class="page">
<fy-header title="公告" back />
<wd-status-tip v-if="!rows.length" image="content" tip="暂无公告" />
<view v-for="r in rows" :key="r.id" class="card item">
<text class="t">{{ r.title }}</text>
<text class="s">{{ r.createdAt || r.publishAt || '' }}</text>
<text class="c">{{ r.content || r.summary || '' }}</text>
</view>
</view>
</template>
<script>
import FyHeader from '../../components/fy-header.vue'
import { store } from '../../utils/store.js'
import { asList } from '../../utils/format.js'
import { oaGet } from '../../utils/api.js'
export default {
components: { FyHeader },
data() { return { rows: [] } },
onShow() {
oaGet('/announcements', store.token).then((d) => { this.rows = asList(d) }).catch(() => { this.rows = store.announcements || [] })
}
}
</script>
<style scoped>
.item { margin: 16rpx 28rpx; padding: 28rpx; }
.t { display: block; font-weight: 650; font-size: 30rpx; line-height: 1.45; }
.s { display: block; font-size: 24rpx; color: #6B7280; margin-top: 10rpx; }
.c { display: block; font-size: 28rpx; margin-top: 16rpx; color: #374151; line-height: 1.65; }
.empty { padding: 120rpx 40rpx; text-align: center; color: #6B7280; font-size: 28rpx; }
</style>