修改车位车牌号输入限制bug
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
"name" : "花开物业",
|
||||
"appid" : "__UNI__29C3D60",
|
||||
"description" : "智慧社区居民端面向小区业主使用,支持注册、验证码、账号密码多种登录方式,提供密码找回功能,账号使用安全便捷。支持多小区切换,首页设有轮播 banner、社区公告,集成远程开门、生活缴费、在线报修、访客邀请、社区活动常用服务。全服务板块统一涵盖门禁开门、线上缴费、报修申报、访客预约、投诉反馈、问卷调研、活动报名、社区公示、一键联系物业功能。个人中心可管理房屋、住户、车位、车辆信息,支持更换手机号、修改密码、消息通知设置、版本更新及账号退出,一站式满足业主居家生活、社区服务、房产车辆管理需求,实现社区生活数字化、便捷化。",
|
||||
"versionName" : "1.0.6",
|
||||
"versionCode" : 119,
|
||||
"versionName" : "1.0.7",
|
||||
"versionCode" : 120,
|
||||
"transformPx" : false,
|
||||
"uniCloud" : {
|
||||
"provider" : "aliyun",
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<view class="form-item">
|
||||
<view class="item-label">车牌号</view>
|
||||
<input class="item-input" v-model="formData.carNum" placeholder="请输入"
|
||||
placeholder-class="input-placeholder" maxlength="8" />
|
||||
placeholder-class="input-placeholder" maxlength="8" @input="onCarNumInput" />
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
@@ -155,6 +155,33 @@
|
||||
uploadUrl: '/api/resident/file/uploadImage'
|
||||
})
|
||||
|
||||
// 车牌号输入限制:省份简称(中文)+ 城市代码(字母)+ 序号(字母数字)
|
||||
const onCarNumInput = (e) => {
|
||||
let value = e.detail.value || ''
|
||||
// 过滤非法字符,只保留中文、大写字母、数字
|
||||
value = value.replace(/[^一-龥A-Z0-9]/g, '')
|
||||
// 首字符必须是中文省份简称
|
||||
if (value.length > 0 && !/^[一-龥]/.test(value)) {
|
||||
value = value.replace(/[^一-龥]/g, '')
|
||||
}
|
||||
// 第二位必须是字母
|
||||
if (value.length > 1) {
|
||||
const first = value.charAt(0)
|
||||
const second = value.charAt(1)
|
||||
if (!/^[A-Z]$/.test(second)) {
|
||||
value = first + second.replace(/[^A-Za-z]/g, '').toUpperCase()
|
||||
}
|
||||
// 剩余位只允许字母和数字
|
||||
if (value.length > 2) {
|
||||
const rest = value.substring(2)
|
||||
value = value.substring(0, 2) + rest.replace(/[^A-Za-z0-9]/g, '').toUpperCase()
|
||||
}
|
||||
}
|
||||
// 统一转大写
|
||||
value = value.toUpperCase()
|
||||
formData.value.carNum = value
|
||||
}
|
||||
|
||||
const inputChange = (typeStr) => {
|
||||
if (typeStr == '车牌号') {
|
||||
uni.setStorageSync('carNum', formData.value.carNum)
|
||||
@@ -182,24 +209,6 @@
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
/* if (!formData.value.carBrand) {
|
||||
return uni.showToast({
|
||||
title: "请输入车辆品牌",
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
if (!formData.value.carModel) {
|
||||
return uni.showToast({
|
||||
title: "请输入车辆型号",
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
if (!formData.value.carColor) {
|
||||
return uni.showToast({
|
||||
title: "请输入车辆颜色",
|
||||
icon: "none"
|
||||
})
|
||||
} */
|
||||
|
||||
uni.showLoading({
|
||||
title: '提交中...',
|
||||
|
||||
@@ -94,10 +94,10 @@
|
||||
console.log(form.value);
|
||||
} catch (err) {
|
||||
uni.showToast({
|
||||
title: `${err}`,
|
||||
title: err.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
console.error('列表接口报错:', err)
|
||||
// console.error('列表接口报错:', err)
|
||||
} finally {
|
||||
|
||||
}
|
||||
|
||||
@@ -169,10 +169,10 @@
|
||||
console.log(form.value);
|
||||
} catch (err) {
|
||||
uni.showToast({
|
||||
title: `${err}`,
|
||||
title: err.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
console.error('列表接口报错:', err)
|
||||
// console.error('列表接口报错:', err)
|
||||
} finally {
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
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)
|
||||
}
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,12 +58,12 @@
|
||||
title: '注销账号',
|
||||
type: 'arrow'
|
||||
},
|
||||
{
|
||||
title: '升级版本',
|
||||
type: 'text',
|
||||
value: '当前版本 1.0.0',
|
||||
valueClass: 'item-version'
|
||||
}
|
||||
// {
|
||||
// title: '升级版本',
|
||||
// type: 'text',
|
||||
// value: '当前版本 1.0.0',
|
||||
// valueClass: 'item-version'
|
||||
// }
|
||||
])
|
||||
|
||||
// 格式化字节大小
|
||||
|
||||
Reference in New Issue
Block a user