增加全局完善资料弹窗

dev_forum
杨树明 5 years ago
parent f85663c1e0
commit 05b741652d

@ -18,6 +18,9 @@ import Notcompletedysl from './modules/user/Notcompletedysl';
import Trialapplicationysl from './modules/login/Trialapplicationysl'; import Trialapplicationysl from './modules/login/Trialapplicationysl';
import Trialapplicationreview from './modules/user/Trialapplicationreview'; import Trialapplicationreview from './modules/user/Trialapplicationreview';
import Addcourses from "./modules/courses/coursesPublic/Addcourses"; import Addcourses from "./modules/courses/coursesPublic/Addcourses";
import AccountProfile from"./modules/user/AccountProfile";
import Trialapplication from './modules/login/Trialapplication' import Trialapplication from './modules/login/Trialapplication'
import NotFoundPage from './NotFoundPage' import NotFoundPage from './NotFoundPage'
@ -278,6 +281,7 @@ class App extends Component {
<Trialapplicationysl {...this.props} {...this.state}></Trialapplicationysl> <Trialapplicationysl {...this.props} {...this.state}></Trialapplicationysl>
<Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview> <Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview>
<Addcourses {...this.props} {...this.state}/> <Addcourses {...this.props} {...this.state}/>
<AccountProfile {...this.props} {...this.state}/>
{/*{*/} {/*{*/}
{/* isRender === true?*/} {/* isRender === true?*/}
{/* <LoginDialog></LoginDialog> : ""*/} {/* <LoginDialog></LoginDialog> : ""*/}

@ -38,7 +38,6 @@ class Addcourses extends Component{
} }
return response; return response;
}, (error) => { }, (error) => {
//TODO 这里如果样式变了会出现css不加载的情况
}); });

