41 lines
1.4 KiB
Vue
41 lines
1.4 KiB
Vue
<template>
|
|
<view class="page edge">
|
|
<fy-header title="公告" back />
|
|
<fy-scroll class="edge-scroll" @refresh="load">
|
|
<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>
|
|
</fy-scroll>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import FyHeader from '../../components/fy-header.vue'
|
|
import FyScroll from '../../components/fy-scroll.vue'
|
|
import { store } from '../../utils/store.js'
|
|
import { asList } from '../../utils/format.js'
|
|
import { oaGet } from '../../utils/api.js'
|
|
|
|
export default {
|
|
components: { FyHeader, FyScroll },
|
|
data() { return { rows: [] } },
|
|
onShow() { this.load() },
|
|
methods: {
|
|
load() {
|
|
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>
|