6/16,同步
This commit is contained in:
@@ -26,7 +26,13 @@
|
||||
</view>
|
||||
|
||||
<!-- 上报记录列表 -->
|
||||
<scroll-view class="record-list" scroll-y lower-threshold="60" @scrolltolower="scrolltolower">
|
||||
<scroll-view
|
||||
ref="scrollRef"
|
||||
class="record-list"
|
||||
scroll-y
|
||||
lower-threshold="60"
|
||||
@scrolltolower="scrolltolower"
|
||||
>
|
||||
<!-- 空状态 -->
|
||||
<view v-if="reportRecords.length === 0" class="empty-state">
|
||||
<uni-icons type="empty" size="60" color="#ccc"></uni-icons>
|
||||
@@ -74,6 +80,7 @@
|
||||
:key="index"
|
||||
:src="item"
|
||||
class="images"
|
||||
@tap="handlePrivew(record.repairImageUrlList, index)"
|
||||
mode="scaleToFill"
|
||||
></image>
|
||||
</view>
|
||||
@@ -136,9 +143,7 @@ const total = ref(0)
|
||||
|
||||
function scrolltolower() {
|
||||
// 必须加这两个判断!
|
||||
if (isLoading.value || !hasMore.value) {
|
||||
return
|
||||
}
|
||||
if (isLoading.value || !hasMore.value) return
|
||||
queryParmas.value.pageNum += 1
|
||||
getlist()
|
||||
}
|
||||
@@ -148,12 +153,17 @@ function getlist() {
|
||||
isLoading.value = true
|
||||
getTicketHallList(queryParmas.value)
|
||||
.then(res => {
|
||||
reportRecords.value = [...reportRecords.value, ...res.rows]
|
||||
reportRecords.value.forEach(item => {
|
||||
item.repairImageUrlList = item.repairImageUrl
|
||||
? item.repairImageUrl.split(',').filter(item => item)
|
||||
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)
|
||||
}
|
||||
total.value = res.total
|
||||
hasMore.value = reportRecords.value.length < total.value
|
||||
})
|
||||
@@ -176,7 +186,7 @@ function getlist() {
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
resetList()
|
||||
getlist()
|
||||
})
|
||||
|
||||
function resetList() {
|
||||
@@ -245,85 +255,86 @@ function handleMain(id) {
|
||||
}
|
||||
|
||||
/* 预览图片 */
|
||||
function handlePrivew(imgs) {
|
||||
// if (imgs.length > 0) {
|
||||
// uni.previewImage({
|
||||
// urls: imgs,
|
||||
// success(e) {
|
||||
// console.log(JSON.stringify(e))
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
function handlePrivew(items, index) {
|
||||
if (items.length <= 0) return
|
||||
uni.previewImage({
|
||||
urls: items,
|
||||
count: index
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.bgaction {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 20%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
z-index: -1;
|
||||
/* 禁止拦截滚动/点击事件 */
|
||||
pointer-events: none;
|
||||
background: linear-gradient(225deg, #e2f0ff 0%, #f9f9f9 25%);
|
||||
}
|
||||
|
||||
/* 根页面:固定满屏、纵向弹性布局、禁止自身滚动 */
|
||||
.report-record-page {
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: linear-gradient(225deg, #e2f0ff 0%, #f9f9f9 25.71%);
|
||||
}
|
||||
|
||||
/* 主体容器:占满剩余高度、纵向排列、禁止滚动 */
|
||||
.hall_body {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 40rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
/* 状态筛选标签 */
|
||||
|
||||
/* 状态标签栏(固定高度,正常占位) */
|
||||
.status-tabs {
|
||||
display: flex;
|
||||
/* background-color: #fff; */
|
||||
padding: 0 40rpx;
|
||||
height: 88rpx;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 类型筛选标签 */
|
||||
/* 类型标签栏(固定高度,正常占位) */
|
||||
.type-tabs {
|
||||
display: flex;
|
||||
height: 48rpx;
|
||||
/* background-color: #fff; */
|
||||
margin: 20rpx 0;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.type-tabs > .type-tab-item:not(:last-child) {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.type-tab-item {
|
||||
width: 142rpx;
|
||||
height: 48rpx;
|
||||
border-radius: 24rpx;
|
||||
border: 2rpx solid #999999;
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
line-height: 48rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.type-tab-item.active {
|
||||
color: #4d5dfa;
|
||||
border: 2rpx solid #4d5dfa;
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
|
||||
/* 记录列表 */
|
||||
/* ========== 核心修复:scroll-view 滚动区域 ========== */
|
||||
/* 放弃 calc 固定计算,改用 flex 自适应,首屏高度永远正常 */
|
||||
.record-list {
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 40rpx;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
height: 0;
|
||||
overflow-y: auto;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
/* 空状态 */
|
||||
@@ -335,14 +346,13 @@ function handlePrivew(imgs) {
|
||||
padding: 100rpx 0;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
/* 记录卡片 */
|
||||
/* 卡片样式(原有逻辑保留,仅修正冗余 height) */
|
||||
.record-card {
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
@@ -357,14 +367,11 @@ function handlePrivew(imgs) {
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
margin-right: 20rpx;
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #222222;
|
||||
line-height: 40rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
/* 状态标签 */
|
||||
@@ -372,25 +379,19 @@ function handlePrivew(imgs) {
|
||||
width: 82rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 15rpx;
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #ffffff;
|
||||
line-height: 30rpx;
|
||||
text-align: center;
|
||||
line-height: 30rpx;
|
||||
}
|
||||
|
||||
.status-tag.pending {
|
||||
background-color: #e34d59; /* 待分配-红色 */
|
||||
background-color: #e34d59;
|
||||
}
|
||||
|
||||
.status-tag.processing {
|
||||
background-color: #09c2bd; /* 待解决-绿色 */
|
||||
background-color: #09c2bd;
|
||||
}
|
||||
|
||||
.status-tag.completed {
|
||||
background-color: #4d5dfa; /* 已完成-蓝色 */
|
||||
background-color: #4d5dfa;
|
||||
}
|
||||
|
||||
/* 类型标签组 */
|
||||
@@ -401,14 +402,11 @@ function handlePrivew(imgs) {
|
||||
.tag-group > .tag-item:not(:last-child) {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.tag-item {
|
||||
height: 42rpx;
|
||||
padding: 0 10rpx;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 1rpx solid #999999;
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 42rpx;
|
||||
@@ -419,16 +417,15 @@ function handlePrivew(imgs) {
|
||||
.card-content {
|
||||
margin-bottom: 20rpx;
|
||||
letter-spacing: 2rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
/* 图片 */
|
||||
|
||||
/* 图片区域 */
|
||||
.card-image {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
min-width: 186rpx;
|
||||
min-height: 104rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
@@ -448,8 +445,8 @@ function handlePrivew(imgs) {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
.create-time {
|
||||
font-weight: 400;
|
||||
.create-time,
|
||||
.repairman {
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
line-height: 40rpx;
|
||||
@@ -459,18 +456,9 @@ function handlePrivew(imgs) {
|
||||
height: 44rpx;
|
||||
background: #4d5dfa;
|
||||
border-radius: 22rpx;
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
line-height: 44rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.repairman {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/* 空状态 */
|
||||
|
||||
@@ -3,26 +3,25 @@
|
||||
<view class="repairCompleted">
|
||||
<view class="item">
|
||||
<view class="title">
|
||||
<text>问题描述</text>
|
||||
<text>维修描述</text>
|
||||
</view>
|
||||
<view class="descrition">
|
||||
<textarea
|
||||
:maxlength="500"
|
||||
v-model="form.descrition"
|
||||
auto-height
|
||||
style="width: 100%"
|
||||
placeholder-style="color:#e8e8e8;"
|
||||
placeholder="请描述您的问题"
|
||||
placeholder="请输入您的描述"
|
||||
/>
|
||||
<view class="maxlength"> {{ form.descrition.length }}/500 </view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="title">
|
||||
<text>问题照片</text>
|
||||
<text>维修图片</text>
|
||||
</view>
|
||||
<view class="">
|
||||
<!-- <uni-file-picker v-model="form.images" file-mediatype="image">
|
||||
<view class="addimages images flex flex-center">
|
||||
<uni-icons type="plusempty" color="#a6a6a6" size="27"></uni-icons>
|
||||
</view>
|
||||
</uni-file-picker> -->
|
||||
<filePicker
|
||||
v-model="form.images"
|
||||
file-field-name="file"
|
||||
@@ -64,14 +63,13 @@ function handleSelecthouse() {
|
||||
obj.repairImageUrl = form.value.images.join(',')
|
||||
}
|
||||
ticketComputed(obj)
|
||||
.then(() => {
|
||||
.then(res => {
|
||||
uni.navigateBack()
|
||||
PushSingle()
|
||||
})
|
||||
.catch(() => {
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '网络错误'
|
||||
title: '提交错误'
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -96,10 +94,22 @@ function handleSelecthouse() {
|
||||
line-height: 36rpx;
|
||||
}
|
||||
.descrition {
|
||||
height: 200rpx;
|
||||
min-height: 200rpx;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border: 2rpx solid #ececec;
|
||||
padding: 22rpx 18rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
padding-bottom: 40rpx;
|
||||
.maxlength {
|
||||
font-size: small;
|
||||
position: absolute;
|
||||
right: 1em;
|
||||
bottom: 0.5em;
|
||||
height: 22rpx;
|
||||
line-height: 22rpx;
|
||||
color: #e8e8e8;
|
||||
}
|
||||
}
|
||||
.imageboxs {
|
||||
display: grid;
|
||||
|
||||
@@ -73,8 +73,8 @@
|
||||
v-for="(item, index) in problemImageUrl"
|
||||
:key="index"
|
||||
class="images"
|
||||
@tap="handlePrivew(problemImageUrl, index)"
|
||||
:src="item"
|
||||
mode=""
|
||||
></image>
|
||||
</view>
|
||||
</view>
|
||||
@@ -104,18 +104,19 @@
|
||||
</view>
|
||||
<view class="" v-if="currentStep >= 3">
|
||||
<view class="item descrition flex-col">
|
||||
<view class="label"> <text>问题描述</text> </view>
|
||||
<view class="label"> <text>维修描述</text> </view>
|
||||
<view class="value" v-if="repairInfo.repairDes && repairInfo.repairDes.trim()">
|
||||
{{ repairInfo.repairDes }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="item photobox">
|
||||
<view class="label"> <text>问题照片</text> </view>
|
||||
<view class="label"> <text>维修图片</text> </view>
|
||||
<view class="value" v-if="repairImageUrl.length > 0">
|
||||
<image
|
||||
v-for="(item, index) in repairImageUrl"
|
||||
:key="index"
|
||||
class="images"
|
||||
@tap="handlePrivew(repairImageUrl, index)"
|
||||
:src="item"
|
||||
></image>
|
||||
</view>
|
||||
@@ -210,7 +211,6 @@ function getTicketById() {
|
||||
problemImageUrl.value = repairInfo.value.problemImageUrl
|
||||
? repairInfo.value.problemImageUrl.split(',').filter(item => item)
|
||||
: []
|
||||
|
||||
repairImageUrl.value = repairInfo.value.repairImageUrl
|
||||
? repairInfo.value.repairImageUrl.split(',').filter(item => item)
|
||||
: []
|
||||
@@ -288,6 +288,15 @@ function handleRepairCompluted() {
|
||||
url: '/pageSubPack/ticket/repairCompleted?id=' + repairInfo.value.id
|
||||
})
|
||||
}
|
||||
|
||||
/** 预览图片 */
|
||||
function handlePrivew(items, index = 0) {
|
||||
if (items.length <= 0) return
|
||||
uni.previewImage({
|
||||
urls: items,
|
||||
count: index
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -296,6 +305,7 @@ function handleRepairCompluted() {
|
||||
background-color: #f9f9f9;
|
||||
box-sizing: border-box;
|
||||
overflow-x: hidden;
|
||||
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
position: relative;
|
||||
|
||||
Reference in New Issue
Block a user