dev_forum
杨树明 6 years ago
parent 09d5e802e8
commit c71bb0a58a

File diff suppressed because it is too large Load Diff

@ -1,163 +1,163 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { WordsBtn } from 'educoder'; import { WordsBtn } from 'educoder';
import {Tooltip,message,Modal} from 'antd'; import {Tooltip,message,Modal} from 'antd';
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
class Startshixuntask extends Component{ class Startshixuntask extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state = { this.state = {
startbtn:false startbtn:false
} }
} }
componentDidMount() { componentDidMount() {
} }
taskoperationId=(list)=>{ taskoperationId=(list)=>{
this.setState({ this.setState({
startbtn:true, startbtn:true,
}) })
let url= list+".json"; let url= list+".json";
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response.status===200){ if(response.status===200){
if(response.data.status===-2){ if(response.data.status===-2){
this.setState({ this.setState({
startbtn:false, startbtn:false,
shixunsreplace:true, shixunsreplace:true,
hidestartshixunsreplacevalue:response.data.message+".json" hidestartshixunsreplacevalue:response.data.message+".json"
}) })
}else if(response.data.status===-1){ }else if(response.data.status===-1){
console.log(response) console.log(response)
}else if(response.data.status===-3){ }else if(response.data.status===-3){
this.setState({ this.setState({
shixunsmessage:response.data.message, shixunsmessage:response.data.message,
startshixunCombattype:true, startshixunCombattype:true,
startbtn:false startbtn:false
}) })
}else{ }else{
if(response.data.status!=401&&response.data.status!=403){ if(response.data.status!=401&&response.data.status!=403){
window.location.href = "/tasks/"+response.data.game_identifier; window.location.href = "/tasks/"+response.data.game_identifier;
} }
} }
} }
}).catch((error) => { }).catch((error) => {
this.setState({ this.setState({
startbtn:false startbtn:false
}) })
}); });
} }
hidestartshixunsreplace=(url)=>{ hidestartshixunsreplace=(url)=>{
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response.status===200){ if(response.status===200){
this.setState({ this.setState({
shixunsreplace:false shixunsreplace:false
}) })
message.success('重置成功,正在进入实训!'); message.success('重置成功,正在进入实训!');
let path="/shixuns/"+response.data.shixun_identifier+"/challenges"; let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
this.props.history.push(path); this.props.history.push(path);
}} }}
).catch((error) => { ).catch((error) => {
this.setState({ this.setState({
startbtn:false, startbtn:false,
shixunsreplace:false shixunsreplace:false
}) })
}); });
} }
hidestartshixunCombattype=()=>{ hidestartshixunCombattype=()=>{
this.setState({ this.setState({
startshixunCombattype:false startshixunCombattype:false
}) })
} }
render(){ render(){
let { let {
Modalstype, Modalstype,
Modalstopval, Modalstopval,
Modalsbottomval, Modalsbottomval,
cardsModalcancel, cardsModalcancel,
cardsModalsavetype, cardsModalsavetype,
loadtype, loadtype,
shixunsreplace, shixunsreplace,
hidestartshixunsreplacevalue, hidestartshixunsreplacevalue,
startshixunCombattype, startshixunCombattype,
shixunsmessage, shixunsmessage,
startbtn startbtn
} = this.state; } = this.state;
return( return(
<a className="fr color-blue font-16" > <a className="fr color-blue font-16" >
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
modalsTopval={Modalstopval} modalsTopval={Modalstopval}
modalsBottomval={Modalsbottomval} modalsBottomval={Modalsbottomval}
modalCancel={cardsModalcancel} modalCancel={cardsModalcancel}
modalSave={cardsModalsavetype} modalSave={cardsModalsavetype}
loadtype={loadtype} loadtype={loadtype}
/> />
<Modal <Modal
title="提示" title="提示"
visible={shixunsreplace} visible={shixunsreplace}
closable={false} closable={false}
footer={null} footer={null}
keyboard={false} keyboard={false}
> >
<div className="task-popup-content"> <div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p> <p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p>
</div> </div>
<div className="task-popup-submit clearfix"> <div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr mr51" <a className="task-btn task-btn-orange fr mr51"
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a> onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div> </div>
</Modal> </Modal>
<Modal <Modal
title="提示" title="提示"
visible={startshixunCombattype} visible={startshixunCombattype}
closable={false} closable={false}
footer={null} footer={null}
keyboard={false} keyboard={false}
> >
<div className="task-popup-content"> <div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">本实训的开启时间{shixunsmessage} <br/>开启时间之前不能挑战 <p className="task-popup-text-center font-16 pb20">本实训的开启时间{shixunsmessage} <br/>开启时间之前不能挑战
</p> </p>
</div> </div>
<div className="task-popup-submit clearfix"> <div className="task-popup-submit clearfix">
{/*<a onClick={this.hidestartshixunCombattype} className="task-btn fl">取消</a>*/} {/*<a onClick={this.hidestartshixunCombattype} className="task-btn fl">取消</a>*/}
<a className="task-btn task-btn-orange fr mr51" onClick={this.hidestartshixunCombattype}>知道啦</a> <a className="task-btn task-btn-orange fr mr51" onClick={this.hidestartshixunCombattype}>知道啦</a>
</div> </div>
{/*<p className="inviteTipbtn with100 fl">*/} {/*<p className="inviteTipbtn with100 fl">*/}
{/*<a onClick={this.hidestartshixunCombattype}>知道了</a>*/} {/*<a onClick={this.hidestartshixunCombattype}>知道了</a>*/}
{/*</p>*/} {/*</p>*/}
</Modal> </Modal>
{this.props.isStudent? {this.props.isStudent?
<span> <span>
{this.props.data.task_operation&&this.props.data.task_operation?startbtn===false?<span onClick={()=>this.taskoperationId( this.props.data.task_operation[1])}> {this.props.data.task_operation&&this.props.data.task_operation?startbtn===false?<span onClick={()=>this.taskoperationId( this.props.data.task_operation[1])}>
{this.props.data.task_operation[0]} {this.props.data.task_operation[0]}
</span>:"":""} </span>:"":""}
</span>:"" </span>:""
} }
</a> </a>
) )
} }
} }
export default Startshixuntask; export default Startshixuntask;

@ -210,7 +210,7 @@ class ShixunhomeWorkItem extends Component{
</div> </div>
<div className="task-popup-submit clearfix"> <div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr mr51" <a className="task-btn task-btn-orange fr mr51"
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a> onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div> </div>
</Modal> </Modal>
<Modal <Modal

File diff suppressed because it is too large Load Diff

@ -529,7 +529,7 @@ class Challenges extends Component {
<p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p> <p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p>
</div> </div>
<div className="task-popup-submit clearfix"> <div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr mr51" onClick={()=>this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a> <a className="task-btn task-btn-orange fr mr51" onClick={()=>this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div> </div>
</Modal> </Modal>
</div> </div>

Loading…
Cancel
Save