From 0661687bc5bd942c083d23b01becdf70d2ea4542 Mon Sep 17 00:00:00 2001 From: zhouyanli <593579392@qq.com> Date: Fri, 28 Aug 2026 17:25:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pageSubPack/api/useImageUpload.js | 4 +- .../inspection-revenue/inspection.vue | 2 +- .../pageSubPack/my/houseDetail.vue | 6 +- .../notice-list/noticeListDetails.vue | 2 +- .../pageSubPack/notice-list/selectHome.vue | 62 ++++++++++++------- .../pageSubPack/payment-list/paymentIndex.vue | 33 +++++++--- .../complaintsSuggestionsIndex.vue | 2 +- .../pageSubPack/visitor/visitor-add.vue | 4 +- .../pageSubPack/visitor/visitor-detail.vue | 21 +++++-- .../pageSubPack/visitor/visitor-list.vue | 3 +- property-uniapp-project/pages/index/index.vue | 2 +- 11 files changed, 93 insertions(+), 48 deletions(-) diff --git a/property-uniapp-project/pageSubPack/api/useImageUpload.js b/property-uniapp-project/pageSubPack/api/useImageUpload.js index 2de2fd9..2566576 100644 --- a/property-uniapp-project/pageSubPack/api/useImageUpload.js +++ b/property-uniapp-project/pageSubPack/api/useImageUpload.js @@ -1,6 +1,6 @@ // 服务器地址(与 request.js 保持一致) -// const baseUrl = 'https://wuyeapi.ckdzkj.com'; -const baseUrl = "http://192.168.1.6:8080" +const baseUrl = 'https://wuyeapi.ckdzkj.com'; +// const baseUrl = "http://192.168.1.6:8080" /** * 图片上传 Hook diff --git a/property-uniapp-project/pageSubPack/inspection-revenue/inspection.vue b/property-uniapp-project/pageSubPack/inspection-revenue/inspection.vue index 9f8f009..24cb70d 100644 --- a/property-uniapp-project/pageSubPack/inspection-revenue/inspection.vue +++ b/property-uniapp-project/pageSubPack/inspection-revenue/inspection.vue @@ -24,7 +24,7 @@ {{ item.status }} {{ item.inspectionType }} - 巡检时间:{{ item.executeDate }} + 巡检时间:{{ item.taskTime }} 巡检人:{{ item.inspectorName }} diff --git a/property-uniapp-project/pageSubPack/my/houseDetail.vue b/property-uniapp-project/pageSubPack/my/houseDetail.vue index b5be560..dd3a3b8 100644 --- a/property-uniapp-project/pageSubPack/my/houseDetail.vue +++ b/property-uniapp-project/pageSubPack/my/houseDetail.vue @@ -33,7 +33,7 @@ 房间号 - {{form.houseNo}} + {{form.buildingName+'栋'+form.unitNo+'单元'+form.houseNo}} 业主 @@ -60,8 +60,8 @@ {{form.residentName}} - 房间号 - {{form.houseNo}} + 性别 + {{form.gender === '0'?'男':'女'}} 证件类型 diff --git a/property-uniapp-project/pageSubPack/notice-list/noticeListDetails.vue b/property-uniapp-project/pageSubPack/notice-list/noticeListDetails.vue index 7f3d5d9..ce37c6a 100644 --- a/property-uniapp-project/pageSubPack/notice-list/noticeListDetails.vue +++ b/property-uniapp-project/pageSubPack/notice-list/noticeListDetails.vue @@ -12,7 +12,7 @@ {{noticeDetail.author}} - · + · {{noticeDetail.publishTime}} diff --git a/property-uniapp-project/pageSubPack/notice-list/selectHome.vue b/property-uniapp-project/pageSubPack/notice-list/selectHome.vue index 664b7d7..80089da 100644 --- a/property-uniapp-project/pageSubPack/notice-list/selectHome.vue +++ b/property-uniapp-project/pageSubPack/notice-list/selectHome.vue @@ -94,6 +94,7 @@ const searchText = ref('') const selectedItem = ref(null) const scrollIntoViewId = ref('') const currentVillageIdFromHome = ref('') // 首页传入的当前选中小区ID +const sourcePage = ref('') // 来源页面:payment 为缴费页独立切换,其他走首页切换 // 分页相关 const currentPage = ref(1) @@ -187,7 +188,8 @@ const getCommunityList = async (pageNum = 1, keyword = '') => { // 页面加载时初始化 onLoad((options) => { - // 接收首页传来得选择的小区的id + // 接收来源页面及选中小区id + sourcePage.value = options?.source || '' currentVillageIdFromHome.value = options?.villageId || '' getCommunityList(1) }) @@ -248,42 +250,58 @@ const handleConfirm = async () => { }) return } + // 缴费页为独立切换:不调用后端切换小区接口 + const isPayment = sourcePage.value === 'payment' try { uni.showLoading({ - title: '切换小区中...', + title: isPayment ? '加载中...' : '切换小区中...', mask: true }) - const params = { - villageId: selectedItem.value.villageId, - } - const res = await getVillageSwitch(params) - uni.hideLoading() - - if (res.code === 200) { + if (!isPayment) { + const res = await getVillageSwitch({ + villageId: selectedItem.value.villageId, + }) + uni.hideLoading() + if (res.code !== 200) { + uni.showToast({ + title: res.msg || '切换小区失败', + icon: 'none', + duration: 2000 + }) + return + } if (res.data?.villageId) { selectedItem.value.villageId = res.data.villageId } - uni.showToast({ - title: '选择成功', - icon: 'success', - duration: 1500 + } else { + uni.hideLoading() + } + + uni.showToast({ + title: '选择成功', + icon: 'success', + duration: 1500 + }) + if (isPayment) { + // 缴费页独立缓存 + 独立事件,通知缴费页刷新(按账号隔离) + const userId = uni.getStorageSync('userId') || '' + uni.setStorageSync('paymentVillageId_' + userId, selectedItem.value.villageId) + uni.setStorageSync('paymentVillageName_' + userId, selectedItem.value.villageName) + uni.$emit('confirmPayment', { + name: selectedItem.value.villageName, + villageId: selectedItem.value.villageId }) + } else { // 更新缓存并通知首页 uni.setStorageSync('currentVillageId', selectedItem.value.villageId) uni.$emit('confirm', { name: selectedItem.value.villageName, villageId: selectedItem.value.villageId }) - setTimeout(() => { - uni.navigateBack() - }, 1000) - } else { - uni.showToast({ - title: res.msg || '切换小区失败', - icon: 'error', - duration: 2000 - }) } + setTimeout(() => { + uni.navigateBack() + }, 1000) } catch (err) { uni.hideLoading() uni.showToast({ diff --git a/property-uniapp-project/pageSubPack/payment-list/paymentIndex.vue b/property-uniapp-project/pageSubPack/payment-list/paymentIndex.vue index ae7f656..7774229 100644 --- a/property-uniapp-project/pageSubPack/payment-list/paymentIndex.vue +++ b/property-uniapp-project/pageSubPack/payment-list/paymentIndex.vue @@ -146,8 +146,22 @@ const paymentList = ref([ ]) +// 独立的当前小区ID(按账号隔离,避免切换账号后残留上个账号的小区) +const getPaymentVillageIdKey = () => 'paymentVillageId_' + (uni.getStorageSync('userId') || '') +const getPaymentVillageNameKey = () => 'paymentVillageName_' + (uni.getStorageSync('userId') || '') + +const getPaymentVillageId = () => { + return uni.getStorageSync(getPaymentVillageIdKey()) || uni.getStorageSync('currentVillageId') || '' +} + // 获取当前小区 const getCurrentCommunityData = () => { + const paymentVillageId = uni.getStorageSync(getPaymentVillageIdKey()) + const paymentVillageName = uni.getStorageSync(getPaymentVillageNameKey()) + if (paymentVillageId) { + currentCommunity.value = paymentVillageName || '已选小区' + return + } getCurrentVillage().then(res => { if (res.code === 200 && res.data && res.data.villageId) { currentCommunity.value = res.data.villageName || '未命名小区' @@ -159,9 +173,12 @@ const getCurrentCommunityData = () => { // 接收小区切换事件 const slelctHomeData = (data) => { - if (data.name) currentCommunity.value = data.name + if (data.name) { + currentCommunity.value = data.name + uni.setStorageSync(getPaymentVillageNameKey(), data.name) + } if (data.villageId) { - uni.setStorageSync('currentVillageId', data.villageId) + uni.setStorageSync(getPaymentVillageIdKey(), data.villageId) } getBillDetails() getPayList() @@ -169,11 +186,11 @@ const slelctHomeData = (data) => { // 跳转小区选择 const navigateToSelectHome = () => { - const cachedVillageId = uni.getStorageSync('currentVillageId') + const cachedVillageId = getPaymentVillageId() if (!cachedVillageId || cachedVillageId === '0' || cachedVillageId === 0) { uni.navigateTo({ url: '/pageSubPack/my/myHouseIndex' }) } else { - uni.navigateTo({ url: `/pageSubPack/notice-list/selectHome?villageId=${cachedVillageId}` }) + uni.navigateTo({ url: `/pageSubPack/notice-list/selectHome?villageId=${cachedVillageId}&source=payment` }) } } @@ -184,12 +201,12 @@ onShow(() => { onLoad(() => { uni.hideTabBar({ animation: false }); - uni.$on('confirm', slelctHomeData) + uni.$on('confirmPayment', slelctHomeData) getPayList() }) onUnload(() => { - uni.$off('confirm', slelctHomeData) + uni.$off('confirmPayment', slelctHomeData) }) // 页面返回拦截 @@ -249,7 +266,7 @@ const getBillDetails = (isLoadMore = false) => { } getTopUpDetails({ userId: uni.getStorageSync('userId'), - villageId: uni.getStorageSync('currentVillageId'), + villageId: getPaymentVillageId(), pageNum: pageNum.value, pageSize: pageSize.value, }).then(res => { @@ -289,7 +306,7 @@ const getPayList = async (isLoadMore = false) => { residentUserId: uni.getStorageSync('userId'), pageNum: payPageNum.value, pageSize: payPageSize.value, - villageId:uni.getStorageSync('currentVillageId') + villageId:getPaymentVillageId() }) const data = res.rows || res.data if (isLoadMore) { diff --git a/property-uniapp-project/pageSubPack/service-list/complaintsSuggestionsIndex.vue b/property-uniapp-project/pageSubPack/service-list/complaintsSuggestionsIndex.vue index ae7896c..98423cd 100644 --- a/property-uniapp-project/pageSubPack/service-list/complaintsSuggestionsIndex.vue +++ b/property-uniapp-project/pageSubPack/service-list/complaintsSuggestionsIndex.vue @@ -188,7 +188,6 @@ const addComplaintsSuggestions = () => { position: sticky; top: 0; z-index: 10; - background: #e2efff; display: flex; justify-content: flex-start; align-items: center; @@ -238,6 +237,7 @@ const addComplaintsSuggestions = () => { .card-header { display: flex; align-items: center; + justify-content: space-between; margin-bottom: 20rpx; } diff --git a/property-uniapp-project/pageSubPack/visitor/visitor-add.vue b/property-uniapp-project/pageSubPack/visitor/visitor-add.vue index 9b09d7b..8d60bbb 100644 --- a/property-uniapp-project/pageSubPack/visitor/visitor-add.vue +++ b/property-uniapp-project/pageSubPack/visitor/visitor-add.vue @@ -82,7 +82,7 @@ + :border="false" :hide-second="true"/> @@ -91,7 +91,7 @@ + :border="false" :hide-second="true"/> 预计来访时间和预计离开时间间隔不能超过24小时 diff --git a/property-uniapp-project/pageSubPack/visitor/visitor-detail.vue b/property-uniapp-project/pageSubPack/visitor/visitor-detail.vue index c6035f8..f5de1d7 100644 --- a/property-uniapp-project/pageSubPack/visitor/visitor-detail.vue +++ b/property-uniapp-project/pageSubPack/visitor/visitor-detail.vue @@ -4,8 +4,8 @@ 来访者:{{ visitorInfo.name }} - - {{ visitorInfo.status === 'visited' ? '已到访' : '等待来访' }} + + {{ visitorInfo.status}} @@ -30,7 +30,7 @@ 有效期: - {{ visitorInfo.validTime }} + {{ visitorInfo.validTime }} 邀请时间: @@ -65,7 +65,7 @@ import {getVisitorDetail} from '../api/api.js' // 访客信息(实际项目中从接口获取) const visitorInfo = ref({ name: '', - status: 'waiting', // waiting:等待来访,visited:已到访 + status: '', // waiting:等待来访,visited:已到访 type: '', address: '', phone: '', @@ -84,7 +84,7 @@ const mapDetail = (item) => { item.unitNo ? item.unitNo + '单元' : '', item.houseNo ].filter(Boolean) - const status = item.status === 1 || item.status === '1' ? 'visited' : 'waiting' + const status = item.status === '1' ? '已到访' : '等待来访' return { name: item.visitorName || '', status, @@ -153,6 +153,10 @@ const goToQrcode = () => { padding: 6rpx 16rpx; border-radius: 20rpx; } +.status.active{ + color: #2f77fd; + font-weight: 500; +} .waiting { color: #007aff; @@ -181,6 +185,13 @@ const goToQrcode = () => { .value { color: #222; flex: 1; + text-align: right; +} +.value-valid{ + color: #222; + flex: 1; + text-align: right; + white-space: nowrap; } .tips-text { diff --git a/property-uniapp-project/pageSubPack/visitor/visitor-list.vue b/property-uniapp-project/pageSubPack/visitor/visitor-list.vue index ccc5d0c..6f4176c 100644 --- a/property-uniapp-project/pageSubPack/visitor/visitor-list.vue +++ b/property-uniapp-project/pageSubPack/visitor/visitor-list.vue @@ -77,7 +77,7 @@ - + @@ -167,7 +167,6 @@ const addInvitation = () => { top: 0; z-index: 10; display: flex; - background: #e2f0ff; } .tab-item { diff --git a/property-uniapp-project/pages/index/index.vue b/property-uniapp-project/pages/index/index.vue index 26aa72c..e2d1386 100644 --- a/property-uniapp-project/pages/index/index.vue +++ b/property-uniapp-project/pages/index/index.vue @@ -112,7 +112,7 @@ {{formatDate(activity.startTime)}}-{{formatDate(activity.endTime)}} - {{activity.createName}} + {{activity.address}}