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

@@ -1,4 +1,8 @@
import request,{get,post,upload} from "./request.js"
import request, {
get,
post,
upload
} from "./request.js"
// =======账号密码登录========
@@ -77,16 +81,19 @@ export const getOpenDoorList = () =>{
export const switchOpenDoor = (data) => {
return post('/manage/remote/open', data)
}
// ===========我的========
// 获取管家信息
export const getSettingInfo = () => {
return get('/api/setting/info')
}
// Zy ------------
// 上报记录
export const getMyOrderList = (data) => {
return get('/manage/repair/order/myorderlist',data)
return get('/manage/repair/order/reportlist', data)
}
// Zy ------------
// =====设置=======
// 修改密码
export const changePassword = (data) => {

View File

@@ -15,7 +15,7 @@
</view>
</view>
<!-- 添加按钮 -->
<view class="add-btn" @tap="choose">
<view class="add-btn" @tap="choose" v-if="innerList.length < props.limit">
<uni-icons color="#a6a6a6" type="plusempty" size="25"></uni-icons>
</view>
</view>
@@ -194,7 +194,9 @@ function remove(index) {
// 4. 预览图片
function preview(index) {
const urls = innerList.value.map(i => i.url)
console.log(innerList)
const urls = innerList.value.map(i => i.url).filter(Boolean)
if (urls.length <= 0) return
uni.previewImage({
urls: urls,
current: index

View File

@@ -1,6 +1,6 @@
<template>
<view class="page_padding">
<view class="detailsbox flex flex-col overflow-hidden">
<view class="detailsbox">
<!-- 状态筛选标签 -->
<TabsComponents
:showBottomLine="false"
@@ -8,9 +8,9 @@
:tabslist="statusTabs"
@update="switchStatus"
></TabsComponents>
<view class="detail_list flex flex-1 overflow-auto">
<view class="detail_list">
<scroll-view
style="height: 100%; flex: 1"
style="flex: 1"
scroll-y="true"
lower-threshold="160"
v-if="list.length > 0"
@@ -100,9 +100,7 @@ const switchStatus = value => {
list.value = []
init()
}
//
const total = ref(0) //
const total = ref(0) // 总量
const isLoading = ref(false) // 加载锁
const hasMore = ref(true) // 是否还有更多数据
const list = ref([])
@@ -153,7 +151,7 @@ function handleComplaint(id) {
}
function scrolltolower() {
// 必须加这两个判断!
console.log('触发')
if (isLoading.value || !hasMore.value) {
return
}
@@ -167,13 +165,18 @@ function scrolltolower() {
background: #f9f9f9;
}
.detailsbox {
height: 100%;
flex: 1;
background: #f9f9f9;
padding: 20rpx 40rpx;
justify-content: flex-start;
align-items: stretch;
display: flex;
flex-direction: column;
overflow: hidden;
.detail_list {
margin-top: 20rpx;
display: flex;
flex: 1;
overflow: hidden;
.item {
background: #ffffff;
border-radius: 16rpx;

View File

@@ -1,6 +1,6 @@
<template>
<view class="page_padding">
<view class="Details_handelbox h-full flex-1">
<view class="Details_handelbox h-full flex-1 flex flex-col">
<view class="items top flex items-center justify-between">
<view class="title flex items-center">
<view class="line"></view>
@@ -61,6 +61,7 @@
:key="index"
:src="item"
class="img"
@tap="handlePrivew(showImages, index)"
mode="scaleToFill"
></image>
</view>
@@ -84,17 +85,6 @@ import { onMounted, ref } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { getComplainMain } from '@/api/complain.js'
const info = ref({
status: 0, //0待解决 1已完成
imgs: [
'https://picsum.photos/61',
'https://picsum.photos/61',
'https://picsum.photos/61',
'https://picsum.photos/61',
'https://picsum.photos/61'
]
})
/** 投诉详情id */
const complainId = ref('')
/** 投诉详情内容 */
@@ -126,10 +116,12 @@ function init() {
if (complainId.value) {
getComplainMain(complainId.value).then(res => {
complainInfo.value = res.data
if (res.data.problemImageUrl) {
showImages.value = res.data.problemImageUrl
.split(',')
.filter(item => item.includes('http'))
.map(item => item.split('?')[0])
.map(item => item && item.split('?')[0])
}
})
}
}
@@ -144,6 +136,15 @@ function handleSelecthouse() {
})
}
}
/** 预览图片 */
function handlePrivew(items, index) {
if (items.length <= 0) return
uni.previewImage({
current: index,
urls: items
})
}
</script>
<style scoped lang="scss">
@@ -151,8 +152,12 @@ function handleSelecthouse() {
padding: 30rpx 40rpx;
padding-bottom: 0;
position: relative;
overflow: hidden;
overflow-y: auto;
.items {
height: 100rpx;
height: 80rpx;
min-height: 80rpx;
flex-shrink: 0;
&.top {
border-bottom: 1rpx solid #ccc;
}
@@ -190,6 +195,10 @@ function handleSelecthouse() {
}
.list {
flex: 1;
flex-shrink: 0;
padding-bottom: 30rpx;
.item {
border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
display: flex;
@@ -253,10 +262,10 @@ function handleSelecthouse() {
background: #4d5dfa;
border-radius: 8rpx 8rpx 8rpx 8rpx;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
// position: absolute;
// bottom: 0;
// left: 50%;
// transform: translateX(-50%);
}
}
</style>

View File

@@ -80,6 +80,7 @@
v-for="(it, ind) in ite.files"
:key="ind"
:src="it"
@tap="handlePrivew(ite.files, index)"
mode="scaleToFill"
></image>
</view>
@@ -94,7 +95,7 @@
</view>
</template>
<script setup lang="ts">
<script setup>
import { ref } from 'vue'
import { getInspectionMain } from '@/api/insepction.js'
import { onLoad } from '@dcloudio/uni-app'
@@ -157,6 +158,15 @@ onLoad(options => {
taskid.value = options.id
init()
})
/**预览图片*/
function handlePrivew(lists, index) {
if (lists.length <= 0) return
uni.previewImage({
urls: lists,
count: index
})
}
</script>
<style lang="scss" scoped>

View File

@@ -134,8 +134,8 @@ function getlist() {
})
item.itemslist = Array.from(items)
})
hasMore.value = list.value.length < res.total
total.value = res.total
hasMore.value = list.value.length < res.total
})
.catch(() => {
uni.showToast({
@@ -156,7 +156,7 @@ function handleChangeTime(event: string) {
function handleTap(ite) {
const today = parseTime(new Date(), '{m}月{d}日')
if (today !== showDate.value) {
if (today !== showDate.value && ite.taskStatus !== '已完成') {
return
}

View File

@@ -119,8 +119,8 @@ function getlist() {
item.itemslist = Array.from(items)
})
list.value = res.rows
hasMore.value = list.value.length < res.total
total.value = res.total
hasMore.value = list.value.length < res.total
})
.catch(() => {
uni.showToast({

View File

@@ -123,7 +123,11 @@ function getlist() {
getVillageHouseList_keyword(queryParmas.value, queryParmas.value.searchValue)
.then(res => {
// 追加数据(正确方式)
searchlist.value = [...searchlist.value, ...res.rows]
if (queryParmas.value.pageNum === 1) {
searchlist.value = res.rows
} else {
searchlist.value.push(...res.rows)
}
total.value = res.total
// 判断是否还有更多
hasMore.value = searchlist.value.length < total.value

View File

@@ -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>

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;
}
/* 空状态 */

View File

@@ -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;

View File

@@ -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;