Commit c641da4b by zhangleyuan

feat:修改滑块验证码的默认显示问题

parent 9f0fc619
...@@ -7,7 +7,12 @@ import CheckBeforeSendCode from '@/components/CheckBeforeSendCode'; ...@@ -7,7 +7,12 @@ import CheckBeforeSendCode from '@/components/CheckBeforeSendCode';
interface changePhoneModalProps { interface changePhoneModalProps {
onClose:() => void, onClose:() => void,
onConfirm:any onConfirm:any,
}
interface checkObjectType {
reset:() => void
} }
function ChangePhoneModal(props: changePhoneModalProps) { function ChangePhoneModal(props: changePhoneModalProps) {
...@@ -20,7 +25,7 @@ function ChangePhoneModal(props: changePhoneModalProps) { ...@@ -20,7 +25,7 @@ function ChangePhoneModal(props: changePhoneModalProps) {
const [phoneVerifyError,setPhoneVerifyError] = useState(false); const [phoneVerifyError,setPhoneVerifyError] = useState(false);
const [errorMessageText,setErrorMessageText] = useState(''); const [errorMessageText,setErrorMessageText] = useState('');
const [openCheck, setOpenCheck] = useState(false); //滑块验证是否是打开状态 const [openCheck, setOpenCheck] = useState(false); //滑块验证是否是打开状态
const [checkObject, setCheckObject] = useState({}); const [checkObject, setCheckObject] = useState<checkObjectType|undefined>();
useEffect(() => { useEffect(() => {
}) })
...@@ -39,7 +44,7 @@ function ChangePhoneModal(props: changePhoneModalProps) { ...@@ -39,7 +44,7 @@ function ChangePhoneModal(props: changePhoneModalProps) {
setNewPhoneError(true); setNewPhoneError(true);
return; return;
} }
!_.isEmpty(checkObject) && checkObject.reset(); !_.isEmpty(checkObject) && checkObject && checkObject.reset();
setOpenCheck(true); setOpenCheck(true);
} }
function handleSendSMSCode(checkData:any){ function handleSendSMSCode(checkData:any){
......
...@@ -9,6 +9,9 @@ interface IdentificationModalProps { ...@@ -9,6 +9,9 @@ interface IdentificationModalProps {
phone:String, phone:String,
onConfirm:() => void onConfirm:() => void
} }
interface checkObjectType {
reset:() => void
}
function IdentificationModal(props: IdentificationModalProps) { function IdentificationModal(props: IdentificationModalProps) {
const {onClose, phone ,onConfirm} = props; const {onClose, phone ,onConfirm} = props;
...@@ -19,7 +22,7 @@ function IdentificationModal(props: IdentificationModalProps) { ...@@ -19,7 +22,7 @@ function IdentificationModal(props: IdentificationModalProps) {
const [errorMessageText,setErrorMessageText] = useState(''); const [errorMessageText,setErrorMessageText] = useState('');
const [openCheck, setOpenCheck] = useState(false); //滑块验证是否是打开状态 const [openCheck, setOpenCheck] = useState(false); //滑块验证是否是打开状态
const [checkObject, setCheckObject] = useState({}); const [checkObject, setCheckObject] = useState<checkObjectType|undefined>();
useEffect(() => { useEffect(() => {
}) })
...@@ -76,7 +79,7 @@ function IdentificationModal(props: IdentificationModalProps) { ...@@ -76,7 +79,7 @@ function IdentificationModal(props: IdentificationModalProps) {
} }
function checkSend() { function checkSend() {
if (waitStatus) return; if (waitStatus) return;
!_.isEmpty(checkObject) && checkObject.reset(); !_.isEmpty(checkObject) && checkObject && checkObject.reset();
setOpenCheck(true); setOpenCheck(true);
} }
return ( return (
......
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