修复bug
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
// 服务器地址(与 request.js 保持一致)
|
// 服务器地址(与 request.js 保持一致)
|
||||||
// const baseUrl = 'https://wuyeapi.ckdzkj.com';
|
const baseUrl = 'https://wuyeapi.ckdzkj.com';
|
||||||
const baseUrl = "http://192.168.1.6:8080"
|
// const baseUrl = "http://192.168.1.6:8080"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片上传 Hook
|
* 图片上传 Hook
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<text class="status">{{ item.status }}</text>
|
<text class="status">{{ item.status }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="tag-label">{{ item.inspectionType }}</view>
|
<view class="tag-label">{{ item.inspectionType }}</view>
|
||||||
<view class="text-row">巡检时间:{{ item.executeDate }}</view>
|
<view class="text-row">巡检时间:{{ item.taskTime }}</view>
|
||||||
<view class="text-row">巡检人:{{ item.inspectorName }}</view>
|
<view class="text-row">巡检人:{{ item.inspectorName }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="info-row">
|
<view class="info-row">
|
||||||
<text class="info-label">房间号</text>
|
<text class="info-label">房间号</text>
|
||||||
<text class="info-value">{{form.houseNo}}</text>
|
<text class="info-value">{{form.buildingName+'栋'+form.unitNo+'单元'+form.houseNo}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-row">
|
<view class="info-row">
|
||||||
<text class="info-label">业主</text>
|
<text class="info-label">业主</text>
|
||||||
@@ -60,8 +60,8 @@
|
|||||||
<text class="info-value">{{form.residentName}}</text>
|
<text class="info-value">{{form.residentName}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-row">
|
<view class="info-row">
|
||||||
<text class="info-label">房间号</text>
|
<text class="info-label">性别</text>
|
||||||
<text class="info-value">{{form.houseNo}}</text>
|
<text class="info-value">{{form.gender === '0'?'男':'女'}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-row">
|
<view class="info-row">
|
||||||
<text class="info-label">证件类型</text>
|
<text class="info-label">证件类型</text>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<view class="notice-meta">
|
<view class="notice-meta">
|
||||||
<view class="notice-author">
|
<view class="notice-author">
|
||||||
<text class="author-name">{{noticeDetail.author}}</text>
|
<text class="author-name">{{noticeDetail.author}}</text>
|
||||||
<text class="separator">·</text>
|
<text class="separator" v-if="noticeDetail.author">·</text>
|
||||||
<text class="publish-time">{{noticeDetail.publishTime}}</text>
|
<text class="publish-time">{{noticeDetail.publishTime}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ const searchText = ref('')
|
|||||||
const selectedItem = ref(null)
|
const selectedItem = ref(null)
|
||||||
const scrollIntoViewId = ref('')
|
const scrollIntoViewId = ref('')
|
||||||
const currentVillageIdFromHome = ref('') // 首页传入的当前选中小区ID
|
const currentVillageIdFromHome = ref('') // 首页传入的当前选中小区ID
|
||||||
|
const sourcePage = ref('') // 来源页面:payment 为缴费页独立切换,其他走首页切换
|
||||||
|
|
||||||
// 分页相关
|
// 分页相关
|
||||||
const currentPage = ref(1)
|
const currentPage = ref(1)
|
||||||
@@ -187,7 +188,8 @@ const getCommunityList = async (pageNum = 1, keyword = '') => {
|
|||||||
|
|
||||||
// 页面加载时初始化
|
// 页面加载时初始化
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
// 接收首页传来得选择的小区的id
|
// 接收来源页面及选中小区id
|
||||||
|
sourcePage.value = options?.source || ''
|
||||||
currentVillageIdFromHome.value = options?.villageId || ''
|
currentVillageIdFromHome.value = options?.villageId || ''
|
||||||
getCommunityList(1)
|
getCommunityList(1)
|
||||||
})
|
})
|
||||||
@@ -248,42 +250,58 @@ const handleConfirm = async () => {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// 缴费页为独立切换:不调用后端切换小区接口
|
||||||
|
const isPayment = sourcePage.value === 'payment'
|
||||||
try {
|
try {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '切换小区中...',
|
title: isPayment ? '加载中...' : '切换小区中...',
|
||||||
mask: true
|
mask: true
|
||||||
})
|
})
|
||||||
const params = {
|
if (!isPayment) {
|
||||||
|
const res = await getVillageSwitch({
|
||||||
villageId: selectedItem.value.villageId,
|
villageId: selectedItem.value.villageId,
|
||||||
}
|
})
|
||||||
const res = await getVillageSwitch(params)
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
if (res.code !== 200) {
|
||||||
if (res.code === 200) {
|
uni.showToast({
|
||||||
|
title: res.msg || '切换小区失败',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
if (res.data?.villageId) {
|
if (res.data?.villageId) {
|
||||||
selectedItem.value.villageId = res.data.villageId
|
selectedItem.value.villageId = res.data.villageId
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '选择成功',
|
title: '选择成功',
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
duration: 1500
|
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.setStorageSync('currentVillageId', selectedItem.value.villageId)
|
||||||
uni.$emit('confirm', {
|
uni.$emit('confirm', {
|
||||||
name: selectedItem.value.villageName,
|
name: selectedItem.value.villageName,
|
||||||
villageId: selectedItem.value.villageId
|
villageId: selectedItem.value.villageId
|
||||||
})
|
})
|
||||||
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: res.msg || '切换小区失败',
|
|
||||||
icon: 'error',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
@@ -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 getCurrentCommunityData = () => {
|
||||||
|
const paymentVillageId = uni.getStorageSync(getPaymentVillageIdKey())
|
||||||
|
const paymentVillageName = uni.getStorageSync(getPaymentVillageNameKey())
|
||||||
|
if (paymentVillageId) {
|
||||||
|
currentCommunity.value = paymentVillageName || '已选小区'
|
||||||
|
return
|
||||||
|
}
|
||||||
getCurrentVillage().then(res => {
|
getCurrentVillage().then(res => {
|
||||||
if (res.code === 200 && res.data && res.data.villageId) {
|
if (res.code === 200 && res.data && res.data.villageId) {
|
||||||
currentCommunity.value = res.data.villageName || '未命名小区'
|
currentCommunity.value = res.data.villageName || '未命名小区'
|
||||||
@@ -159,9 +173,12 @@ const getCurrentCommunityData = () => {
|
|||||||
|
|
||||||
// 接收小区切换事件
|
// 接收小区切换事件
|
||||||
const slelctHomeData = (data) => {
|
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) {
|
if (data.villageId) {
|
||||||
uni.setStorageSync('currentVillageId', data.villageId)
|
uni.setStorageSync(getPaymentVillageIdKey(), data.villageId)
|
||||||
}
|
}
|
||||||
getBillDetails()
|
getBillDetails()
|
||||||
getPayList()
|
getPayList()
|
||||||
@@ -169,11 +186,11 @@ const slelctHomeData = (data) => {
|
|||||||
|
|
||||||
// 跳转小区选择
|
// 跳转小区选择
|
||||||
const navigateToSelectHome = () => {
|
const navigateToSelectHome = () => {
|
||||||
const cachedVillageId = uni.getStorageSync('currentVillageId')
|
const cachedVillageId = getPaymentVillageId()
|
||||||
if (!cachedVillageId || cachedVillageId === '0' || cachedVillageId === 0) {
|
if (!cachedVillageId || cachedVillageId === '0' || cachedVillageId === 0) {
|
||||||
uni.navigateTo({ url: '/pageSubPack/my/myHouseIndex' })
|
uni.navigateTo({ url: '/pageSubPack/my/myHouseIndex' })
|
||||||
} else {
|
} 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(() => {
|
onLoad(() => {
|
||||||
uni.hideTabBar({ animation: false });
|
uni.hideTabBar({ animation: false });
|
||||||
uni.$on('confirm', slelctHomeData)
|
uni.$on('confirmPayment', slelctHomeData)
|
||||||
getPayList()
|
getPayList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onUnload(() => {
|
onUnload(() => {
|
||||||
uni.$off('confirm', slelctHomeData)
|
uni.$off('confirmPayment', slelctHomeData)
|
||||||
})
|
})
|
||||||
|
|
||||||
// 页面返回拦截
|
// 页面返回拦截
|
||||||
@@ -249,7 +266,7 @@ const getBillDetails = (isLoadMore = false) => {
|
|||||||
}
|
}
|
||||||
getTopUpDetails({
|
getTopUpDetails({
|
||||||
userId: uni.getStorageSync('userId'),
|
userId: uni.getStorageSync('userId'),
|
||||||
villageId: uni.getStorageSync('currentVillageId'),
|
villageId: getPaymentVillageId(),
|
||||||
pageNum: pageNum.value,
|
pageNum: pageNum.value,
|
||||||
pageSize: pageSize.value,
|
pageSize: pageSize.value,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
@@ -289,7 +306,7 @@ const getPayList = async (isLoadMore = false) => {
|
|||||||
residentUserId: uni.getStorageSync('userId'),
|
residentUserId: uni.getStorageSync('userId'),
|
||||||
pageNum: payPageNum.value,
|
pageNum: payPageNum.value,
|
||||||
pageSize: payPageSize.value,
|
pageSize: payPageSize.value,
|
||||||
villageId:uni.getStorageSync('currentVillageId')
|
villageId:getPaymentVillageId()
|
||||||
})
|
})
|
||||||
const data = res.rows || res.data
|
const data = res.rows || res.data
|
||||||
if (isLoadMore) {
|
if (isLoadMore) {
|
||||||
|
|||||||
@@ -188,7 +188,6 @@ const addComplaintsSuggestions = () => {
|
|||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
background: #e2efff;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -238,6 +237,7 @@ const addComplaintsSuggestions = () => {
|
|||||||
.card-header {
|
.card-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="value">
|
<view class="value">
|
||||||
<uni-datetime-picker type="datetime" v-model="form.visitTime" @change="handleTimeChange" @maskClick="pickerVisible = false"
|
<uni-datetime-picker type="datetime" v-model="form.visitTime" @change="handleTimeChange" @maskClick="pickerVisible = false"
|
||||||
:border="false" />
|
:border="false" :hide-second="true"/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="form-item" @click="onPickerOpen">
|
<view class="form-item" @click="onPickerOpen">
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="value">
|
<view class="value">
|
||||||
<uni-datetime-picker type="datetime" v-model="form.leaveTime" @change="handleTimeChange" @maskClick="pickerVisible = false"
|
<uni-datetime-picker type="datetime" v-model="form.leaveTime" @change="handleTimeChange" @maskClick="pickerVisible = false"
|
||||||
:border="false" />
|
:border="false" :hide-second="true"/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tips">预计来访时间和预计离开时间间隔不能超过24小时</view>
|
<view class="tips">预计来访时间和预计离开时间间隔不能超过24小时</view>
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
<view class="info-card">
|
<view class="info-card">
|
||||||
<view class="info-header">
|
<view class="info-header">
|
||||||
<text class="title">来访者:{{ visitorInfo.name }}</text>
|
<text class="title">来访者:{{ visitorInfo.name }}</text>
|
||||||
<text class="status {{ visitorInfo.status === 'visited' ? 'visited' : 'waiting' }}">
|
<text class="status" :class="{ active: visitorInfo.status === '等待来访' }">
|
||||||
{{ visitorInfo.status === 'visited' ? '已到访' : '等待来访' }}
|
{{ visitorInfo.status}}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">有效期:</text>
|
<text class="label">有效期:</text>
|
||||||
<text class="value">{{ visitorInfo.validTime }}</text>
|
<text class="value-valid">{{ visitorInfo.validTime }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">邀请时间:</text>
|
<text class="label">邀请时间:</text>
|
||||||
@@ -65,7 +65,7 @@ import {getVisitorDetail} from '../api/api.js'
|
|||||||
// 访客信息(实际项目中从接口获取)
|
// 访客信息(实际项目中从接口获取)
|
||||||
const visitorInfo = ref({
|
const visitorInfo = ref({
|
||||||
name: '',
|
name: '',
|
||||||
status: 'waiting', // waiting:等待来访,visited:已到访
|
status: '', // waiting:等待来访,visited:已到访
|
||||||
type: '',
|
type: '',
|
||||||
address: '',
|
address: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
@@ -84,7 +84,7 @@ const mapDetail = (item) => {
|
|||||||
item.unitNo ? item.unitNo + '单元' : '',
|
item.unitNo ? item.unitNo + '单元' : '',
|
||||||
item.houseNo
|
item.houseNo
|
||||||
].filter(Boolean)
|
].filter(Boolean)
|
||||||
const status = item.status === 1 || item.status === '1' ? 'visited' : 'waiting'
|
const status = item.status === '1' ? '已到访' : '等待来访'
|
||||||
return {
|
return {
|
||||||
name: item.visitorName || '',
|
name: item.visitorName || '',
|
||||||
status,
|
status,
|
||||||
@@ -153,6 +153,10 @@ const goToQrcode = () => {
|
|||||||
padding: 6rpx 16rpx;
|
padding: 6rpx 16rpx;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
}
|
}
|
||||||
|
.status.active{
|
||||||
|
color: #2f77fd;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
.waiting {
|
.waiting {
|
||||||
color: #007aff;
|
color: #007aff;
|
||||||
@@ -181,6 +185,13 @@ const goToQrcode = () => {
|
|||||||
.value {
|
.value {
|
||||||
color: #222;
|
color: #222;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.value-valid{
|
||||||
|
color: #222;
|
||||||
|
flex: 1;
|
||||||
|
text-align: right;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tips-text {
|
.tips-text {
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 底部占位,防止最后一项贴底 -->
|
<!-- 底部占位 -->
|
||||||
<view class="list-bottom-space"></view>
|
<view class="list-bottom-space"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -167,7 +167,6 @@ const addInvitation = () => {
|
|||||||
top: 0;
|
top: 0;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
display: flex;
|
display: flex;
|
||||||
background: #e2f0ff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-item {
|
.tab-item {
|
||||||
|
|||||||
@@ -112,7 +112,7 @@
|
|||||||
<view class="activity-time">
|
<view class="activity-time">
|
||||||
{{formatDate(activity.startTime)}}-{{formatDate(activity.endTime)}}</view>
|
{{formatDate(activity.startTime)}}-{{formatDate(activity.endTime)}}</view>
|
||||||
<view class="activity-organizer">
|
<view class="activity-organizer">
|
||||||
<text>{{activity.createName}}</text>
|
<text>{{activity.address}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="activity-enrollment">
|
<view class="activity-enrollment">
|
||||||
<text>
|
<text>
|
||||||
|
|||||||
Reference in New Issue
Block a user