oa_app仓库初始化
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<fy-header title="公告" back />
|
||||
<view v-if="!rows.length" class="empty">暂无公告</view>
|
||||
<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 24rpx; padding: 24rpx; }
|
||||
.t { display: block; font-weight: 600; font-size: 30rpx; }
|
||||
.s { font-size: 22rpx; color: #737686; }
|
||||
.c { display: block; font-size: 26rpx; margin-top: 8rpx; }
|
||||
.empty { padding: 80rpx; text-align: center; color: #737686; }
|
||||
</style>
|
||||
Reference in New Issue
Block a user