Commit 52ae730d by zhangleyuan

feat:修改更改手机号

parent 72746710
...@@ -8,10 +8,11 @@ import CheckBeforeSendCode from '@/components/CheckBeforeSendCode'; ...@@ -8,10 +8,11 @@ import CheckBeforeSendCode from '@/components/CheckBeforeSendCode';
interface changePhoneModalProps { interface changePhoneModalProps {
onClose:() => void, onClose:() => void,
onConfirm:any
} }
function ChangePhoneModal(props: changePhoneModalProps) { function ChangePhoneModal(props: changePhoneModalProps) {
const { onClose} = props; const { onClose,onConfirm} = props;
const [newPhone,setNewPhone] = useState(''); const [newPhone,setNewPhone] = useState('');
const [phoneVerify,setPhoneVerify] = useState(''); const [phoneVerify,setPhoneVerify] = useState('');
const [codeText, setCodeText] = useState('发送验证码'); const [codeText, setCodeText] = useState('发送验证码');
...@@ -102,6 +103,7 @@ function ChangePhoneModal(props: changePhoneModalProps) { ...@@ -102,6 +103,7 @@ function ChangePhoneModal(props: changePhoneModalProps) {
} }
BaseService.editUserPhone(param).then((res) => { BaseService.editUserPhone(param).then((res) => {
if(res.success){ if(res.success){
onConfirm(newPhone)
onClose(); onClose();
}else{ }else{
setErrorMessageText(res.message); setErrorMessageText(res.message);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zhangleyuan * @Author: zhangleyuan
* @Date: 2020-11-27 15:06:31 * @Date: 2020-11-27 15:06:31
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-08 17:07:05 * @LastEditTime: 2020-12-08 17:33:13
* @Description: 描述一下 * @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -38,6 +38,7 @@ function PersonalInfoPage() { ...@@ -38,6 +38,7 @@ function PersonalInfoPage() {
const storeUserId = User.getStoreUserId() const storeUserId = User.getStoreUserId()
const ctx: any = useContext(XMContext); const ctx: any = useContext(XMContext);
const userId = User.getUserId(); const userId = User.getUserId();
const [checkObject1, setCheckObject1] = useState({});
window.ctx = ctx; window.ctx = ctx;
useEffect(() => { useEffect(() => {
storeUserId && getUserInfo(); storeUserId && getUserInfo();
...@@ -100,6 +101,9 @@ function PersonalInfoPage() { ...@@ -100,6 +101,9 @@ function PersonalInfoPage() {
ctx.dispatch(setStoreList(storeVOS)); ctx.dispatch(setStoreList(storeVOS));
}); });
} }
function changePhoneConfirm(phone:any){
setPhone(phone);
}
return ( return (
<div className="page personal-info-page"> <div className="page personal-info-page">
<div className="page-content"> <div className="page-content">
...@@ -151,7 +155,7 @@ function PersonalInfoPage() { ...@@ -151,7 +155,7 @@ function PersonalInfoPage() {
} }
{ {
changePhoneModalVisible && <ChangePhoneModal onClose={()=>{setChangePhoneModalVisible(false)}}/> changePhoneModalVisible && <ChangePhoneModal onClose={()=>{setChangePhoneModalVisible(false)}} onConfirm={changePhoneConfirm}/>
} }
</div> </div>
......
...@@ -147,6 +147,7 @@ function Login(props) { ...@@ -147,6 +147,7 @@ function Login(props) {
<span style={{ fontSize: '12px', color: '#999', marginBottom: 8, display: 'block' }}>请完成安全验证</span> <span style={{ fontSize: '12px', color: '#999', marginBottom: 8, display: 'block' }}>请完成安全验证</span>
<CheckBeforeSendCode <CheckBeforeSendCode
callback={(data, nc) => { callback={(data, nc) => {
setCheckObject1(nc);
checkAccount(1, (userType) => { checkAccount(1, (userType) => {
handleSendSMSCode(data, userType); handleSendSMSCode(data, userType);
setTimeout(() => { setTimeout(() => {
......
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