diff --git a/property-uniapp-project/.claude/settings.local.json b/property-uniapp-project/.claude/settings.local.json
index c10c216..0a85c55 100644
--- a/property-uniapp-project/.claude/settings.local.json
+++ b/property-uniapp-project/.claude/settings.local.json
@@ -33,7 +33,8 @@
"Bash(perl -i -pe 's/\\\\\\\\t\\\\t\\\\t\\\\t\\\\t\"disableScroll\": true/\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\"disableScroll\": true/' pages.json)",
"Bash(perl -i -pe 's/^t\\\\t\\\\t\\\\t\\\\t\"disableScroll\"/\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\"disableScroll\"/' pages.json)",
"Bash(sed -i '113s|// loadRevenue\\(true\\)|loadRevenue\\(true\\)|' pageSubPack/inspection-revenue/public-revenue.vue)",
- "Bash(sed -i '120s|// loadRevenue\\(\\)|loadRevenue\\(\\)|' pageSubPack/inspection-revenue/public-revenue.vue)"
+ "Bash(sed -i '120s|// loadRevenue\\(\\)|loadRevenue\\(\\)|' pageSubPack/inspection-revenue/public-revenue.vue)",
+ "Bash(xxd pageSubPack/visitor/visitor-add.vue)"
]
}
}
diff --git a/property-uniapp-project/pageSubPack/my/myHouseIndex.vue b/property-uniapp-project/pageSubPack/my/myHouseIndex.vue
index dbfa58f..c1cd690 100644
--- a/property-uniapp-project/pageSubPack/my/myHouseIndex.vue
+++ b/property-uniapp-project/pageSubPack/my/myHouseIndex.vue
@@ -5,13 +5,16 @@
-
-
-
-
- {{ '暂无数据'}}
-
-
+
@@ -51,12 +54,7 @@
-
-
- 没有更多了
-
-
-
+
@@ -76,6 +74,7 @@
getMyHouseList,
setMyHouseDefault
} from '/pageSubPack/api/apiSub.js'
+ import PullRefreshScroll from '/components/pull-refresh-scroll/pull-refresh-scroll.vue'
const houseList = ref([])
@@ -83,6 +82,18 @@
const pageNum = ref(1)
const pageSize = ref(10)
const noMoreData = ref(false)
+ const isRefreshing = ref(false)
+
+ // ==================== 下拉刷新 ====================
+ const onRefresh = () => {
+ isRefreshing.value = true
+ pageNum.value = 1
+ noMoreData.value = false
+ houseList.value = []
+ loading.value = false
+ getList()
+ }
+
// ==================== 获取列表数据 ====================
const getList = async () => {
if (loading.value) return
@@ -110,6 +121,9 @@
console.error('列表接口报错:', err)
} finally {
loading.value = false
+ if (isRefreshing.value) {
+ isRefreshing.value = false
+ }
}
}
@@ -223,55 +237,6 @@
box-sizing: border-box;
}
- /* 空状态 */
- .empty-state {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 100rpx 0;
- color: #ccc;
- }
-
- .empty-text {
- font-size: 32rpx;
- color: #999;
- margin-top: 20rpx;
- margin-bottom: 10rpx;
- }
-
- .no-more {
- text-align: center;
- padding: 30rpx 0;
- color: #999;
- font-size: 24rpx;
- }
-
- .load-more-wrap {
- padding: 20rpx 0 40rpx;
- }
-
- .load-more-btn {
- width: 100%;
- height: 80rpx;
- line-height: 80rpx;
- background: #ffffff;
- color: #007aff;
- border: 1rpx solid #007aff;
- border-radius: 12rpx;
- font-size: 28rpx;
- text-align: center;
- }
-
- .load-more-btn::after {
- border: none;
- }
-
- /* 底部按钮 */
- .bottom-btn {
- padding: 20rpx 30rpx 40rpx;
- }
-
/* 列表 */
.house-list {
height: 100%;
@@ -395,6 +360,10 @@
+ .bottom-btn {
+ padding: 20rpx 30rpx 40rpx;
+ }
+
.add-btn {
width: 100%;
height: 88rpx;
diff --git a/property-uniapp-project/pageSubPack/payment-list/addHydropower.vue b/property-uniapp-project/pageSubPack/payment-list/addHydropower.vue
index 4e1bf27..02c847a 100644
--- a/property-uniapp-project/pageSubPack/payment-list/addHydropower.vue
+++ b/property-uniapp-project/pageSubPack/payment-list/addHydropower.vue
@@ -10,7 +10,7 @@
@@ -186,7 +186,7 @@
// return
// }
await getTopUpBindDevice({
- deviceType: paymentType.value=='水费'?'2':'1',
+ deviceType: paymentType.value=='水表'?'2':'1',
deviceCode: deviceNo.value,
// openid: openid,
residentUserId: uni.getStorageSync('userId')
diff --git a/property-uniapp-project/pageSubPack/service-list/questionnaireFillout.vue b/property-uniapp-project/pageSubPack/service-list/questionnaireFillout.vue
index 96f55e6..ce919c6 100644
--- a/property-uniapp-project/pageSubPack/service-list/questionnaireFillout.vue
+++ b/property-uniapp-project/pageSubPack/service-list/questionnaireFillout.vue
@@ -1,7 +1,7 @@
-
+
@@ -265,6 +265,7 @@ page {
color: #333;
text-align: center;
margin: 0px 0 20rpx 0;
+ white-space: pre-line;
}
.survey-desc {
@@ -273,6 +274,7 @@ page {
line-height: 1.6;
margin-bottom: 20rpx;
text-align: justify;
+ white-space: pre-line;
}
.empty-tip {
diff --git a/property-uniapp-project/pageSubPack/visitor/visitor-add.vue b/property-uniapp-project/pageSubPack/visitor/visitor-add.vue
index 8767ac2..64ea1d1 100644
--- a/property-uniapp-project/pageSubPack/visitor/visitor-add.vue
+++ b/property-uniapp-project/pageSubPack/visitor/visitor-add.vue
@@ -32,7 +32,7 @@
访客姓名
-
+
@@ -47,7 +47,7 @@
*访客联系方式
-
+
@@ -68,7 +68,7 @@
*随行人数
-
+
@@ -76,21 +76,21 @@
有效期
-
-
+
+
*来访时间
-
-
-
+
+
*离开时间
-
@@ -140,7 +140,8 @@
reactive
} from 'vue';
import {
- onLoad
+ onLoad,
+ onBackPress
} from "@dcloudio/uni-app"
import moment from 'moment';
import{getHouseList,addVisitorData} from '../api/api.js'
@@ -151,7 +152,7 @@
// 表单数据
const form = reactive({
address: '',
- villageId: '',
+ villageId: '',
houseId: '',
name: '',
gender: '',
@@ -178,6 +179,17 @@ const pageFixed = ref(false);
// 车牌号输入框聚焦索引
const carFocusIndex = ref(-1);
+ // 日期选择器是否打开
+ const pickerVisible = ref(false);
+
+ // 拦截返回事件:若日期选择器打开则关闭选择器而非返回上一页
+ onBackPress(() => {
+ if (pickerVisible.value) {
+ pickerVisible.value = false;
+ return true;
+ }
+ });
+
// =========方法===========
// 获取房屋列表
const fetchHouseList = async () => {
@@ -194,7 +206,7 @@ const pageFixed = ref(false);
title:e.msg || '获取房屋列表失败',
icon:'none'
})
- // console.error('获取房屋列表失败', e)
+ // console.error('获取房屋列表失败', e)
}
}
@@ -259,36 +271,81 @@ const pageFixed = ref(false);
}
};
- // 时间校验
- const handleTimeChange = () => {
- if (!form.visitTime || !form.leaveTime) return true;
-
- const visitMoment = moment(form.visitTime);
- const leaveMoment = moment(form.leaveTime);
-
- // 离开时间不能早于来访时间
- if (leaveMoment.isBefore(visitMoment)) {
- uni.showToast({
- title: '离开时间不能早于来访时间',
- icon: 'none'
- });
- form.leaveTime = visitMoment.clone().add(1, 'hours').format('YYYY-MM-DD HH:mm');
- return false;
+ // 姓名输入过滤特殊字符
+ const onNameInput = (e) => {
+ const val = e.detail.value;
+ // 只允许中文、英文字母、数字和中间点(·)
+ const filtered = val.replace(/[^一-龥a-zA-Z0-9·]/g, '')
+ if (filtered !== val) {
+ form.name = filtered;
}
-
- // 不能超过24小时
- const diffHours = leaveMoment.diff(visitMoment, 'hours', true);
- if (diffHours > 24) {
- uni.showToast({
- title: '时间间隔不能超过24小时',
- icon: 'none'
- });
- form.leaveTime = visitMoment.clone().add(24, 'hours').format('YYYY-MM-DD HH:mm');
- return false;
- }
- return true;
};
+ // 手机号输入过滤非数字字符
+ const onPhoneInput = (e) => {
+ const val = e.detail.value;
+ const filtered = val.replace(/\D/g, '');
+ if (filtered !== val) {
+ form.phone = filtered;
+ }
+ };
+
+ // 随行人数输入过滤小数
+ const onPeopleNumInput = (e) => {
+ const val = e.detail.value;
+ // 只保留整数(去除小数点及之后的内容)
+ const filtered = val.replace(/[^\d]/g, '');
+ if (filtered !== val) {
+ form.peopleNum = filtered;
+ }
+ };
+
+
+ // 打开选择器时标记状态,供 onBackPress 拦截用
+ const onPickerOpen = () => {
+ pickerVisible.value = true;
+ };
+
+ // 时间校验
+ const handleTimeChange = () => {
+ pickerVisible.value = false;
+ if (!form.visitTime || !form.leaveTime) return true;
+
+ const visitMoment = moment(form.visitTime);
+ const leaveMoment = moment(form.leaveTime);
+ const now = moment();
+
+ // 来访时间不能是过去时间
+ if (visitMoment.isBefore(now)) {
+ uni.showToast({
+ title: '来访时间不能早于当前时间',
+ icon: 'none'
+ });
+ return false;
+ }
+
+ // 离开时间不能早于来访时间
+ if (leaveMoment.isBefore(visitMoment)) {
+ uni.showToast({
+ title: '离开时间不能早于来访时间',
+ icon: 'none'
+ });
+ return false;
+ }
+
+ // 不能超过24小时
+ const diffHours = leaveMoment.diff(visitMoment, 'hours', true);
+ if (diffHours > 24) {
+ uni.showToast({
+ title: '时间间隔不能超过24小时',
+ icon: 'none'
+ });
+ return false;
+ }
+ return true;
+ };
+
+ // 随行人数输入过滤小数
// 提交表单
const submitForm = async () => {
// 1. 必填项校验
@@ -334,9 +391,9 @@ const pageFixed = ref(false);
});
return;
}
- if (!form.peopleNum || form.peopleNum <= 0) {
+ if (form.peopleNum === '' || form.peopleNum === null || form.peopleNum === undefined) {
uni.showToast({
- title: '请输入正确的随行人数',
+ title: '请输入随行人数',
icon: 'none'
});
return;
diff --git a/property-uniapp-project/pageSubPack/visitor/visitor-detail.vue b/property-uniapp-project/pageSubPack/visitor/visitor-detail.vue
index 9b6d35b..4b498bd 100644
--- a/property-uniapp-project/pageSubPack/visitor/visitor-detail.vue
+++ b/property-uniapp-project/pageSubPack/visitor/visitor-detail.vue
@@ -20,7 +20,7 @@
联系方式:
{{ visitorInfo.phone }}
-
+
车牌号:
{{ visitorInfo.carNumber }}
@@ -66,6 +66,7 @@ import {getVisitorDetail} from '../api/api.js'
const visitorInfo = ref({
name: '',
status: 'waiting', // waiting:等待来访,visited:已到访
+ type: '',
address: '',
phone: '',
carNumber: '',
@@ -87,6 +88,7 @@ const mapDetail = (item) => {
return {
name: item.visitorName || '',
status,
+ type: item.type || '',
address: addressParts.join(''),
phone: item.visitorPhone || '',
carNumber: item.carNum || '',
diff --git a/property-uniapp-project/pageSubPack/visitor/visitor-list.vue b/property-uniapp-project/pageSubPack/visitor/visitor-list.vue
index 26d3262..ce21e0f 100644
--- a/property-uniapp-project/pageSubPack/visitor/visitor-list.vue
+++ b/property-uniapp-project/pageSubPack/visitor/visitor-list.vue
@@ -51,8 +51,8 @@
{{ item.phone }}
-
-
+
+
车牌号:
{{ item.carNumber }}