修改车位车牌号输入限制bug

This commit is contained in:
zhouyanli
2026-08-07 09:24:15 +08:00
parent d44ebd075e
commit 3851aebe66
6 changed files with 68 additions and 65 deletions

View File

@@ -36,6 +36,7 @@
const dataList = ref([])
const selectedParkingLot = ref(uni.getStorageSync('parkingLotId'))
const selectedParkingSpace = ref(uni.getStorageSync('parkingSpaceId'))
const isSubmitting = ref(false)
onMounted(() => {
checkType.value = uni.getStorageSync('checkType')
@@ -93,6 +94,8 @@
}
const selectedParking = (item) => {
if (isSubmitting.value) return
isSubmitting.value = true
console.log(item);
if (checkType.value == '停车场') {
selectedParkingLot.value = item.id
@@ -100,48 +103,39 @@
selectedParkingSpace.value = item.id
}
uni.showModal({
title: "确认选择",
content: '确认选择此' + checkType.value + '吗?',
success: (res) => {
if (res.confirm) {
setTimeout(() => {
uni.showToast({
title: '选择成功',
icon: 'success'
})
console.log(checkType.value);
if (checkType.value == '停车场') {
uni.setStorageSync('parkingLotId', item.id)
uni.setStorageSync('parkingLotName', item.name)
uni.removeStorageSync('parkingSpaceId')
uni.removeStorageSync('parkingSpaceName')
uni.setStorageSync('checkType', '车位编号')
} else if (checkType.value == '车位编号') {
console.log(item.id);
uni.setStorageSync('parkingSpaceId', item.id)
uni.setStorageSync('parkingSpaceName', item.name)
}
}, 1000)
setTimeout(() => {
goFreash()
}, 2500)
}
setTimeout(() => {
uni.showToast({
title: '选择成功',
icon: 'success'
})
console.log(checkType.value);
if (checkType.value == '停车场') {
uni.setStorageSync('parkingLotId', item.id)
uni.setStorageSync('parkingLotName', item.name)
uni.removeStorageSync('parkingSpaceId')
uni.removeStorageSync('parkingSpaceName')
uni.setStorageSync('checkType', '车位编号')
} else if (checkType.value == '车位编号') {
console.log(item.id);
uni.setStorageSync('parkingSpaceId', item.id)
uni.setStorageSync('parkingSpaceName', item.name)
}
})
}, 1000)
setTimeout(() => {
goFreash()
}, 2500)
}
const goFreash = () => {
if (checkType.value != '车位编号') {
uni.navigateTo({
// 选完停车场后替换当前页进入选车位编号,避免压栈
uni.redirectTo({
url: '/pageSubPack/my/selectParingLot'
})
} else {
uni.navigateTo({
url: '/pageSubPack/my/addParkingSpace'
})
// 选完车位编号后返回原来的 addParkingSpace
uni.navigateBack()
}
}