修复注册登录输入框限制等bug
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
|
||||
<view class="info-item">
|
||||
<view class="info-label">活动名额</view>
|
||||
<view class="info-value">{{activityConent.quota}}人</view>
|
||||
<view class="info-value">{{ activityConent.quota == 0 ? '无限名额' : activityConent.quota + '人' }}</view>
|
||||
</view>
|
||||
|
||||
<view class="info-item">
|
||||
|
||||
@@ -40,9 +40,9 @@
|
||||
<view class="input-icon">
|
||||
<image src="https://wuyeadmin.bugtc.com/images/login/phone.png" mode="" style="height: 100%;width: 100%;"></image>
|
||||
</view>
|
||||
<uni-easyinput class="input-content" type="text" v-model="account"
|
||||
placeholder="请输入帐号" :inputBorder="false" maxlength="20" :placeholderStyle="placeholderStyle">
|
||||
</uni-easyinput>
|
||||
<input class="native-input" type="text" v-model="account"
|
||||
placeholder="请输入帐号" maxlength="20" :placeholderStyle="placeholderStyle"
|
||||
auto-capitalize="off" auto-correct="off" />
|
||||
</view>
|
||||
|
||||
<!-- 密码输入框 -->
|
||||
@@ -50,9 +50,9 @@
|
||||
<view class="input-icon">
|
||||
<image src="https://wuyeadmin.bugtc.com/images/login/password.png" mode="" style="height: 100%;width: 100%;"></image>
|
||||
</view>
|
||||
<uni-easyinput class="input-content" type="password" v-model="password"
|
||||
placeholder="请输入密码" :inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle">
|
||||
</uni-easyinput>
|
||||
<input class="native-input" type="password" v-model="password"
|
||||
placeholder="请输入密码" maxlength="16" :placeholderStyle="placeholderStyle"
|
||||
auto-capitalize="off" auto-correct="off" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -341,6 +341,15 @@ onUnmounted(() => {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 原生输入框(账号/密码区分大小写) */
|
||||
.native-input {
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
|
||||
/* 深度覆盖 uni-easyinput 内部默认样式 */
|
||||
.input-content :deep(.uni-easyinput__content) {
|
||||
height: 100% !important;
|
||||
|
||||
@@ -128,13 +128,13 @@
|
||||
agreeAgreement.value;
|
||||
});
|
||||
|
||||
// 实时校验密码格式(输入空格或特殊符号立即提示)
|
||||
// 实时校验密码格式(禁止颜文字/emoji/特殊符号,只允许中文、字母、数字)
|
||||
watch(password, (val) => {
|
||||
if (!val) { passwordError.value = ''; return }
|
||||
if (val.length < 6 || val.length > 16) {
|
||||
passwordError.value = '密码需 6-16 位'
|
||||
} else if (/[^a-zA-Z0-9]/.test(val)) {
|
||||
passwordError.value = '密码格式错误'
|
||||
} else if (/[^一-龥a-zA-Z0-9]/.test(val)) {
|
||||
passwordError.value = '密码不能包含特殊符号或表情'
|
||||
} else {
|
||||
passwordError.value = ''
|
||||
}
|
||||
@@ -149,7 +149,7 @@
|
||||
agreeAgreement.value = !agreeAgreement.value;
|
||||
};
|
||||
|
||||
// 账号失焦校验
|
||||
// 账号失焦校验(禁止颜文字/emoji/特殊符号,只允许中文、字母、数字)
|
||||
const validateAccount = () => {
|
||||
const val = account.value
|
||||
if (!val) { accountError.value = ''; return }
|
||||
@@ -157,6 +157,8 @@
|
||||
accountError.value = '账号不能包含空格'
|
||||
} else if (val.length < 4 || val.length > 20) {
|
||||
accountError.value = '账号需 4-20 位'
|
||||
} else if (/[^一-龥a-zA-Z0-9]/.test(val)) {
|
||||
accountError.value = '账号不能包含特殊符号或表情'
|
||||
} else {
|
||||
accountError.value = ''
|
||||
}
|
||||
@@ -167,14 +169,14 @@
|
||||
accountError.value = ''
|
||||
};
|
||||
|
||||
// 密码失焦校验
|
||||
// 密码失焦校验(禁止颜文字/emoji/特殊符号,只允许中文、字母、数字)
|
||||
const validatePassword = () => {
|
||||
const val = password.value
|
||||
if (!val) { passwordError.value = ''; return }
|
||||
if (val.length < 6 || val.length > 16) {
|
||||
passwordError.value = '密码需 6-16 位'
|
||||
} else if (/[^a-zA-Z0-9]/.test(val)) {
|
||||
passwordError.value = '密码格式错误'
|
||||
} else if (/[^一-龥a-zA-Z0-9]/.test(val)) {
|
||||
passwordError.value = '密码不能包含特殊符号或表情'
|
||||
} else {
|
||||
passwordError.value = ''
|
||||
}
|
||||
@@ -286,7 +288,11 @@
|
||||
return;
|
||||
}
|
||||
if (/\s/.test(account.value)) {
|
||||
uni.showToast({ title: '账号格式不对,不允许注册', icon: 'none' });
|
||||
uni.showToast({ title: '账号不能包含空格', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (/[^一-龥a-zA-Z0-9]/.test(account.value)) {
|
||||
uni.showToast({ title: '账号不能包含特殊符号或表情', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!password.value) {
|
||||
@@ -301,8 +307,8 @@
|
||||
uni.showToast({ title: '密码不能超过 16 位', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (/[^a-zA-Z0-9]/.test(password.value)) {
|
||||
uni.showToast({ title: '密码格式错误', icon: 'none' });
|
||||
if (/[^一-龥a-zA-Z0-9]/.test(password.value)) {
|
||||
uni.showToast({ title: '密码不能包含特殊符号或表情', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!agreeAgreement.value) {
|
||||
|
||||
@@ -410,9 +410,7 @@ const submitForm = async () => {
|
||||
projectId.value = ''
|
||||
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url:'/pageSubPack/online-repair/onlineRepair'
|
||||
})
|
||||
uni.navigateBack({ delta: 1 })
|
||||
}, 1500)
|
||||
} else {
|
||||
submitting.value = false
|
||||
|
||||
@@ -222,9 +222,8 @@ const submitForm = async () => {
|
||||
// const tempProjectId = projectId.value
|
||||
form.value = { title: '', desc: '', phone: '', images: [] }
|
||||
repairProject.value = ''
|
||||
// uni.navigateBack({ delta: 2 })
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({ url: '/pageSubPack/online-repair/onlineRepair' })
|
||||
uni.navigateBack({ delta: 1 })
|
||||
}, 1500)
|
||||
} else {
|
||||
submitting.value = false
|
||||
|
||||
@@ -100,8 +100,8 @@
|
||||
const onItemClick = (item) => {
|
||||
if (!requireLogin()) return
|
||||
const cachedVillageId = uni.getStorageSync('currentVillageId')
|
||||
// 设置不需要绑定小区
|
||||
if (item.title !== '设置') {
|
||||
// 设置和我的房屋不需要绑定小区(我的房屋用于首次绑定)
|
||||
if (item.title !== '设置' && item.title !== '我的房屋') {
|
||||
if (!cachedVillageId || cachedVillageId === '0' || cachedVillageId === 0) {
|
||||
uni.showToast({ title: '未绑定小区,没有权限', icon: 'none', duration: 2000 })
|
||||
return
|
||||
@@ -110,9 +110,7 @@
|
||||
if (item.title == '我的房屋') {
|
||||
uni.navigateTo({
|
||||
url: '/pageSubPack/my/myHouseIndex',
|
||||
success: res => {},
|
||||
fail: () => {},
|
||||
complete: () => {}
|
||||
|
||||
});
|
||||
} else if (item.title == '住户管理') {
|
||||
// uni.navigateTo({
|
||||
@@ -124,16 +122,12 @@
|
||||
} else if (item.title == '我的车位') {
|
||||
uni.navigateTo({
|
||||
url: '/pageSubPack/my/myParkingSpaceIndex',
|
||||
success: res => {},
|
||||
fail: () => {},
|
||||
complete: () => {}
|
||||
|
||||
});
|
||||
} else if (item.title == '我的车辆') {
|
||||
uni.navigateTo({
|
||||
url: '/pageSubPack/my/myCarIndex',
|
||||
success: res => {},
|
||||
fail: () => {},
|
||||
complete: () => {}
|
||||
|
||||
});
|
||||
} else if (item.title == '设置') {
|
||||
goSetting()
|
||||
|
||||
Reference in New Issue
Block a user