feat(passport): 更新登录页面交互逻辑

- 修改手机号输入框提示文案为“请输入账号”- 移除手机号格式校验逻辑
- 将短信验证码输入框改为密码类型,并修改提示文案为“请输入密码”- 移除获取验证码按钮及相关倒计时逻辑
- 调整用户协议勾选框文案,去除“勾选表示您”前缀-优化登录接口调用参数格式
This commit is contained in:
2025-11-04 17:03:55 +08:00
parent 7b78a39b52
commit 6bf4799789

View File

@@ -35,29 +35,29 @@ const Login = () => {
} }
// 发送短信验证码 // 发送短信验证码
const handleSendSmsCode = async () => { // const handleSendSmsCode = async () => {
if (!phone) { // if (!phone) {
Taro.showToast({ // Taro.showToast({
title: '请输入手机号', // title: '请输入手机号',
icon: 'error' // icon: 'error'
}) // })
return // return
} // }
//
// 验证手机号格式 // // 验证手机号格式
const phoneReg = /^1[3-9]\d{9}$/ // const phoneReg = /^1[3-9]\d{9}$/
if (!phoneReg.test(phone)) { // if (!phoneReg.test(phone)) {
Taro.showToast({ // Taro.showToast({
title: '手机号格式不正确', // title: '手机号格式不正确',
icon: 'error' // icon: 'error'
}) // })
return // return
} // }
//
// 显示图形验证码弹窗 // // 显示图形验证码弹窗
fetchCaptcha() // fetchCaptcha()
setShowCaptchaModal(true) // setShowCaptchaModal(true)
} // }
// 确认发送短信验证码 // 确认发送短信验证码
const confirmSendSmsCode = async () => { const confirmSendSmsCode = async () => {
@@ -96,21 +96,21 @@ const Login = () => {
const handleSmsLogin = async () => { const handleSmsLogin = async () => {
if (!phone) { if (!phone) {
Taro.showToast({ Taro.showToast({
title: '请输入手机号', title: '请输入号',
icon: 'error' icon: 'error'
}) })
return return
} }
// 验证手机号格式 // 验证手机号格式
const phoneReg = /^1[3-9]\d{9}$/ // const phoneReg = /^1[3-9]\d{9}$/
if (!phoneReg.test(phone)) { // if (!phoneReg.test(phone)) {
Taro.showToast({ // Taro.showToast({
title: '手机号格式不正确', // title: '手机号格式不正确',
icon: 'error' // icon: 'error'
}) // })
return // return
} // }
if (!smsCode) { if (!smsCode) {
Taro.showToast({ Taro.showToast({
@@ -232,8 +232,7 @@ const Login = () => {
}}> }}>
<Input <Input
type="text" type="text"
placeholder="手机号" placeholder="请输入账号"
maxLength={11}
value={phone} value={phone}
onChange={(val) => setPhone(val)} onChange={(val) => setPhone(val)}
style={{ style={{
@@ -258,9 +257,8 @@ const Login = () => {
borderRadius: '8px' borderRadius: '8px'
}}> }}>
<Input <Input
type="text" type="password"
placeholder="短信验证码" placeholder="请输入密码"
maxLength={6}
value={smsCode} value={smsCode}
onChange={(val) => setSmsCode(val)} onChange={(val) => setSmsCode(val)}
style={{ style={{
@@ -269,18 +267,6 @@ const Login = () => {
padding: '10px' padding: '10px'
}} }}
/> />
<Button
type="info"
size="small"
disabled={countdown > 0}
onClick={handleSendSmsCode}
style={{
borderRadius: '0 8px 8px 0',
height: '40px'
}}
>
{countdown > 0 ? `${countdown}秒后重发` : '获取验证码'}
</Button>
</div> </div>
</div> </div>
</div> </div>
@@ -317,7 +303,7 @@ const Login = () => {
checked={isAgree} checked={isAgree}
onClick={() => setIsAgree(!isAgree)} onClick={() => setIsAgree(!isAgree)}
/> />
<span style={{color: '#999', marginLeft: '5px'}} onClick={() => setIsAgree(!isAgree)}></span> <span style={{color: '#999', marginLeft: '5px'}} onClick={() => setIsAgree(!isAgree)}></span>
<a <a
onClick={() => Taro.navigateTo({url: '/passport/agreement'})} onClick={() => Taro.navigateTo({url: '/passport/agreement'})}
style={{color: '#1890ff'}} style={{color: '#1890ff'}}