页面下拉刷新以及底部回弹
This commit is contained in:
+10
-4
@@ -1,26 +1,32 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<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 },
|
||||
components: { FyHeader, FyScroll },
|
||||
data() { return { rows: [] } },
|
||||
onShow() {
|
||||
oaGet('/announcements', store.token).then((d) => { this.rows = asList(d) }).catch(() => { this.rows = store.announcements || [] })
|
||||
onShow() { this.load() },
|
||||
methods: {
|
||||
load() {
|
||||
oaGet('/announcements', store.token).then((d) => { this.rows = asList(d) }).catch(() => { this.rows = store.announcements || [] })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user