Commit 3f2fbd4f authored by Bill's avatar Bill

fix: 修改修改密码bug

parent 583ed58f
......@@ -29,6 +29,6 @@
}
}
.captchaBtn {
width: 102px;
}
\ No newline at end of file
// .captchaBtn {
// width: 102px;
// }
......@@ -82,7 +82,7 @@ const EditDataComponent = (props) => {
const postData = (
props.type == 'phone'
? {
countryCode: form.getFieldValue('country'),
countryCode: `+${form.getFieldValue('country')}`,
phone: form.getFieldValue('newPhone')
}
: { email: form.getFieldValue('email') }
......@@ -206,7 +206,7 @@ const EditDataComponent = (props) => {
: <>
<Form.Item label="新的手机号码">
<Row gutter={10}>
<Col span={4}>
<Col span={6}>
<Form.Item
name="country"
noStyle
......
.btn {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
height: 32px;
border: 1px solid #d9d9d9;
width: 100%;
margin-right: 0px;
cursor: pointer;
}
.disabled {
background-color: #f5f5f5;
}
import React, { useState, useEffect, useRef, useCallback } from 'react';
import { Button } from 'antd';
import styles from './index.less';
import cx from 'classnames';
const GetCaptchaCode = (props) => {
const { disable = false } = props;
......@@ -28,22 +30,27 @@ const GetCaptchaCode = (props) => {
}
}, [time])
const isDisabled = disable || time > 0
const handleClick = useCallback(() => {
if (isDisabled) {
return;
}
const hasFn = !!props.getCode;
if(hasFn) {
props.getCode()
setTime(59)
}
}, [])
}, [isDisabled])
return (
<Button disabled={disable || !!time} onClick={handleClick} style={{width: '100%'}}>
<div onClick={handleClick} className={cx(styles.btn, {[styles.disabled]: isDisabled})} style={{width: '100%'}}>
{
time
? `${time} s`
: '获取验证码'
}
</Button>
</div>
)
}
......
......@@ -113,9 +113,7 @@ const EmailVerifyPanel = (props) => {
</Form.Item>
</Col>
<Col span={6}>
<div style={{width: '102px'}}>
<GetCaptchaCode getCode={getCode} />
</div>
</Col>
</Row>
</Form.Item>
......
......@@ -115,9 +115,7 @@ const PhoneVerifyPanel: React.FC<IProps> = (props) => {
</Form.Item>
</Col>
<Col span={6}>
<div style={{width: '102px'}}>
<GetCaptchaCode getCode={getCode} />
</div>
</Col>
</Row>
</Form.Item>
......@@ -128,7 +126,7 @@ const PhoneVerifyPanel: React.FC<IProps> = (props) => {
: null
}
{
visible
!visible
? <>
<EditDataComponent type={pageType} form={form} />
<Form.Item {...tailLayout}>
......
......@@ -28,7 +28,7 @@ const AccountSetting = () => {
return (
<Col xxl={12} xl={12} lg={24} md={24} sm={24} xs={24} key={item}>
<TypeVerify
type={item}
type={item as 'phone'}
phone={account.phone}
email={account.email}
paycode={account.hasPayPassword}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment