This commit is contained in:
caishi 2021-09-01 10:25:12 +08:00
parent 9655cd5105
commit 58115f8dae
4 changed files with 36 additions and 6 deletions

View File

@ -0,0 +1,16 @@
import React from 'react';
import { Modal } from 'antd';
import './Index.scss';
function ProfileModal({visible}) {
return(
<Modal
visible={visible}
width={"400px"}
>
<p>您目前的个人资料不完整需要补充资料以进行后续操作是否前往补充个人信息</p>
</Modal>
)
}
export default ProfileModal;

View File

@ -224,6 +224,7 @@ class NewHeader extends Component {
}
addMenu=(list)=>{
console.log(this.props);
return(
list && list.length >0 &&
<div className="dropdownFlex">
@ -231,7 +232,8 @@ class NewHeader extends Component {
{
list.map((item,key)=>{
return(
(item.name !=="加入课堂" && item.name !=="加入开发项目") && <Menu.Item key={item.name+key}><a href={item.url}>{item.name}</a></Menu.Item>
(item.name !=="加入课堂" && item.name !=="加入开发项目") &&
<Menu.Item key={item.name+key}><a href={item.url}>{item.name}</a></Menu.Item>
)
})
}

View File

@ -6,6 +6,7 @@ import { Spin } from 'antd';
import './TPMIndex.css';
import LoginDialog from '../login/LoginDialog';
import EducoderAccount from '../../forge/Component/EducoderAccount';
import ProfileModal from '../../forge/Component/ProfileModal/Index';
export function TPMIndexHOC(WrappedComponent) {
return class II extends React.Component {
@ -24,7 +25,9 @@ export function TPMIndexHOC(WrappedComponent) {
isloginCancel: undefined,
mygetHelmetapi: null,
giteaVisible:false,
email:undefined
email:undefined,
completeProfile:false,
showCP:false
}
}
@ -151,7 +154,8 @@ export function TPMIndexHOC(WrappedComponent) {
if (response && response.data) {
this.initCommonState(response.data)
this.setState({
tpmLoading: false
tpmLoading: false,
completeProfile:response.data.profile_completed
})
if (this.props.match.path === "/" && response.data.login) {
this.props.history.push(`/${response.data.login}`);
@ -204,23 +208,31 @@ export function TPMIndexHOC(WrappedComponent) {
}).catch(error=>{})
}
showCompeleteDialog=()=>{
this.setState({
showCP:true
})
}
render() {
let { isRender , current_user , giteaVisible , email } = this.state;
let { isRender , current_user , giteaVisible , email , completeProfile , showCP } = this.state;
const common = {
showLoginDialog: this.showLoginDialog,
checkIfLogin: this.checkIfLogin,
resetUserInfo:this.fetchUsers
resetUserInfo:this.fetchUsers,
showCompeleteDialog:this.showCompeleteDialog
};
return (
<div className="indexHOC">
<EducoderAccount visible={giteaVisible} email={email} onOk={this.onOk}/>
<ProfileModal visible={!completeProfile && showCP}/>
{isRender === true ? <LoginDialog
Modifyloginvalue={() => this.hideLoginDialog()}
{...this.props}
{...this.state}
/> : ""}
<Header {...this.state} {...this.props}></Header>
<Header {...this.state} {...this.props} {...common}></Header>
<Spin spinning={this.state.globalLoading} delay={0} className="globalSpin"
size="large" tip={this._gLoadingTip || "加载中..."}
>