Commit 52ae730d by zhangleyuan

feat:修改更改手机号

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