|
|
|
@ -30,32 +30,48 @@ import { ConfirmModal } from '../../../components/modal/ConfirmModal';
|
|
|
|
|
|
|
|
|
|
// ** Function to toggle tabs
|
|
|
|
|
const AccountMypageContainer = () => { |
|
|
|
|
// tab 관리
|
|
|
|
|
const [activeTab, setActiveTab] = useState('1'); |
|
|
|
|
const dispatch = useDispatch(); |
|
|
|
|
// { id } = useParams();
|
|
|
|
|
|
|
|
|
|
// tab 관리
|
|
|
|
|
const toggle = tab => { |
|
|
|
|
return setActiveTab(tab); |
|
|
|
|
}; |
|
|
|
|
// 모달 관리
|
|
|
|
|
const [formModal, setFormModal] = useState(false); |
|
|
|
|
// 회원 정보 조회
|
|
|
|
|
const { userPage } = useSelector(state => state.UserPageState); |
|
|
|
|
// 로그인 정보 조회
|
|
|
|
|
const { user } = useSelector(state => state.authState); |
|
|
|
|
|
|
|
|
|
// 회원 정보
|
|
|
|
|
const [userInfo, setUserInfo] = useState(); |
|
|
|
|
|
|
|
|
|
// 휴대폰 번호 변경
|
|
|
|
|
const [inputHpno, setInputHpno] = useState(''); |
|
|
|
|
// 인증번호
|
|
|
|
|
const [inputCrtfy, setInputCrtfy] = useState(''); |
|
|
|
|
|
|
|
|
|
// 타이머 분
|
|
|
|
|
const [minutes_Counter, setMinutes_Counter] = useState('03'); |
|
|
|
|
// 타이머 초
|
|
|
|
|
const [seconds_Counter, setSeconds_Counter] = useState('00'); |
|
|
|
|
// 타이머
|
|
|
|
|
const [timer, setTimer] = useState(null); |
|
|
|
|
// 타이머 실행 여부
|
|
|
|
|
const [isRunning, setIsRunning] = useState(false); |
|
|
|
|
// 인증번호 발송 횟수
|
|
|
|
|
const [sendCount, setSendCount] = useState(0); |
|
|
|
|
// 인증번호 발송 여부
|
|
|
|
|
const [isCrtfy, setIsCrtfy] = useState(false); |
|
|
|
|
|
|
|
|
|
// 전화번호 변경 여부
|
|
|
|
|
const [okinput, setOkinput] = useState(false); |
|
|
|
|
// 전화번호 업데이트 여부
|
|
|
|
|
const [okcheck, setOkcheck] = useState(''); |
|
|
|
|
|
|
|
|
|
// 모달 관리
|
|
|
|
|
const [modal, setModal] = useState({ |
|
|
|
|
isOpen: false, |
|
|
|
|
title: '', |
|
|
|
@ -68,6 +84,7 @@ const AccountMypageContainer = () => {
|
|
|
|
|
desc: '', |
|
|
|
|
color: '' |
|
|
|
|
}); |
|
|
|
|
// 타이머
|
|
|
|
|
const timerStart = count => { |
|
|
|
|
let minutes, seconds; |
|
|
|
|
|
|
|
|
@ -101,6 +118,7 @@ const AccountMypageContainer = () => {
|
|
|
|
|
clearInterval(timer); |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
//
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (userInfo) { |
|
|
|
|
setOkcheck(!okinput ? userInfo.hpno : inputHpno); |
|
|
|
@ -179,6 +197,7 @@ const AccountMypageContainer = () => {
|
|
|
|
|
// handlerSmsSend();
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 타이머 언마운트시 종료
|
|
|
|
|
useEffect(() => { |
|
|
|
|
// setIsRunning(true);
|
|
|
|
|
if (isRunning) { |
|
|
|
@ -243,10 +262,12 @@ const AccountMypageContainer = () => {
|
|
|
|
|
setIsCrtfy(true); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// userInfo에 회원 정보 값 넣기
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (userPage) setUserInfo(userPage[0]); |
|
|
|
|
}, [userPage]); |
|
|
|
|
|
|
|
|
|
// input 헨들러
|
|
|
|
|
const handlerInput = e => { |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
setUserInfo({ |
|
|
|
@ -254,19 +275,22 @@ const AccountMypageContainer = () => {
|
|
|
|
|
[name]: value |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 회원 정보 조회
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (user) { |
|
|
|
|
dispatch(userPageAction.request(user.cstmrSno)); |
|
|
|
|
} |
|
|
|
|
}, []); |
|
|
|
|
|
|
|
|
|
// 휴대폰 번호 변경 모달 헨들러
|
|
|
|
|
const handler = () => { |
|
|
|
|
setFormModal(!formModal); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
let hpno = ''; |
|
|
|
|
let crtfyhp = ''; |
|
|
|
|
|
|
|
|
|
// 휴대폰 번호 변경 input 헨들러
|
|
|
|
|
const handlerChange = e => { |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
|
|
|
|
@ -284,6 +308,7 @@ const AccountMypageContainer = () => {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
//업데이트
|
|
|
|
|
const handlerUpdate = () => { |
|
|
|
|
const reg_email = |
|
|
|
@ -306,6 +331,7 @@ const AccountMypageContainer = () => {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 탈퇴 모달
|
|
|
|
|
const handlerTest = () => { |
|
|
|
|
setQuite({ |
|
|
|
|
isOpen: true, |
|
|
|
@ -314,6 +340,7 @@ const AccountMypageContainer = () => {
|
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 탈퇴
|
|
|
|
|
const waitwait = () => { |
|
|
|
|
dispatch(userDeleteAction.request(user.cstmrSno)); |
|
|
|
|
}; |
|
|
|
|