加上下拉刷新

This commit is contained in:
zhouyanli
2026-08-20 09:17:05 +08:00
parent c39f995bd1
commit 62437fec8c
7 changed files with 84 additions and 69 deletions

View File

@@ -2,8 +2,8 @@
"name" : "花开管家",
"appid" : "__UNI__5F224F3",
"description" : "智慧社区管家端,专为小区物业管理人员打造,支持多小区灵活切换管理。集成账号密码、手机号密码双重登录模式,内置忘记密码找回功能,保障账号安全。涵盖消息通知、日常巡检、故障报修、一键开门、工单流转、投诉处理等核心办公功能,物业人员可在线完成巡检打卡、问题上报、工单派发跟进、投诉对接处理等日常工作,同时支持查看个人上报记录、巡检历史,便捷修改账号信息与登录密码。高效简化社区物业办公流程,提升小区服务与管理效率,打造便捷智能的社区管理服务平台。",
"versionName" : "1.0.8",
"versionCode" : 108,
"versionName" : "1.1.0",
"versionCode" : 110,
"transformPx" : false,
"app-plus" : {
"usingComponents" : true,

View File

@@ -1,11 +1,5 @@
<template>
<view class="page_padding">
<!-- 状态栏 -->
<view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
<!-- 导航栏 -->
<uni-nav-bar title="实收统计" backgroundColor="transparent" :border="false" left-icon="left" @click-left="goBack" />
<!-- 筛选条件 -->
<view class="filter-section">
<view class="filter-row">
@@ -53,7 +47,14 @@
</view>
<!-- 统计表格列表 -->
<scroll-view class="table-scroll" scroll-y show-scrollbar="false">
<scroll-view
class="table-scroll"
scroll-y
show-scrollbar="false"
refresher-enabled
:refresher-triggered="refresherTriggered"
@refresherrefresh="onPullRefresh"
>
<!-- 循环渲染每个表格 -->
<view v-for="(table, index) in tableConfigs" :key="index" class="table-wrapper">
<!-- 标题独立于卡片外 -->
@@ -102,9 +103,6 @@
import { onShow } from '@dcloudio/uni-app'
import { getVillageList,getFeeTypes,getTableList} from '../../api/api.js'
// ============ 系统信息 ============
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
// ============ 筛选数据 ============
// 项目选项(从接口获取)
const projectOptions = ref([])
@@ -119,6 +117,9 @@
// 日期范围
const datetimerange = ref([])
// 下拉刷新触发状态
const refresherTriggered = ref(false)
// ============ 表格数据 ============
const tableConfigs = reactive([
{
@@ -143,7 +144,7 @@
// ============ 获取小区列表 ============
const fetchVillageList = () => {
getVillageList()
return getVillageList()
.then((res) => {
if (res.code === 200 && res.data) {
const list = res.data.map((item) => ({
@@ -164,7 +165,7 @@
// ============ 获取收费类型列表 ============
const fetchFeeTypes = () => {
getFeeTypes()
return getFeeTypes()
.then((res) => {
if (res.code === 200 && res.data) {
const list = res.data.map((item) => ({
@@ -198,7 +199,7 @@
params.startDate = datetimerange.value[0]
params.endDate = datetimerange.value[1]
}
getTableList(params)
return getTableList(params)
.then((res) => {
if (res.code === 200 && res.data) {
// 项目总览
@@ -250,11 +251,19 @@
fetchTableList()
})
// ============ 事件处理 ============
const goBack = () => {
uni.navigateBack()
// 下拉刷新
const onPullRefresh = () => {
refresherTriggered.value = true
Promise.allSettled([
fetchVillageList(),
fetchFeeTypes(),
fetchTableList()
]).finally(() => {
refresherTriggered.value = false
})
}
// ============ 事件处理 ============
const onProjectChange = (e) => {
const index = e.detail.value
const option = projectOptions.value[index]
@@ -295,11 +304,6 @@
flex-direction: column;
height: 100vh;
.status-bar {
width: 100%;
flex-shrink: 0;
}
// ===== 筛选区域(取消背景) =====
.filter-section {
padding: 24rpx 0 16rpx;

View File

@@ -2,18 +2,17 @@
<view class="news-detail-page">
<!-- 循环渲染通知列表 -->
<view class="news-card" v-for="item in noticeList" :key="item.id">
<view class="news-meta">
<text class="author">{{item.notice}}</text>
<!-- <text class="author">{{ item.residentName || '管理员' }}</text> -->
<!-- <text class="publish-time">{{ item.createTime }}</text> -->
</view>
<view class="news-header">
<text class="news-title">{{ item.item || '暂无标题' }}</text>
<view class="unread-dot" v-if="item.isCheckStr === '未读'"></view>
</view>
<view class="news-meta">
<text class="author">{{ item.residentName || '管理员' }}</text>
<text class="publish-time">{{ item.createTime }}</text>
</view>
<view class="news-content">
<text class="content-text">{{ item.problem || item.notice}}</text>
<text class="content-text">{{ item.problem}}</text>
</view>
<view class="detail-btn" @click="goToDetail(item)">

View File

@@ -37,7 +37,13 @@
</view>
<!-- 上报记录列表 -->
<scroll-view class="record-list" scroll-y>
<scroll-view
class="record-list"
scroll-y
refresher-enabled
:refresher-triggered="refresherTriggered"
@refresherrefresh="onPullRefresh"
>
<!-- 记录卡片 -->
<view v-for="record in reportRecords" :key="record.id" class="record-card">
<!-- 标题 + 状态标签 -->
@@ -82,7 +88,7 @@
<script setup>
import { ref } from 'vue'
import { onReachBottom, onPullDownRefresh, onShow } from '@dcloudio/uni-app'
import { onShow } from '@dcloudio/uni-app'
import { getMyOrderList } from '../../api/api.js'
// 分页
const pageNum = ref(1) // 当前页
@@ -90,6 +96,7 @@ const pageSize = ref(10) // 每页条数
const total = ref(0) // 总条数
const loading = ref(false) // 加载状态
const noMore = ref(false) // 是否没有更多
const refresherTriggered = ref(false) // 下拉刷新触发状态
// 筛选状态
const activeStatus = ref('all') // 全部/待分配/待解决/已完成
const activeType = ref('all') // 全部/公共报修/个人报修
@@ -151,23 +158,17 @@ const getReportList = (isRefresh = false) => {
.finally(() => {
loading.value = false
if (isRefresh) {
uni.stopPullDownRefresh()
refresherTriggered.value = false
}
})
}
// 上拉加载更多
onReachBottom(() => {
if (noMore.value || loading.value) return
pageNum.value++
getReportList()
})
// 下拉刷新
onPullDownRefresh(() => {
const onPullRefresh = () => {
refresherTriggered.value = true
pageNum.value = 1
noMore.value = false
getReportList(true)
})
}
// 筛选/分页重置后重新拉数据
const reloadList = () => {

View File

@@ -71,7 +71,7 @@
<script setup>
import { ref } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { onShow, onPullDownRefresh } from '@dcloudio/uni-app'
import { getVillageList, getFeeTypes } from '@/api/api.js'
import FeeOverviewCard from './components/FeeOverviewCard.vue'
import ParkingFeeCard from './components/ParkingFeeCard.vue'
@@ -158,7 +158,7 @@ const fetchVillageList = () => {
}
const fetchManagedArea = (villageId) => {
getManagedArea({ villageId: villageId || '' }).then(res => {
return getManagedArea({ villageId: villageId || '' }).then(res => {
if (res.code === 200 && res.data) {
manageArea.value = res.data.manageArea
serviceHouseholds.value = res.data.serviceHouseCount
@@ -167,7 +167,7 @@ const fetchManagedArea = (villageId) => {
}
const fetchRate = (villageId) => {
getRate({ villageId: villageId || '' }).then(res => {
return getRate({ villageId: villageId || '' }).then(res => {
if (res.code === 200 && res.data) {
occupancyRate.value = res.data.occupancyRate
rentalRate.value = res.data.rentalRate
@@ -176,7 +176,7 @@ const fetchRate = (villageId) => {
}
// 车位收费总览
const fetchParkingFee = (villageId) => {
getParkingFee({ villageId: villageId || '' }).then(res => {
return getParkingFee({ villageId: villageId || '' }).then(res => {
if (res.code === 200 && res.data) {
const d = res.data
parkingCount.value = Number(d.parkingCount) || 0
@@ -189,7 +189,7 @@ const fetchParkingFee = (villageId) => {
// 收费总览
const fetchFeeSummary = () => {
getFeeSummary({
return getFeeSummary({
villageId: selectedProject.value || '',
chargeTypeId: selectedFeeType.value || '',
timeScope: activeTab.value
@@ -226,7 +226,7 @@ const fetchFeeTypes = () => {
}
// 押金余额统计
const fetchDepositBalance = (villageId) => {
getDepositBalance({ villageId: villageId}).then(res => {
return getDepositBalance({ villageId: villageId}).then(res => {
if (res.code === 200 && res.data) {
const d = res.data
depositBalance.value = d.totalBalance
@@ -236,7 +236,7 @@ const fetchDepositBalance = (villageId) => {
}
// 巡检总览
const fetchInspection = (villageId) => {
getInspection({ villageId: villageId || '' }).then(res => {
return getInspection({ villageId: villageId || '' }).then(res => {
if (res.code === 200 && res.data) {
const d = res.data
inspectionList.value = [
@@ -249,15 +249,30 @@ const fetchInspection = (villageId) => {
}).catch(() => {})
}
onShow(() => {
Promise.all([fetchVillageList(), fetchFeeTypes()]).then(() => {
fetchManagedArea(selectedProject.value)
fetchRate(selectedProject.value)
fetchFeeSummary()
fetchParkingFee(selectedProject.value)
fetchDepositBalance(selectedProject.value)
// 加载全部数据(首屏 / 下拉刷新共用)
const loadAll = () => {
return Promise.all([fetchVillageList(), fetchFeeTypes()]).then(() => {
return Promise.allSettled([
fetchManagedArea(selectedProject.value),
fetchRate(selectedProject.value),
fetchFeeSummary(),
fetchParkingFee(selectedProject.value),
fetchDepositBalance(selectedProject.value),
fetchInspection(selectedProject.value)
])
})
}
onShow(() => {
loadAll()
})
onPullDownRefresh(async () => {
try {
await loadAll()
} finally {
uni.stopPullDownRefresh()
}
})
</script>

View File

@@ -137,8 +137,7 @@
{
"path": "revenue_statistics",
"style": {
"navigationBarTitleText": "实收统计",
"navigationStyle": "custom"
"navigationBarTitleText": "实收统计"
}
}
]
@@ -148,7 +147,9 @@
"pages": [{
"path": "statistics",
"style": {
"navigationBarTitleText": "收费总览"
"navigationBarTitleText": "收费总览",
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
}
}]
},
@@ -221,9 +222,10 @@
{
"path": "reportingRecord",
"style": {
"navigationBarTitleText": "上报记录"
"navigationBarTitleText": "上报记录",
// "navigationStyle": "custom",
// "enablePullDownRefresh": true,
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
// "onReachBottomDistance": 100
}
}

View File

@@ -352,7 +352,7 @@ const getInspectionData = () => {
// 获取消息通知
const getNoticeData = () => {
getNewNoticeData().then(res => {
const notice = res.code === 200 && res.data ? (res.data.problem || res.data.notice) : '暂无公告'
const notice = res.code === 200 && res.data ? `${res.data.notice || ''} : ${res.data.item || ''}` : '暂无公告'
// 仅在内容真正变化时才更新
if (noticeText.value !== notice) {
noticeText.value = notice
@@ -716,12 +716,6 @@ onPullDownRefresh(async () => {
width: calc(100% - 30rpx) !important;
}
/* 固定滚动速度 */
:deep(.uni-noticebar__content-text--scrollable) {
animation-duration: 4s !important;
animation-delay: 0s !important;
}
/* 统计区布局 */
.statistics-wrap {
display: flex;