6/16,同步

This commit is contained in:
Zy
2026-06-16 14:11:17 +08:00
parent 3a91b14fce
commit 7c5497d229
13 changed files with 230 additions and 188 deletions

View File

@@ -29,12 +29,13 @@
class="record-list flex-1"
scroll-y
lower-threshold="60"
enable-flex="true"
@scrolltolower="scrolltolower"
>
<!-- 空状态 -->
<view v-if="reportRecords.length === 0" class="empty-state">
<uni-icons type="empty" size="60" color="#ccc"></uni-icons>
<text class="empty-text">暂无上报记录</text>
<text class="empty-text">暂无记录</text>
</view>
<!-- 记录卡片 -->
<view
@@ -63,18 +64,6 @@
<view class="card-content">
{{ record.problem }}
</view>
<!-- 工单图片 -->
<!-- <view class="card-image">
<image
lazy-load
v-for="(item, index) in record.images"
:key="index"
:src="item"
class="images"
mode="scaleToFill"
></image>
</view -->
<!-- 底部信息 -->
<view class="card-footer">
<text class="create-time">{{ record.createTime }}</text>
@@ -129,29 +118,33 @@ const isLoading = ref(false) // 加载锁
const hasMore = ref(true) // 是否还有更多数据
const total = ref(0)
function scrolltolower() {
// 必须加这两个判断!
if (isLoading.value || !hasMore.value) {
return
}
if (isLoading.value || !hasMore.value) return
queryParmas.value.pageNum += 1
getlist()
}
function getlist() {
// 1. 如果正在加载或没有更多数据,直接返回
if (isLoading.value || !hasMore.value) return
// 2. 开启锁
isLoading.value = true
getUserTicketlist(queryParmas.value)
.then(res => {
reportRecords.value = [...reportRecords.value, ...res.rows]
hasMore.value = reportRecords.value.length < total.value
total.value = res.total
const list = res.rows.map(item => ({
...item,
repairImageUrlList: item.repairImageUrl
? item.repairImageUrl.split(',').filter(Boolean)
: []
}))
if (queryParmas.value.pageNum === 1) {
reportRecords.value = list
} else {
reportRecords.value.push(...list)
}
hasMore.value = reportRecords.value.length < total.value
})
.catch(err => {
uni.showToast({
icon: 'error',
title: '网络异常'
})
uni.showToast({ icon: 'error', title: '网络异常' })
})
.finally(() => {
isLoading.value = false
@@ -232,6 +225,8 @@ function handlePrivew(imgs) {
width: 100%;
height: 100vh;
overflow: hidden;
display: flex;
flex-direction: column;
box-sizing: border-box;
background: linear-gradient(225deg, #e2f0ff 0%, #f9f9f9 50.71%);
}
@@ -239,6 +234,8 @@ function handlePrivew(imgs) {
.hall_body {
padding: 0 40rpx;
overflow: hidden;
display: flex;
flex-direction: column;
}
/* 状态筛选标签 */
.status-tabs {
@@ -315,6 +312,8 @@ function handlePrivew(imgs) {
box-sizing: border-box;
padding-bottom: 40rpx;
overflow-y: auto;
height: 0;
flex: 1;
}
/* 空状态 */