页面下拉刷新以及底部回弹

This commit is contained in:
2026-09-23 18:12:04 +08:00
parent 201d0086a4
commit 6e60a409c5
12 changed files with 219 additions and 28 deletions
+6 -2
View File
@@ -1,6 +1,7 @@
<template>
<view class="page">
<view class="page edge">
<fy-header title="打卡" />
<fy-scroll class="edge-scroll" dock @refresh="reload">
<view v-if="!canPunch" class="deny">当前账号没有打卡权限</view>
<view v-else class="body">
<view class="clock-box">
@@ -41,16 +42,18 @@
</view>
</view>
</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 { clockText, toast } from '../../utils/format.js'
export default {
components: { FyHeader },
components: { FyHeader, FyScroll },
data() {
return { now: clockText(), timer: 0, punching: false, off: null }
},
@@ -92,6 +95,7 @@ export default {
this.punching = false
}
},
reload() { store.refreshAttendance() },
goKind(kind) {
if (!store.can('personal', 'apply')) return toast('没有发起申请权限')
uni.navigateTo({ url: '/pages/apply/form?kind=' + kind })
+6 -2
View File
@@ -1,10 +1,11 @@
<template>
<view class="page">
<view class="page edge">
<fy-header title="通讯录">
<template #right>
<text class="ico" @click="goGroup">建群</text>
</template>
</fy-header>
<fy-scroll class="edge-scroll" dock @refresh="reload">
<wd-search v-model="q" placeholder="搜索同事、部门或手机号" hide-cancel placeholder-left />
<view class="org" @click="goGroups">
<view class="obox">👥</view>
@@ -46,16 +47,18 @@
</view>
<view v-if="!groups.length" class="empty">没有匹配的同事</view>
<text class="foot">仅显示当前所属企业成员 · 数据实时同步</text>
</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 { toast } from '../../utils/format.js'
export default {
components: { FyHeader },
components: { FyHeader, FyScroll },
data() {
return { q: '', open: {}, off: null }
},
@@ -107,6 +110,7 @@ export default {
if (!p.phone) return toast('该同事未登记手机号')
uni.makePhoneCall({ phoneNumber: String(p.phone) })
},
reload() { store.refreshPeoplePhotos() },
goSearch() { uni.navigateTo({ url: '/pages/search/search' }) },
goGroup() { uni.navigateTo({ url: '/pages/chat/create' }) },
goGroups() {
+6 -2
View File
@@ -1,6 +1,7 @@
<template>
<view class="page">
<view class="page edge">
<fy-header title="我的" />
<fy-scroll class="edge-scroll" dock @refresh="reload">
<view class="body">
<view class="card profile">
<view class="row">
@@ -46,18 +47,20 @@
</wd-cell-group>
</view>
</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 { maskPhone } from '../../utils/format.js'
const ME_IDS = ['archive', 'salary', 'perf', 'expense', 'report', 'apply']
export default {
components: { FyHeader },
components: { FyHeader, FyScroll },
data() {
return { off: null }
},
@@ -86,6 +89,7 @@ export default {
goTodo() {
if (store.can('personal', 'approve')) uni.navigateTo({ url: '/pages/todo/list' })
},
reload() { store.refreshPerms() },
goPwd() { uni.navigateTo({ url: '/pages/password/password' }) },
logout() {
uni.showModal({
+10 -6
View File
@@ -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; }
+8 -3
View File
@@ -1,11 +1,11 @@
<template>
<view class="page">
<view class="page edge">
<fy-header :title="greet">
<template #right>
<text class="ico" @click="goSearch">搜索</text>
</template>
</fy-header>
<fy-scroll class="edge-scroll" dock @refresh="reload">
<view class="body">
<view class="hello">
<text class="hello-sub">今天也要高效完成工作</text>
@@ -90,11 +90,13 @@
<text class="arr"></text>
</view>
</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 { toast } from '../../utils/format.js'
import { oaPost } from '../../utils/api.js'
@@ -102,7 +104,7 @@ import { visibleApplyKinds } from '../../utils/apply.js'
import { openHref, tileEmoji } from '../../utils/nav.js'
export default {
components: { FyHeader },
components: { FyHeader, FyScroll },
data() {
return { apps: [], erp: [], todos: [], pendingItems: [], shortcuts: [], todoCount: 0, announce: '', off: null }
},
@@ -156,6 +158,9 @@ export default {
this.off = null
},
methods: {
reload() {
store.refreshWorkbench().then(() => this.pull())
},
pull() {
this.apps = store.personalApps()
this.erp = store.erpModules()