页面下拉刷新以及底部回弹
This commit is contained in:
+10
-6
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<view class="page msg">
|
||||
<view class="page msg edge">
|
||||
<fy-header :title="unread ? ('消息(' + unread + ')') : '消息'">
|
||||
<template #right>
|
||||
<text class="ico sm" @click="goSearch">⌕</text>
|
||||
<text class="ico" @click="plus">+</text>
|
||||
</template>
|
||||
</fy-header>
|
||||
<scroll-view scroll-y class="list">
|
||||
<fy-scroll class="edge-scroll list" dock @refresh="reload">
|
||||
<view v-if="!rows.length" class="empty">暂无会话</view>
|
||||
<view
|
||||
v-for="c in rows"
|
||||
@@ -34,17 +34,18 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</fy-scroll>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FyHeader from '../../components/fy-header.vue'
|
||||
import FyScroll from '../../components/fy-scroll.vue'
|
||||
import FyFileMark from '../../components/fy-file-mark.vue'
|
||||
import { store } from '../../utils/store.js'
|
||||
|
||||
export default {
|
||||
components: { FyHeader, FyFileMark },
|
||||
components: { FyHeader, FyFileMark, FyScroll },
|
||||
data() {
|
||||
return { rows: [], unread: 0, off: null }
|
||||
},
|
||||
@@ -68,6 +69,9 @@ export default {
|
||||
this.rows = store.conversations.slice()
|
||||
this.unread = store.unreadTotal()
|
||||
},
|
||||
reload() {
|
||||
store.refreshPeoplePhotos().finally(() => this.pull())
|
||||
},
|
||||
avText(c) {
|
||||
if (c.type === 'work') return '工'
|
||||
if (c.type === 'group') return '群'
|
||||
@@ -126,8 +130,8 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.msg { display: flex; flex-direction: column; height: 100vh; background: #F5F7FA; }
|
||||
.list { flex: 1; height: 0; background: #fff; }
|
||||
.msg { display: flex; flex-direction: column; height: 100%; background: #F5F7FA; overflow: hidden; }
|
||||
.list { background: #fff; }
|
||||
.ico.sm { font-size: 34rpx; color: #1677FF; }
|
||||
.item { display: flex; align-items: center; padding: 22rpx 28rpx; background: #fff; }
|
||||
.item.pin { background: #F7F8FA; }
|
||||
|
||||
Reference in New Issue
Block a user