修改访客邀请、一键开门bug
This commit is contained in:
@@ -54,9 +54,16 @@
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"requiredPrivateInfos": [
|
||||
"chooseLocation",
|
||||
"getLocation"
|
||||
],
|
||||
"permission": {
|
||||
"scope.camera": {
|
||||
"desc": "用于扫码"
|
||||
},
|
||||
"scope.userLocation": {
|
||||
"desc": "你的位置信息将用于定位选择"
|
||||
}
|
||||
},
|
||||
"usingComponents" : true
|
||||
|
||||
@@ -526,11 +526,11 @@ watch(() => myFilter.value, () => {
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
padding: 0 40rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 35rpx;
|
||||
padding: 0px 26rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
font-size: 22rpx;
|
||||
border-radius: 10rpx;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ const currentLength = ref(0);
|
||||
// 图片列表(本地临时路径)
|
||||
const imgList = ref([]);
|
||||
// 定位信息
|
||||
const location = ref('山东省日照市东港区学院路');
|
||||
const location = ref('');
|
||||
// 经纬度
|
||||
const longitude = ref('');
|
||||
const latitude = ref('');
|
||||
@@ -158,10 +158,10 @@ const submitStatus = async () => {
|
||||
uni.showToast({ title: '请输入实况描述', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!activityId.value) {
|
||||
uni.showToast({ title: '活动ID缺失', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
// if (!activityId.value) {
|
||||
// uni.showToast({ title: '活动ID缺失', icon: 'none' });
|
||||
// return;
|
||||
// }
|
||||
|
||||
uni.showLoading({ title: '提交中...', mask: true });
|
||||
|
||||
|
||||
@@ -107,10 +107,10 @@ const getAccessControl = async () =>{
|
||||
})
|
||||
}
|
||||
|
||||
}catch{
|
||||
}catch(err){
|
||||
doorList.value = []
|
||||
uni.showToast({
|
||||
title:res.msg,
|
||||
title:err.msg || '查询失败',
|
||||
icon:"error"
|
||||
})
|
||||
}
|
||||
@@ -136,10 +136,9 @@ const getAccessOpenData = async () =>{
|
||||
let params = {deviceId:selectedDoor.value}
|
||||
const res = await getAccessOpen(params)
|
||||
if(res.code === 200){
|
||||
if(res.data){
|
||||
uni.showToast({
|
||||
title:'开门成功',
|
||||
icon:"success"
|
||||
icon:'success'
|
||||
})
|
||||
}else{
|
||||
uni.showToast({
|
||||
@@ -147,15 +146,9 @@ const getAccessOpenData = async () =>{
|
||||
icon:"error"
|
||||
})
|
||||
}
|
||||
}else{
|
||||
}catch(err){
|
||||
uni.showToast({
|
||||
title:'开门失败',
|
||||
icon:"error"
|
||||
})
|
||||
}
|
||||
}catch{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
title: err.msg || '开门失败',
|
||||
icon:"error"
|
||||
})
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<!-- 预约时间 -->
|
||||
<view class="form-item time-item" @click="openTimePopup">
|
||||
<text class="label">预约时间</text>
|
||||
<text class="value time-value">{{ showTimeText }}</text>
|
||||
<text class="value time-value">{{ showTimeText || '请选择预约时间' }}</text>
|
||||
</view>
|
||||
<!-- <view class="form-item">
|
||||
<text class="label">预约时间</text>
|
||||
@@ -142,7 +142,6 @@
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { onLoad, onUnload } from '@dcloudio/uni-app'
|
||||
@@ -153,7 +152,7 @@ import moment from 'moment/moment'
|
||||
const houseName = ref('')
|
||||
const houseId = ref('')
|
||||
const projectName = ref('')
|
||||
const projectId = ref('') // ✅ 修复:新增项目ID
|
||||
const projectId = ref('')
|
||||
|
||||
// 表单数据
|
||||
const form = ref({
|
||||
@@ -166,10 +165,10 @@ const form = ref({
|
||||
|
||||
// ========== 基础数据 ==========
|
||||
const timePopupRef = ref(null)
|
||||
const selectedTime = ref(moment().hour(9).minute(30).second(0))
|
||||
const selectedTime = ref('')
|
||||
const tempTime = ref(moment().hour(9).minute(30).second(0))
|
||||
|
||||
// ========== 时间选择列数据 ✅ 修复:固定小时/分钟,不跟随当前时间 ==========
|
||||
// ========== 时间选择列数据 ==========
|
||||
const dateList = ref([
|
||||
{ label: '(今天)', value: moment().format('YYYY-MM-DD') },
|
||||
{ label: '(明天)', value: moment().add(1, 'day').format('YYYY-MM-DD') },
|
||||
@@ -195,11 +194,12 @@ const selectedMinute = ref('')
|
||||
// ========== 滚动配置 ==========
|
||||
const itemHeight = 80
|
||||
const dateScrollTop = ref(0)
|
||||
const hourScrollTop = ref(1)
|
||||
const minuteScrollTop = ref(1)
|
||||
const hourScrollTop = ref(0)
|
||||
const minuteScrollTop = ref(0)
|
||||
|
||||
// ========== 显示文本 ==========
|
||||
const showTimeText = computed(() => {
|
||||
if(!selectedTime.value) return ''
|
||||
return selectedTime.value.format('YYYY-MM-DD HH:mm')
|
||||
})
|
||||
|
||||
@@ -228,7 +228,7 @@ const confirmTime = () => {
|
||||
})
|
||||
}
|
||||
|
||||
// ========== 滚动/选择逻辑 ==========
|
||||
// ========== 核心修复:只允许点击,滚动失效! ==========
|
||||
const syncScrollPosition = () => {
|
||||
const dateIdx = dateList.value.findIndex(i => i.value === selectedDate.value)
|
||||
const hourIdx = hourList.value.findIndex(i => i.time === selectedHour.value)
|
||||
@@ -239,46 +239,31 @@ const syncScrollPosition = () => {
|
||||
minuteScrollTop.value = minIdx * itemHeight
|
||||
}
|
||||
|
||||
// 点击选择日期
|
||||
const selectDate = (index) => {
|
||||
selectedDate.value = dateList.value[index].value
|
||||
dateScrollTop.value = index * itemHeight
|
||||
updateTempTime()
|
||||
}
|
||||
const selectHour = (index) => {
|
||||
selectedHour.value = hourList.value[index].time
|
||||
hourScrollTop.value = index * itemHeight
|
||||
updateTempTime()
|
||||
}
|
||||
const selectMinute = (index) => {
|
||||
selectedMinute.value = minuteList.value[index].minute
|
||||
minuteScrollTop.value = index * itemHeight
|
||||
syncScrollPosition()
|
||||
updateTempTime()
|
||||
}
|
||||
|
||||
const onDateScroll = (e) => {
|
||||
const idx = Math.round(e.detail.scrollTop / itemHeight)
|
||||
if (idx >= 0 && idx < dateList.value.length) {
|
||||
selectedDate.value = dateList.value[idx].value
|
||||
dateScrollTop.value = idx * itemHeight
|
||||
// 点击选择小时
|
||||
const selectHour = (index) => {
|
||||
selectedHour.value = hourList.value[index].time
|
||||
syncScrollPosition() // 选中后立刻复位滚动
|
||||
updateTempTime()
|
||||
}
|
||||
}
|
||||
const onHourScroll = (e) => {
|
||||
const idx = Math.round(e.detail.scrollTop / itemHeight)
|
||||
if (idx >= 0 && idx < hourList.value.length) {
|
||||
selectedHour.value = hourList.value[idx].time
|
||||
hourScrollTop.value = idx * itemHeight
|
||||
|
||||
// 点击选择分钟
|
||||
const selectMinute = (index) => {
|
||||
selectedMinute.value = minuteList.value[index].minute
|
||||
syncScrollPosition() // 选中后立刻复位滚动
|
||||
updateTempTime()
|
||||
}
|
||||
}
|
||||
const onMinuteScroll = (e) => {
|
||||
const idx = Math.round(e.detail.scrollTop / itemHeight)
|
||||
if (idx >= 0 && idx < minuteList.value.length) {
|
||||
selectedMinute.value = minuteList.value[idx].minute
|
||||
minuteScrollTop.value = idx * itemHeight
|
||||
updateTempTime()
|
||||
}
|
||||
}
|
||||
|
||||
// 完全禁用滚动监听(去掉滚动干扰)
|
||||
const onDateScroll = () => {}
|
||||
const onHourScroll = () => {}
|
||||
const onMinuteScroll = () => {}
|
||||
|
||||
const updateTempTime = () => {
|
||||
tempTime.value = moment(`${selectedDate.value} ${selectedHour.value}:${selectedMinute.value}`, 'YYYY-MM-DD HH:mm')
|
||||
@@ -296,7 +281,7 @@ onLoad(() => {
|
||||
})
|
||||
uni.$on('selectProject', (data) => {
|
||||
projectName.value = data.name
|
||||
projectId.value = data.id // 接收项目ID
|
||||
projectId.value = data.id
|
||||
})
|
||||
})
|
||||
|
||||
@@ -369,7 +354,6 @@ const submitForm = async () => {
|
||||
try {
|
||||
const imageUrls = await uploadImages()
|
||||
|
||||
// 参数
|
||||
const params = {
|
||||
villageId,
|
||||
houseId: houseId.value,
|
||||
@@ -388,8 +372,6 @@ const submitForm = async () => {
|
||||
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: '提交成功', icon: 'success' })
|
||||
// const tempProjectId = projectId.value
|
||||
// 清空表单
|
||||
form.value = { title: '', desc: '', phone: '', datetime: '', images: [] }
|
||||
houseName.value = ''
|
||||
houseId.value = ''
|
||||
@@ -400,19 +382,18 @@ const submitForm = async () => {
|
||||
uni.navigateTo({
|
||||
url:'/pageSubPack/online-repair/onlineRepair'
|
||||
})
|
||||
// uni.navigateTo({ url: `/pageSubPack/online-repair/onlineRepair?maintenanceProjectId=${tempProjectId}` })
|
||||
}, 1500)
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '提交失败', icon: 'none' })
|
||||
}
|
||||
} catch (e) {
|
||||
// console.error('提交异常:', e)
|
||||
uni.showToast({ title: '提交失败,请检查网络或重试', icon: 'none' })
|
||||
} finally {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.form-container {
|
||||
padding: 15px;
|
||||
@@ -462,20 +443,7 @@ const submitForm = async () => {
|
||||
/* border-bottom: 1px solid #eee; */
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
/* .label {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
margin-bottom: 8px;
|
||||
display: block;
|
||||
}
|
||||
.value {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 0;
|
||||
} */
|
||||
|
||||
.switch {
|
||||
font-size: 12px;
|
||||
color: #007aff;
|
||||
@@ -589,25 +557,14 @@ textarea {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
color: #BBBCBE;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 选中项样式(高亮) */
|
||||
.time-item.active {
|
||||
color: #007aff;
|
||||
color: #1D2129;
|
||||
font-weight: 600;
|
||||
background-color: #d0d0d0;
|
||||
}
|
||||
|
||||
.time-item.active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
/* width: 80%; */
|
||||
/* height: 1px; */
|
||||
background-color: #d0d0d0;
|
||||
background-color: #F7F7F7;
|
||||
}
|
||||
</style>
|
||||
@@ -13,9 +13,9 @@
|
||||
</up-steps>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="step-time">2026-03-26 09:30:38</view>
|
||||
<view class="step-time">2026-03-26 09:30:38</view>
|
||||
<view class="step-time-3">2026-03-28 09:30:38</view>
|
||||
<view class="step-time" v-if="currentStep >= 0">{{timeData.createTime}}</view>
|
||||
<view class="step-time" v-if="currentStep >= 1">{{timeData.dispatchTime}}</view>
|
||||
<view class="step-time-3" v-if="currentStep >= 2">{{timeData.finishTime}}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
@@ -61,9 +61,9 @@
|
||||
</view>
|
||||
|
||||
<!-- 联系物业按钮 -->
|
||||
<view class="btn-container">
|
||||
<!-- <view class="btn-container">
|
||||
<button class="contact-btn" @click="contactProperty">联系物业</button>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -87,6 +87,13 @@ const repairInfo = ref({
|
||||
|
||||
// 步骤状态
|
||||
const currentStep = ref(0)
|
||||
// 三个步骤对应的时间
|
||||
const timeData = ref({
|
||||
createTime: '', // 待处理/提交时间
|
||||
dispatchTime: '', // 已派单时间
|
||||
finishTime: '' // 已完成时间
|
||||
})
|
||||
|
||||
|
||||
const setStep = (status) => {
|
||||
if (status === '0' || status === 0) currentStep.value = 0
|
||||
@@ -108,6 +115,10 @@ const mapData = (data) => {
|
||||
images
|
||||
}
|
||||
setStep(data.problemStatus)
|
||||
// 三个步骤时间赋值
|
||||
timeData.value.createTime = data.updateTime || ''
|
||||
timeData.value.dispatchTime = data.updateTime || ''
|
||||
timeData.value.finishTime = data.updateTime || ''
|
||||
}
|
||||
|
||||
// 获取详情接口
|
||||
@@ -145,11 +156,11 @@ const previewImage = (url) => {
|
||||
}
|
||||
|
||||
// 联系物业按钮点击事件
|
||||
const contactProperty = () => {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: '物业电话' // 换成真实电话
|
||||
})
|
||||
}
|
||||
// const contactProperty = () => {
|
||||
// uni.makePhoneCall({
|
||||
// phoneNumber: '物业电话' // 换成真实电话
|
||||
// })
|
||||
// }
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user