修复bug
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">业主</text>
|
||||
<text class="info-value">{{form.ownerName}}</text>
|
||||
<text class="info-value">{{form.name}}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">房间状态</text>
|
||||
@@ -58,7 +58,7 @@
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">住户</text>
|
||||
<text class="info-value">{{form.name}}</text>
|
||||
<text class="info-value">{{form.residentName}}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">房间号</text>
|
||||
@@ -220,6 +220,10 @@
|
||||
id: id.value
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
// 删除后清空小区缓存,避免首页仍显示已删除的小区
|
||||
uni.setStorageSync('needReloadUserInfo', true)
|
||||
uni.removeStorageSync('currentVillageId')
|
||||
uni.removeStorageSync('home_cache_' + (uni.getStorageSync('userId') || ''))
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'success'
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
min-height: 0;
|
||||
height: 0;
|
||||
overflow-y: auto;
|
||||
padding: 0px 40rpx;
|
||||
padding: 0px 40rpx 140rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -183,9 +183,15 @@
|
||||
}
|
||||
|
||||
.bottom-btn {
|
||||
padding: 20rpx 30rpx 40rpx;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 20rpx 30rpx;
|
||||
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
||||
flex-shrink: 0;
|
||||
background-color: #f5f7fa;
|
||||
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.car-item {
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
<view class="contentStyle" style="">
|
||||
|
||||
<scroll-view class="page" scroll-y :refresher-enabled="true" :refresher-triggered="isRefreshing" @refresherrefresh="onRefresh" @scrolltolower="loadMore">
|
||||
<!-- 空状态 -->
|
||||
<view v-if="houseList.length === 0" class="empty-state">
|
||||
<uni-icons type="info" size="30" color="#ccc"></uni-icons>
|
||||
<text class="empty-text">暂无数据</text>
|
||||
</view>
|
||||
<!-- 房屋列表 v-for 渲染 -->
|
||||
<view class="house-list">
|
||||
<view class="house-card" v-for="(item, index) in houseList" :key="index" @click="tapHouse(item)">
|
||||
@@ -218,6 +223,24 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 空状态 */
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
min-height: 500rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
/* 列表 */
|
||||
.house-list {
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
.page {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0px 40rpx;
|
||||
padding: 0px 40rpx 140rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -217,7 +217,14 @@
|
||||
}
|
||||
|
||||
.bottom-btn {
|
||||
padding: 20rpx 30rpx 40rpx;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 20rpx 30rpx;
|
||||
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
||||
background: #f5f7fa;
|
||||
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.parkingSpace-card {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<view class="info-card">
|
||||
<view class="card-title">
|
||||
<view class="title-line"></view>
|
||||
房屋信息
|
||||
车位信息
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">小区</text>
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
ref,
|
||||
onMounted
|
||||
} from 'vue'
|
||||
import {
|
||||
onUnload
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
getResidentCarAreaManageAreaListByVillageId,
|
||||
getResidentCarAreaManageParkingListByAreaId
|
||||
@@ -37,6 +40,8 @@
|
||||
const selectedParkingLot = ref(uni.getStorageSync('parkingLotId'))
|
||||
const selectedParkingSpace = ref(uni.getStorageSync('parkingSpaceId'))
|
||||
const isSubmitting = ref(false)
|
||||
let navTimer = null
|
||||
let lockTimer = null
|
||||
|
||||
onMounted(() => {
|
||||
checkType.value = uni.getStorageSync('checkType')
|
||||
@@ -94,37 +99,38 @@
|
||||
}
|
||||
|
||||
const selectedParking = (item) => {
|
||||
// 防重复点击锁:处理中直接返回,避免重复选择/重复跳转
|
||||
if (isSubmitting.value) return
|
||||
isSubmitting.value = true
|
||||
console.log(item);
|
||||
if (checkType.value == '停车场') {
|
||||
selectedParkingLot.value = item.id
|
||||
} else if (checkType.value == '车位编号') {
|
||||
selectedParkingSpace.value = item.id
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title: '选择成功',
|
||||
icon: 'success'
|
||||
})
|
||||
console.log(checkType.value);
|
||||
|
||||
try {
|
||||
if (checkType.value == '停车场') {
|
||||
selectedParkingLot.value = item.id
|
||||
uni.setStorageSync('parkingLotId', item.id)
|
||||
uni.setStorageSync('parkingLotName', item.name)
|
||||
uni.removeStorageSync('parkingSpaceId')
|
||||
uni.removeStorageSync('parkingSpaceName')
|
||||
uni.setStorageSync('checkType', '车位编号')
|
||||
} else if (checkType.value == '车位编号') {
|
||||
console.log(item.id);
|
||||
selectedParkingSpace.value = item.id
|
||||
uni.setStorageSync('parkingSpaceId', item.id)
|
||||
uni.setStorageSync('parkingSpaceName', item.name)
|
||||
}
|
||||
}, 1000)
|
||||
setTimeout(() => {
|
||||
goFreash()
|
||||
}, 2500)
|
||||
|
||||
uni.showToast({
|
||||
title: '选择成功',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
navTimer = setTimeout(() => {
|
||||
goFreash()
|
||||
}, 1500)
|
||||
} finally {
|
||||
// 正常跳转后页面会销毁,防止异常时锁死
|
||||
lockTimer = setTimeout(() => {
|
||||
isSubmitting.value = false
|
||||
}, 1500)
|
||||
}
|
||||
}
|
||||
|
||||
const goFreash = () => {
|
||||
@@ -149,6 +155,18 @@
|
||||
}
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
// 页面销毁时清理定时器,避免手势返回后延迟跳转仍触发
|
||||
onUnload(() => {
|
||||
if (navTimer) {
|
||||
clearTimeout(navTimer)
|
||||
navTimer = null
|
||||
}
|
||||
if (lockTimer) {
|
||||
clearTimeout(lockTimer)
|
||||
lockTimer = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@@ -372,14 +372,20 @@
|
||||
.page {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0 40rpx;
|
||||
padding: 0 40rpx 140rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.bottom-btn {
|
||||
padding: 20rpx 30rpx 40rpx;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 20rpx 30rpx;
|
||||
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
||||
background-color: #fff;
|
||||
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user