修复bug
This commit is contained in:
@@ -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\": 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(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 '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)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,13 +5,16 @@
|
|||||||
</uni-nav-bar>
|
</uni-nav-bar>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
<scroll-view class="page" scroll-y="true">
|
<pull-refresh-scroll
|
||||||
<view v-if="houseList.length === 0" class="empty-state">
|
custom-class="page"
|
||||||
<uni-icons type="info" size="60" color="#ccc"></uni-icons>
|
:refreshing="isRefreshing"
|
||||||
<text class="empty-text">
|
:loading-more="loading"
|
||||||
{{ '暂无数据'}}
|
:no-more-data="noMoreData"
|
||||||
</text>
|
:empty="houseList.length === 0"
|
||||||
</view>
|
empty-text="暂无数据"
|
||||||
|
@refresh="onRefresh"
|
||||||
|
@loadMore="loadMore"
|
||||||
|
>
|
||||||
<!-- 房屋列表 v-for 渲染 -->
|
<!-- 房屋列表 v-for 渲染 -->
|
||||||
<view class="house-list">
|
<view class="house-list">
|
||||||
<view class="house-card" v-for="(item, index) in houseList" :key="index" @click="tapHouse(item)">
|
<view class="house-card" v-for="(item, index) in houseList" :key="index" @click="tapHouse(item)">
|
||||||
@@ -51,12 +54,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</pull-refresh-scroll>
|
||||||
<view v-if="houseList.length > 0" class="load-more-wrap">
|
|
||||||
<view v-if="noMoreData" class="no-more">没有更多了</view>
|
|
||||||
<button v-else class="load-more-btn" :loading="loading" @click="loadMore">加载更多</button>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
<!-- 底部添加按钮 -->
|
<!-- 底部添加按钮 -->
|
||||||
<view class="bottom-btn">
|
<view class="bottom-btn">
|
||||||
<button class="add-btn" @click="addHouse">添加房屋</button>
|
<button class="add-btn" @click="addHouse">添加房屋</button>
|
||||||
@@ -76,6 +74,7 @@
|
|||||||
getMyHouseList,
|
getMyHouseList,
|
||||||
setMyHouseDefault
|
setMyHouseDefault
|
||||||
} from '/pageSubPack/api/apiSub.js'
|
} from '/pageSubPack/api/apiSub.js'
|
||||||
|
import PullRefreshScroll from '/components/pull-refresh-scroll/pull-refresh-scroll.vue'
|
||||||
|
|
||||||
|
|
||||||
const houseList = ref([])
|
const houseList = ref([])
|
||||||
@@ -83,6 +82,18 @@
|
|||||||
const pageNum = ref(1)
|
const pageNum = ref(1)
|
||||||
const pageSize = ref(10)
|
const pageSize = ref(10)
|
||||||
const noMoreData = ref(false)
|
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 () => {
|
const getList = async () => {
|
||||||
if (loading.value) return
|
if (loading.value) return
|
||||||
@@ -110,6 +121,9 @@
|
|||||||
console.error('列表接口报错:', err)
|
console.error('列表接口报错:', err)
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
if (isRefreshing.value) {
|
||||||
|
isRefreshing.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,55 +237,6 @@
|
|||||||
box-sizing: border-box;
|
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 {
|
.house-list {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -395,6 +360,10 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.bottom-btn {
|
||||||
|
padding: 20rpx 30rpx 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.add-btn {
|
.add-btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<!-- 头部物业费A标题+水滴图标 -->
|
<!-- 头部物业费A标题+水滴图标 -->
|
||||||
<view class="card-header">
|
<view class="card-header">
|
||||||
<image class="iconStyle"
|
<image class="iconStyle"
|
||||||
:src="paymentType=='水费'?'https://wuyeadmin.bugtc.com/images/propertyImgs/water.png':'https://wuyeadmin.bugtc.com/images/propertyImgs/electric.png'">
|
:src="paymentType=='水表'?'https://wuyeadmin.bugtc.com/images/propertyImgs/water.png':'https://wuyeadmin.bugtc.com/images/propertyImgs/electric.png'">
|
||||||
</image>
|
</image>
|
||||||
<text class="card-title">{{paymentType}}</text>
|
<text class="card-title">{{paymentType}}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -186,7 +186,7 @@
|
|||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
await getTopUpBindDevice({
|
await getTopUpBindDevice({
|
||||||
deviceType: paymentType.value=='水费'?'2':'1',
|
deviceType: paymentType.value=='水表'?'2':'1',
|
||||||
deviceCode: deviceNo.value,
|
deviceCode: deviceNo.value,
|
||||||
// openid: openid,
|
// openid: openid,
|
||||||
residentUserId: uni.getStorageSync('userId')
|
residentUserId: uni.getStorageSync('userId')
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="contentStyle">
|
<view class="contentStyle">
|
||||||
<view class="status-bar"></view>
|
<view class="status-bar"></view>
|
||||||
<uni-nav-bar title="问卷调查" backgroundColor="transparent" :border="false" left-icon="left" @clickLeft="goBack">
|
<uni-nav-bar title="问卷详情" backgroundColor="transparent" :border="false" left-icon="left" @clickLeft="goBack">
|
||||||
</uni-nav-bar>
|
</uni-nav-bar>
|
||||||
|
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
@@ -265,6 +265,7 @@ page {
|
|||||||
color: #333;
|
color: #333;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0px 0 20rpx 0;
|
margin: 0px 0 20rpx 0;
|
||||||
|
white-space: pre-line;
|
||||||
}
|
}
|
||||||
|
|
||||||
.survey-desc {
|
.survey-desc {
|
||||||
@@ -273,6 +274,7 @@ page {
|
|||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
|
white-space: pre-line;
|
||||||
}
|
}
|
||||||
|
|
||||||
.empty-tip {
|
.empty-tip {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="label">访客姓名</view>
|
<view class="label">访客姓名</view>
|
||||||
<input class="input" placeholder="请输入访客姓名" v-model="form.name" maxlength="20" />
|
<input class="input" placeholder="请输入访客姓名" v-model="form.name" maxlength="20" @input="onNameInput" />
|
||||||
</view>
|
</view>
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="label">
|
<view class="label">
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<view class="label">
|
<view class="label">
|
||||||
<text class="required">*</text>访客联系方式
|
<text class="required">*</text>访客联系方式
|
||||||
</view>
|
</view>
|
||||||
<input class="input" placeholder="请输入联系方式" v-model="form.phone" type="number" maxlength="11" />
|
<input class="input" placeholder="请输入联系方式" v-model="form.phone" type="number" maxlength="11" @input="onPhoneInput" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 车牌号:仅车辆来访显示 -->
|
<!-- 车牌号:仅车辆来访显示 -->
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<view class="label">
|
<view class="label">
|
||||||
<text class="required">*</text>随行人数
|
<text class="required">*</text>随行人数
|
||||||
</view>
|
</view>
|
||||||
<input class="input" placeholder="请输入随行人数" v-model="form.peopleNum" type="number" maxlength="2" />
|
<input class="input" placeholder="请输入随行人数" v-model="form.peopleNum" type="number" maxlength="2" @input="onPeopleNumInput" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -76,21 +76,21 @@
|
|||||||
<view class="section-title">有效期</view>
|
<view class="section-title">有效期</view>
|
||||||
<view class="form-section">
|
<view class="form-section">
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item" @click="onPickerOpen">
|
||||||
<view class="label">
|
<view class="label">
|
||||||
<text class="required">*</text>来访时间
|
<text class="required">*</text>来访时间
|
||||||
</view>
|
</view>
|
||||||
<view class="value">
|
<view class="value">
|
||||||
<uni-datetime-picker type="datetime" v-model="form.visitTime" @change="handleTimeChange"
|
<uni-datetime-picker type="datetime" v-model="form.visitTime" @change="handleTimeChange" @maskClick="pickerVisible = false"
|
||||||
:border="false" />
|
:border="false" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="form-item">
|
<view class="form-item" @click="onPickerOpen">
|
||||||
<view class="label">
|
<view class="label">
|
||||||
<text class="required">*</text>离开时间
|
<text class="required">*</text>离开时间
|
||||||
</view>
|
</view>
|
||||||
<view class="value">
|
<view class="value">
|
||||||
<uni-datetime-picker type="datetime" v-model="form.leaveTime" @change="handleTimeChange"
|
<uni-datetime-picker type="datetime" v-model="form.leaveTime" @change="handleTimeChange" @maskClick="pickerVisible = false"
|
||||||
:border="false" />
|
:border="false" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -140,7 +140,8 @@
|
|||||||
reactive
|
reactive
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import {
|
import {
|
||||||
onLoad
|
onLoad,
|
||||||
|
onBackPress
|
||||||
} from "@dcloudio/uni-app"
|
} from "@dcloudio/uni-app"
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import{getHouseList,addVisitorData} from '../api/api.js'
|
import{getHouseList,addVisitorData} from '../api/api.js'
|
||||||
@@ -178,6 +179,17 @@ const pageFixed = ref(false);
|
|||||||
// 车牌号输入框聚焦索引
|
// 车牌号输入框聚焦索引
|
||||||
const carFocusIndex = ref(-1);
|
const carFocusIndex = ref(-1);
|
||||||
|
|
||||||
|
// 日期选择器是否打开
|
||||||
|
const pickerVisible = ref(false);
|
||||||
|
|
||||||
|
// 拦截返回事件:若日期选择器打开则关闭选择器而非返回上一页
|
||||||
|
onBackPress(() => {
|
||||||
|
if (pickerVisible.value) {
|
||||||
|
pickerVisible.value = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// =========方法===========
|
// =========方法===========
|
||||||
// 获取房屋列表
|
// 获取房屋列表
|
||||||
const fetchHouseList = async () => {
|
const fetchHouseList = async () => {
|
||||||
@@ -259,12 +271,58 @@ const pageFixed = ref(false);
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 姓名输入过滤特殊字符
|
||||||
|
const onNameInput = (e) => {
|
||||||
|
const val = e.detail.value;
|
||||||
|
// 只允许中文、英文字母、数字和中间点(·)
|
||||||
|
const filtered = val.replace(/[^一-龥a-zA-Z0-9·]/g, '')
|
||||||
|
if (filtered !== val) {
|
||||||
|
form.name = filtered;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 手机号输入过滤非数字字符
|
||||||
|
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 = () => {
|
const handleTimeChange = () => {
|
||||||
|
pickerVisible.value = false;
|
||||||
if (!form.visitTime || !form.leaveTime) return true;
|
if (!form.visitTime || !form.leaveTime) return true;
|
||||||
|
|
||||||
const visitMoment = moment(form.visitTime);
|
const visitMoment = moment(form.visitTime);
|
||||||
const leaveMoment = moment(form.leaveTime);
|
const leaveMoment = moment(form.leaveTime);
|
||||||
|
const now = moment();
|
||||||
|
|
||||||
|
// 来访时间不能是过去时间
|
||||||
|
if (visitMoment.isBefore(now)) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '来访时间不能早于当前时间',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// 离开时间不能早于来访时间
|
// 离开时间不能早于来访时间
|
||||||
if (leaveMoment.isBefore(visitMoment)) {
|
if (leaveMoment.isBefore(visitMoment)) {
|
||||||
@@ -272,7 +330,6 @@ const pageFixed = ref(false);
|
|||||||
title: '离开时间不能早于来访时间',
|
title: '离开时间不能早于来访时间',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
form.leaveTime = visitMoment.clone().add(1, 'hours').format('YYYY-MM-DD HH:mm');
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,12 +340,12 @@ const pageFixed = ref(false);
|
|||||||
title: '时间间隔不能超过24小时',
|
title: '时间间隔不能超过24小时',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
form.leaveTime = visitMoment.clone().add(24, 'hours').format('YYYY-MM-DD HH:mm');
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 随行人数输入过滤小数
|
||||||
// 提交表单
|
// 提交表单
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
// 1. 必填项校验
|
// 1. 必填项校验
|
||||||
@@ -334,9 +391,9 @@ const pageFixed = ref(false);
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!form.peopleNum || form.peopleNum <= 0) {
|
if (form.peopleNum === '' || form.peopleNum === null || form.peopleNum === undefined) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请输入正确的随行人数',
|
title: '请输入随行人数',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<text class="label">联系方式:</text>
|
<text class="label">联系方式:</text>
|
||||||
<text class="value">{{ visitorInfo.phone }}</text>
|
<text class="value">{{ visitorInfo.phone }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-item">
|
<view class="info-item" v-if="visitorInfo.type !== '1'">
|
||||||
<text class="label">车牌号:</text>
|
<text class="label">车牌号:</text>
|
||||||
<text class="value">{{ visitorInfo.carNumber }}</text>
|
<text class="value">{{ visitorInfo.carNumber }}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -66,6 +66,7 @@ import {getVisitorDetail} from '../api/api.js'
|
|||||||
const visitorInfo = ref({
|
const visitorInfo = ref({
|
||||||
name: '',
|
name: '',
|
||||||
status: 'waiting', // waiting:等待来访,visited:已到访
|
status: 'waiting', // waiting:等待来访,visited:已到访
|
||||||
|
type: '',
|
||||||
address: '',
|
address: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
carNumber: '',
|
carNumber: '',
|
||||||
@@ -87,6 +88,7 @@ const mapDetail = (item) => {
|
|||||||
return {
|
return {
|
||||||
name: item.visitorName || '',
|
name: item.visitorName || '',
|
||||||
status,
|
status,
|
||||||
|
type: item.type || '',
|
||||||
address: addressParts.join(''),
|
address: addressParts.join(''),
|
||||||
phone: item.visitorPhone || '',
|
phone: item.visitorPhone || '',
|
||||||
carNumber: item.carNum || '',
|
carNumber: item.carNum || '',
|
||||||
|
|||||||
@@ -51,8 +51,8 @@
|
|||||||
<text class="value" :class="item.status">{{ item.phone }}</text>
|
<text class="value" :class="item.status">{{ item.phone }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 车牌号 -->
|
<!-- 车牌号:仅车辆来访显示 -->
|
||||||
<view class="item-row">
|
<view class="item-row" v-if="item.type !== '1'">
|
||||||
<text class="label" :class="item.status">车牌号:</text>
|
<text class="label" :class="item.status">车牌号:</text>
|
||||||
<text class="value" :class="item.status">{{ item.carNumber }}</text>
|
<text class="value" :class="item.status">{{ item.carNumber }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Reference in New Issue
Block a user