优化登录提示语
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 登录按钮 -->
|
||||
<button class="login-btn" :disabled="!canLogin" @click="handleLogin">
|
||||
<button class="login-btn" @click="handleLogin">
|
||||
登录
|
||||
</button>
|
||||
|
||||
@@ -159,7 +159,26 @@
|
||||
|
||||
// 登录处理
|
||||
const handleLogin = () => {
|
||||
if (!canLogin.value) return;
|
||||
if (!phoneNumber.value) {
|
||||
uni.showToast({ title: '请输入手机号', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!/^1[3-9]\d{9}$/.test(phoneNumber.value)) {
|
||||
uni.showToast({ title: '请输入正确的手机号', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!verifyCode.value) {
|
||||
uni.showToast({ title: '请输入验证码', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!/^\d{6}$/.test(verifyCode.value)) {
|
||||
uni.showToast({ title: '验证码为 6 位数字', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!agreeAgreement.value) {
|
||||
uni.showToast({ title: '请勾选协议', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '登录中...',
|
||||
mask: true
|
||||
|
||||
Reference in New Issue
Block a user