feat(passport): 更新登录页面交互逻辑
- 修改手机号输入框提示文案为“请输入账号”- 移除手机号格式校验逻辑 - 将短信验证码输入框改为密码类型,并修改提示文案为“请输入密码”- 移除获取验证码按钮及相关倒计时逻辑 - 调整用户协议勾选框文案,去除“勾选表示您”前缀-优化登录接口调用参数格式
This commit is contained in:
@@ -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({
|
||||
@@ -232,8 +232,7 @@ const Login = () => {
|
||||
}}>
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="手机号"
|
||||
maxLength={11}
|
||||
placeholder="请输入账号"
|
||||
value={phone}
|
||||
onChange={(val) => setPhone(val)}
|
||||
style={{
|
||||
@@ -258,9 +257,8 @@ const Login = () => {
|
||||
borderRadius: '8px'
|
||||
}}>
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="短信验证码"
|
||||
maxLength={6}
|
||||
type="password"
|
||||
placeholder="请输入密码"
|
||||
value={smsCode}
|
||||
onChange={(val) => setSmsCode(val)}
|
||||
style={{
|
||||
@@ -269,18 +267,6 @@ const Login = () => {
|
||||
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>
|
||||
@@ -317,7 +303,7 @@ const Login = () => {
|
||||
checked={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
|
||||
onClick={() => Taro.navigateTo({url: '/passport/agreement'})}
|
||||
style={{color: '#1890ff'}}
|
||||
|
||||
Reference in New Issue
Block a user