diff --git a/public/react/src/modules/osshackathon/Osshackathon.js b/public/react/src/modules/osshackathon/Osshackathon.js index 4fc73850f..0e175ef04 100644 --- a/public/react/src/modules/osshackathon/Osshackathon.js +++ b/public/react/src/modules/osshackathon/Osshackathon.js @@ -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: `是否确认报名?`, diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index 4408265ce..64021207d 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -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?this.hideAccountPhoneemailtype()} + {...this.props} + {...this.state} + {...this.dialogObj} + />:""} { + 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( + +
+

您需要完成手机号码和邮箱的绑定,才能使用此功能

+
+ this.gotoback()}>稍后完善 + {'立即完善'} +
+
+
+ ) + } +} + +export default AccountPhoneemail; \ No newline at end of file