@ -1560,9 +1560,28 @@ input.ant-input-number-input:focus {
border-radius: 5px; border-radius: 5px;
} }
.ant-modal-wrap{ @media screen and (min-width: 1400px) {
overflow: hidden; .ant-modal-wrap{
overflow: hidden;
}
}
/* 设置了浏览器宽度不小于1201px时 abc 显示1200px宽度 */
@media screen and (max-width: 1400px) {
}
/* 设置了浏览器宽度不大于1200px时 abc 显示900px宽度 */
@media screen and (max-width: 900px) {
}
/* 设置了浏览器宽度不大于900px时 abc 显示200px宽度 */
@media screen and (max-width: 500px) {
} }
/* 设置了浏览器宽度不大于500px时 abc 显示100px宽度 */
/* 试卷答题 */ /* 试卷答题 */
.stageTable .ant-table-tbody tr:last-child td,.stageTable .ant-table-thead > tr > th{ .stageTable .ant-table-tbody tr:last-child td,.stageTable .ant-table-thead > tr > th{

@ -466,7 +466,7 @@ class DetailCardsEditAndAdd extends Component{
<span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span> <span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
<span>个实训</span> <span>个实训</span>
</span> </span>
<div className="fr search-new"> <div className="fr search-new mb0">
<Search <Search
placeholder="请输入创建者或者实训名称进行搜索" placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput} onInput={this.searchNameInput}

@ -499,7 +499,7 @@ class DetailCardsEditAndEdit extends Component{
<span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span> <span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
<span>个实训</span> <span>个实训</span>
</span> </span>
<div className="fr search-new"> <div className="fr search-new mb0">
<Search <Search
placeholder="请输入创建者或者实训名称进行搜索" placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput} onInput={this.searchNameInput}

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import AccountProfile from"../user/AccountProfile";
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
// import searchImg from '../../../../images/educoder/icon/search.svg' // import searchImg from '../../../../images/educoder/icon/search.svg'
@ -527,24 +527,36 @@ submittojoinclass=(value)=>{
} }
//头部获取是否已经登录了 //头部获取是否已经登录了
getUser=(url)=>{ getUser=(url)=>{
console.log("点击了503") // console.log("点击了503")
console.log(url); // console.log(url);
let{user} =this.state; let{user} =this.state;
if(user===undefined){ if(user===undefined){
this.setState({ this.setState({
isRender:true isRender:true
}) })
return return
} }
if(user&&user.login===""){ if(user&&user.login===""){
this.setState({ this.setState({
isRender:true isRender:true
}) })
return; return;
} }
if(user&&user.profile_completed===false){
this.setState({
AccountProfiletype:true
})
return;
}
if(url !== undefined || url!==""){ if(url !== undefined || url!==""){
window.location.href = url; window.location.href = url;
} }
} }
//修改登录方法 //修改登录方法
@ -554,6 +566,12 @@ submittojoinclass=(value)=>{
}) })
} }
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render() { render() {
const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。 const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。
const {match ,} = this.props; const {match ,} = this.props;
@ -568,7 +586,7 @@ submittojoinclass=(value)=>{
Checkboxteachingtype, Checkboxteachingtype,
code_notice, code_notice,
checked_notice, checked_notice,
RadioGroupvalue, AccountProfiletype,
submitapplications, submitapplications,
submitapplicationsvalue, submitapplicationsvalue,
user, user,
@ -610,6 +628,12 @@ submittojoinclass=(value)=>{
{...this.props} {...this.props}
/>:""} />:""}
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
<div className="educontent clearfix"> <div className="educontent clearfix">
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} {/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
<a href="/"> <a href="/">

@ -8,6 +8,8 @@ import PropTypes from 'prop-types';
import {Modal,Input,Radio,Pagination,message,Spin,Icon,Tooltip} from 'antd'; import {Modal,Input,Radio,Pagination,message,Spin,Icon,Tooltip} from 'antd';
import AccountProfile from"../user/AccountProfile";
import 'antd/lib/pagination/style/index.css'; import 'antd/lib/pagination/style/index.css';
import axios from 'axios' import axios from 'axios'
@ -381,6 +383,14 @@ class TPMBanner extends Component {
//开始实战按钮 //开始实战按钮
startshixunCombat=(id, reset)=>{ startshixunCombat=(id, reset)=>{
if(this.props.current_user&&this.props.current_user.profile_completed===false){
this.setState({
AccountProfiletype:true
})
return
}
let {shixunsDetails} = this.props let {shixunsDetails} = this.props
if( shixunsDetails.shixun_status>1){ if( shixunsDetails.shixun_status>1){
this.setState({ this.setState({
@ -455,7 +465,11 @@ class TPMBanner extends Component {
}) })
} }
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render() { render() {
let { let {
@ -480,7 +494,7 @@ class TPMBanner extends Component {
shixunsreplace, shixunsreplace,
hidestartshixunsreplacevalue, hidestartshixunsreplacevalue,
Forkvisibletype, Forkvisibletype,
Senttothevcaluetype, AccountProfiletype,
isIE} = this.state; isIE} = this.state;
let {shixunsDetails, shixunId, star_info, star_infos} = this.props; let {shixunsDetails, shixunId, star_info, star_infos} = this.props;
let challengeBtnTipText = ''; let challengeBtnTipText = '';
@ -555,6 +569,13 @@ class TPMBanner extends Component {
<div> <div>
<div className="shixunDetail_top"> <div className="shixunDetail_top">
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
{this.state.Modalstype===true?<Modals {this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype} modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval} modalsTopval={this.state.Modalstopval}

@ -20,6 +20,8 @@ import '../shixunchildCss/Challenges.css'
import axios from 'axios'; import axios from 'axios';
import AccountProfile from"../../../user/AccountProfile";
const $ = window.$; const $ = window.$;
class Challenges extends Component { class Challenges extends Component {
@ -218,7 +220,14 @@ class Challenges extends Component {
//开始实战按钮 //开始实战按钮
startshixunCombat = (type, ids, id) => { startshixunCombat = (type, ids, id) => {
if(this.props.current_user&&this.props.current_user.profile_completed===false){
this.setState({
AccountProfiletype:true
})
return
}
debugger
let { ChallengesDataList } = this.state; let { ChallengesDataList } = this.state;
// let id = this.props.match.params.shixunId; // let id = this.props.match.params.shixunId;
this.setState({ this.setState({
@ -271,8 +280,15 @@ class Challenges extends Component {
startshixunCombattype:false startshixunCombattype:false
}) })
} }
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render() { render() {
let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue} = this.state; let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue,AccountProfiletype} = this.state;
let { loadingContent } = this.props; let { loadingContent } = this.props;
if (ChallengesDataList != undefined) { if (ChallengesDataList != undefined) {
this.updatamakedown("ReactMarkdown") this.updatamakedown("ReactMarkdown")
@ -281,6 +297,12 @@ class Challenges extends Component {
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />; const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return ( return (
<React.Fragment> <React.Fragment>
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
{loadingContent ? {loadingContent ?
<CircularProgress size={40} thickness={3} style={{ <CircularProgress size={40} thickness={3} style={{
marginLeft: 'auto', marginLeft: 'auto',

@ -0,0 +1,74 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import {Modal} from 'antd';
import axios from 'axios';
class AccountProfile extends Component {
constructor(props) {
super(props);
this.state = {
AccountProfiletype:false
}
}
componentDidMount() {
if(this.props.AccountProfiletype!=undefined){
this.setState({
AccountProfiletype:this.props.AccountProfiletype
})
}
axios.interceptors.response.use((response) => {
if (response != undefined)
if (response && response.data.status === 402) {
this.setState({
AccountProfiletype: true
})
}
return response;
}, (error) => {
});
}
gotoback=()=>{
if(this.props.AccountProfiletype!=undefined){
this.setState({
AccountProfiletype:false
})
this.props.hideAccountProfile()
}else{
window.location.href="/";
this.setState({
AccountProfiletype:false
})
}
}
render() {
return(
<Modal
keyboard={false}
title="提示"
visible={this.state.AccountProfiletype}
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/profile/edit"}>立即完善</a>
</div>
</div>
</Modal>
)
}
}
export default AccountProfile;
Loading…
Cancel
Save