修复bug,优化消息通知滚动

This commit is contained in:
zhouyanli
2026-08-19 17:02:14 +08:00
parent 52c041a4e6
commit c39f995bd1
4 changed files with 52 additions and 43 deletions

View File

@@ -1,14 +1,14 @@
<template>
<view class="report-record-page">
<view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
<!-- <view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view> -->
<!-- 顶部导航栏 -->
<uni-nav-bar
<!-- <uni-nav-bar
left-icon="back"
title="上报记录"
backgroundColor="transparent"
:border="false"
@clickLeft="navBack"
/>
/> -->
<!-- 状态筛选标签 -->
<view class="status-tabs">
@@ -37,11 +37,7 @@
</view>
<!-- 上报记录列表 -->
<scroll-view
class="record-list"
scroll-y
:style="{ height: `calc(100vh - ${navHeight + statusTabHeight + typeTabHeight}px)` }"
>
<scroll-view class="record-list" scroll-y>
<!-- 记录卡片 -->
<view v-for="record in reportRecords" :key="record.id" class="record-card">
<!-- 标题 + 状态标签 -->
@@ -86,17 +82,11 @@
<script setup>
import { ref } from 'vue'
import { onReady, onReachBottom, onPullDownRefresh, onShow } from '@dcloudio/uni-app'
import { onReachBottom, onPullDownRefresh, onShow } from '@dcloudio/uni-app'
import { getMyOrderList } from '../../api/api.js'
// 导航栏/标签高度(适配不同设备)
const navHeight = ref(44)
const statusTabHeight = ref(88)
const typeTabHeight = ref(88)
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
// 分页
const pageNum = ref(1) // 当前页
const pageSize = ref(5) // 每页条数
const pageSize = ref(10) // 每页条数
const total = ref(0) // 总条数
const loading = ref(false) // 加载状态
const noMore = ref(false) // 是否没有更多
@@ -107,7 +97,7 @@ const activeType = ref('all') // 全部/公共报修/个人报修
// 状态筛选选项
const statusTabs = ref([
{ label: '全部', value: 'all' },
// { label: '待分配', value: 'pending' },
{ label: '待分配', value: '0' },
{ label: '待解决', value: '1' },
{ label: '已完成', value: '2' }
])
@@ -211,7 +201,7 @@ const navBack = () => {
// 获取状态文本
const getStatusText = status => {
const statusMap = {
// "pending": '已分配',
0: '待分配',
1: '待解决',
2: '已完成'
}
@@ -220,6 +210,7 @@ const getStatusText = status => {
// 获取状态标签样式类名
const getStatusClass = status => {
const classMap = {
0:'pending',
1: 'processing',
2: 'completed'
}
@@ -230,26 +221,15 @@ onShow(() => {
noMore.value = false
getReportList()
})
// 页面渲染完成后适配高度
onReady(() => {
// 可根据实际设备调整高度
uni.getSystemInfo({
success: res => {
if (res.platform === 'ios') {
navHeight.value = 44
} else {
navHeight.value = 48
}
}
})
})
</script>
<style scoped>
.report-record-page {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
box-sizing: border-box;
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
}
.status-bar {
@@ -265,6 +245,7 @@ onReady(() => {
padding: 0 40rpx;
height: 88rpx;
align-items: center;
flex-shrink: 0;
}
.status-tab-item {
@@ -304,6 +285,7 @@ onReady(() => {
padding: 20rpx 40rpx;
margin-top: 10rpx;
justify-content: flex-start;
flex-shrink: 0;
/* gap: 20rpx; */
}
@@ -325,6 +307,8 @@ onReady(() => {
/* 记录列表 */
.record-list {
flex: 1;
min-height: 0;
padding: 20rpx 40rpx;
box-sizing: border-box;
}
@@ -346,14 +330,18 @@ onReady(() => {
}
.card-title {
flex: 1;
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-right: 20rpx;
word-break: break-all;
}
/* 状态标签 */
.status-tag {
flex-shrink: 0;
white-space: nowrap;
padding: 6rpx 16rpx;
font-size: 20rpx;
border-radius: 12rpx;