44 lines
1.5 KiB
Vue
44 lines
1.5 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">
|
|
<view class="top">
|
|
<text class="chip">公告</text>
|
|
<text class="s">{{ r.createdAt || r.publishAt || '' }}</text>
|
|
</view>
|
|
<text class="t">{{ r.title }}</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 24rpx; padding: 28rpx 24rpx; }
|
|
.top { display: flex; align-items: center; justify-content: space-between; }
|
|
.s { font-size: 22rpx; color: #9CA3AF; }
|
|
.t { display: block; margin-top: 16rpx; font-weight: 650; font-size: 30rpx; line-height: 1.45; color: #111827; }
|
|
.c { display: block; font-size: 26rpx; margin-top: 12rpx; color: #4B5563; line-height: 1.65; }
|
|
</style>
|