From 6bf4799789a08c1f802b6a3525eb41c3d8d36254 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com>
Date: Tue, 4 Nov 2025 17:03:55 +0800
Subject: [PATCH] =?UTF-8?q?feat(passport):=20=E6=9B=B4=E6=96=B0=E7=99=BB?=
=?UTF-8?q?=E5=BD=95=E9=A1=B5=E9=9D=A2=E4=BA=A4=E4=BA=92=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修改手机号输入框提示文案为“请输入账号”- 移除手机号格式校验逻辑
- 将短信验证码输入框改为密码类型,并修改提示文案为“请输入密码”- 移除获取验证码按钮及相关倒计时逻辑
- 调整用户协议勾选框文案,去除“勾选表示您”前缀-优化登录接口调用参数格式
---
src/passport/login.tsx | 88 ++++++++++++++++++------------------------
1 file changed, 37 insertions(+), 51 deletions(-)
diff --git a/src/passport/login.tsx b/src/passport/login.tsx
index fa14a11..1ad94e8 100644
--- a/src/passport/login.tsx
+++ b/src/passport/login.tsx
@@ -35,29 +35,29 @@ const Login = () => {
}
// 发送短信验证码
- const handleSendSmsCode = async () => {
- if (!phone) {
- Taro.showToast({
- title: '请输入手机号',
- icon: 'error'
- })
- return
- }
-
- // 验证手机号格式
- const phoneReg = /^1[3-9]\d{9}$/
- if (!phoneReg.test(phone)) {
- Taro.showToast({
- title: '手机号格式不正确',
- icon: 'error'
- })
- return
- }
-
- // 显示图形验证码弹窗
- fetchCaptcha()
- setShowCaptchaModal(true)
- }
+ // const handleSendSmsCode = async () => {
+ // if (!phone) {
+ // Taro.showToast({
+ // title: '请输入手机号',
+ // icon: 'error'
+ // })
+ // return
+ // }
+ //
+ // // 验证手机号格式
+ // const phoneReg = /^1[3-9]\d{9}$/
+ // if (!phoneReg.test(phone)) {
+ // Taro.showToast({
+ // title: '手机号格式不正确',
+ // icon: 'error'
+ // })
+ // return
+ // }
+ //
+ // // 显示图形验证码弹窗
+ // fetchCaptcha()
+ // setShowCaptchaModal(true)
+ // }
// 确认发送短信验证码
const confirmSendSmsCode = async () => {
@@ -96,21 +96,21 @@ const Login = () => {
const handleSmsLogin = async () => {
if (!phone) {
Taro.showToast({
- title: '请输入手机号',
+ title: '请输入账号',
icon: 'error'
})
return
}
// 验证手机号格式
- const phoneReg = /^1[3-9]\d{9}$/
- if (!phoneReg.test(phone)) {
- Taro.showToast({
- title: '手机号格式不正确',
- icon: 'error'
- })
- return
- }
+ // const phoneReg = /^1[3-9]\d{9}$/
+ // if (!phoneReg.test(phone)) {
+ // Taro.showToast({
+ // title: '手机号格式不正确',
+ // icon: 'error'
+ // })
+ // return
+ // }
if (!smsCode) {
Taro.showToast({
@@ -123,7 +123,7 @@ const Login = () => {
try {
setLoading(true)
// 短信登录时传入手机号和短信验证码
- const res = await loginBySms({ phone, code: smsCode })
+ const res = await loginBySms({ phone, code:smsCode })
console.log(res,'.......')
Taro.showToast({
@@ -232,8 +232,7 @@ const Login = () => {
}}>
setPhone(val)}
style={{
@@ -258,9 +257,8 @@ const Login = () => {
borderRadius: '8px'
}}>
setSmsCode(val)}
style={{
@@ -269,18 +267,6 @@ const Login = () => {
padding: '10px'
}}
/>
-
@@ -317,7 +303,7 @@ const Login = () => {
checked={isAgree}
onClick={() => setIsAgree(!isAgree)}
/>
- setIsAgree(!isAgree)}>勾选表示您已阅读并同意
+ setIsAgree(!isAgree)}>已阅读并同意
Taro.navigateTo({url: '/passport/agreement'})}
style={{color: '#1890ff'}}