调整黑客松增加 手机邮箱认证

chromesetting
杨树明 5 years ago
parent fe5e35c46a
commit 4bcb66092d

@ -117,6 +117,10 @@ class Osshackathon extends Component {
this.props.showProfileCompleteDialog()
return
}
//判断是否绑定邮箱
if(!this.props.user.email===true||!this.props.user.phone===true){
this.props.showhideAccountPhoneemailDialog()
}
this.props.confirm({
content: `是否确认报名?`,

@ -11,7 +11,7 @@ import { Spin } from 'antd';
import './TPMIndex.css';
import LoginDialog from '../login/LoginDialog';
import AccountProfile from '../user/AccountProfile';
import AccountPhoneemail from '../user/AccountPhoneemail';
import Trialapplication from "../login/Trialapplication";
// import "antd/dist/antd.css";
// import '../../css/educoder/edu-common.css'
@ -80,7 +80,7 @@ export function TPMIndexHOC(WrappedComponent) {
isRender: false,
AccountProfiletype: false,
AccountPhoneemailtype:false,
globalLoading: false,
dataquerys:{},
isloginCancel:undefined,
@ -532,6 +532,17 @@ export function TPMIndexHOC(WrappedComponent) {
AccountProfiletype: true
})
}
showhideAccountPhoneemailDialog = () => {
this.dialogObj = {}
this.setState({
AccountPhoneemailtype: true
})
}
hideAccountPhoneemailtype=()=>{
this.setState({
AccountPhoneemailtype:false
})
}
//验证是否完善资料
checkIfProfileCompleted = () => {
return this.state.current_user && this.state.current_user.profile_completed
@ -625,7 +636,7 @@ export function TPMIndexHOC(WrappedComponent) {
}
render() {
let{Headertop,Footerdown, isRender, AccountProfiletype,mygetHelmetapi}=this.state;
let{Headertop,Footerdown, isRender, AccountProfiletype,AccountPhoneemailtype}=this.state;
const common = {
isSuperAdmin:this.isSuperAdmin,
isAdminOrCreator:this.isAdminOrCreator,
@ -645,6 +656,7 @@ export function TPMIndexHOC(WrappedComponent) {
showLoginDialog: this.showLoginDialog,
checkIfLogin: this.checkIfLogin,
showProfileCompleteDialog: this.showProfileCompleteDialog,
showhideAccountPhoneemailDialog:this.showhideAccountPhoneemailDialog,
checkIfProfileCompleted: this.checkIfProfileCompleted,
checkIfProfessionalCertification: this.checkIfProfessionalCertification,
showProfessionalCertificationDialog: this.showProfessionalCertificationDialog,
@ -677,6 +689,13 @@ export function TPMIndexHOC(WrappedComponent) {
{...this.state}
{...this.dialogObj}
/>:""}
{/*验证是否注册手机邮箱*/}
{AccountPhoneemailtype===true?<AccountPhoneemail
hideAccountProfile={()=>this.hideAccountPhoneemailtype()}
{...this.props}
{...this.state}
{...this.dialogObj}
/>:""}
<SiderBar
{...this.props}
{...this.state}

@ -0,0 +1,79 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import {Modal} from 'antd';
import axios from 'axios';
class AccountPhoneemail extends Component {
constructor(props) {
super(props);
this.state = {
AccountPhoneemailtype:false
}
}
componentDidMount() {
if(this.props.AccountPhoneemailtype!=undefined){
this.setState({
AccountPhoneemailtype:this.props.AccountPhoneemailtype
})
}
axios.interceptors.response.use((response) => {
if (response != undefined)
if (response && response.data.status === 402) {
this.setState({
AccountPhoneemailtype: true
})
}
return response;
}, (error) => {
});
}
gotoback=()=>{
if(this.props.AccountPhoneemailtype!=undefined){
this.setState({
AccountPhoneemailtype:false
})
this.props.hideAccountProfile()
}else{
window.location.href="/";
this.setState({
AccountPhoneemailtype:false
})
}
}
/**
content: '您需要去完成您的职业认证,才能使用此功能',
okText: '立即完成',
okHref: '/account/certification'
*/
render() {
const { content, okText, okHref } = this.props;
return(
<Modal
keyboard={false}
title="提示"
visible={this.state.AccountPhoneemailtype}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
width="530px"
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16"> 您需要完成手机号码和邮箱的绑定才能使用此功能</p>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.gotoback()}>稍后完善</a>
<a className="task-btn task-btn-orange" href={ "/account/secure" }> {'立即完善'}</a>
</div>
</div>
</Modal>
)
}
}
export default AccountPhoneemail;
Loading…
Cancel
Save