box
This commit is contained in:
parent
9655cd5105
commit
58115f8dae
|
@ -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;
|
|
@ -224,6 +224,7 @@ class NewHeader extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
addMenu=(list)=>{
|
addMenu=(list)=>{
|
||||||
|
console.log(this.props);
|
||||||
return(
|
return(
|
||||||
list && list.length >0 &&
|
list && list.length >0 &&
|
||||||
<div className="dropdownFlex">
|
<div className="dropdownFlex">
|
||||||
|
@ -231,7 +232,8 @@ class NewHeader extends Component {
|
||||||
{
|
{
|
||||||
list.map((item,key)=>{
|
list.map((item,key)=>{
|
||||||
return(
|
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>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { Spin } from 'antd';
|
||||||
import './TPMIndex.css';
|
import './TPMIndex.css';
|
||||||
import LoginDialog from '../login/LoginDialog';
|
import LoginDialog from '../login/LoginDialog';
|
||||||
import EducoderAccount from '../../forge/Component/EducoderAccount';
|
import EducoderAccount from '../../forge/Component/EducoderAccount';
|
||||||
|
import ProfileModal from '../../forge/Component/ProfileModal/Index';
|
||||||
|
|
||||||
export function TPMIndexHOC(WrappedComponent) {
|
export function TPMIndexHOC(WrappedComponent) {
|
||||||
return class II extends React.Component {
|
return class II extends React.Component {
|
||||||
|
@ -24,7 +25,9 @@ export function TPMIndexHOC(WrappedComponent) {
|
||||||
isloginCancel: undefined,
|
isloginCancel: undefined,
|
||||||
mygetHelmetapi: null,
|
mygetHelmetapi: null,
|
||||||
giteaVisible:false,
|
giteaVisible:false,
|
||||||
email:undefined
|
email:undefined,
|
||||||
|
completeProfile:false,
|
||||||
|
showCP:false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +154,8 @@ export function TPMIndexHOC(WrappedComponent) {
|
||||||
if (response && response.data) {
|
if (response && response.data) {
|
||||||
this.initCommonState(response.data)
|
this.initCommonState(response.data)
|
||||||
this.setState({
|
this.setState({
|
||||||
tpmLoading: false
|
tpmLoading: false,
|
||||||
|
completeProfile:response.data.profile_completed
|
||||||
})
|
})
|
||||||
if (this.props.match.path === "/" && response.data.login) {
|
if (this.props.match.path === "/" && response.data.login) {
|
||||||
this.props.history.push(`/${response.data.login}`);
|
this.props.history.push(`/${response.data.login}`);
|
||||||
|
@ -204,23 +208,31 @@ export function TPMIndexHOC(WrappedComponent) {
|
||||||
}).catch(error=>{})
|
}).catch(error=>{})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showCompeleteDialog=()=>{
|
||||||
|
this.setState({
|
||||||
|
showCP:true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let { isRender , current_user , giteaVisible , email } = this.state;
|
let { isRender , current_user , giteaVisible , email , completeProfile , showCP } = this.state;
|
||||||
const common = {
|
const common = {
|
||||||
showLoginDialog: this.showLoginDialog,
|
showLoginDialog: this.showLoginDialog,
|
||||||
checkIfLogin: this.checkIfLogin,
|
checkIfLogin: this.checkIfLogin,
|
||||||
resetUserInfo:this.fetchUsers
|
resetUserInfo:this.fetchUsers,
|
||||||
|
showCompeleteDialog:this.showCompeleteDialog
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div className="indexHOC">
|
<div className="indexHOC">
|
||||||
<EducoderAccount visible={giteaVisible} email={email} onOk={this.onOk}/>
|
<EducoderAccount visible={giteaVisible} email={email} onOk={this.onOk}/>
|
||||||
|
<ProfileModal visible={!completeProfile && showCP}/>
|
||||||
{isRender === true ? <LoginDialog
|
{isRender === true ? <LoginDialog
|
||||||
Modifyloginvalue={() => this.hideLoginDialog()}
|
Modifyloginvalue={() => this.hideLoginDialog()}
|
||||||
{...this.props}
|
{...this.props}
|
||||||
{...this.state}
|
{...this.state}
|
||||||
/> : ""}
|
/> : ""}
|
||||||
<Header {...this.state} {...this.props}></Header>
|
<Header {...this.state} {...this.props} {...common}></Header>
|
||||||
<Spin spinning={this.state.globalLoading} delay={0} className="globalSpin"
|
<Spin spinning={this.state.globalLoading} delay={0} className="globalSpin"
|
||||||
size="large" tip={this._gLoadingTip || "加载中..."}
|
size="large" tip={this._gLoadingTip || "加载中..."}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue