|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
import {getImageUrl} from 'educoder';
|
|
|
|
|
import {Tooltip} from 'antd';
|
|
|
|
|
import {Tooltip,Modal,Icon,Spin,message} from 'antd';
|
|
|
|
|
import '../../paths/ShixunPaths.css';
|
|
|
|
|
import DetailCardsEditAndAdd from './DetailCardsEditAndAdd';
|
|
|
|
|
import DetailCardsEditAndEdit from './DetailCardsEditAndEdit';
|
|
|
|
@ -46,7 +46,8 @@ class DetailCards extends Component{
|
|
|
|
|
editbuttomtypeadd:false,
|
|
|
|
|
showparagraph:false,
|
|
|
|
|
showparagraphkey:"",
|
|
|
|
|
showparagraphindex:""
|
|
|
|
|
showparagraphindex:"",
|
|
|
|
|
isSpin:false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -192,27 +193,60 @@ class DetailCards extends Component{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
startgameid=(id)=>{
|
|
|
|
|
|
|
|
|
|
let url = "/shixuns/" + id + "/shixun_exec.json";
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
|
|
|
|
|
if (response.data.status === -2) {
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:true,
|
|
|
|
|
Modalstopval:response.data.message,
|
|
|
|
|
|
|
|
|
|
shixunsreplace:true,
|
|
|
|
|
hidestartshixunsreplacevalue:response.data.message+".json"
|
|
|
|
|
})
|
|
|
|
|
} else if (response.data.status === -1) {
|
|
|
|
|
console.log(response)
|
|
|
|
|
}else if(response.data.status===-3){
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:true,
|
|
|
|
|
Modalstopval:response.data.message,
|
|
|
|
|
shixunsmessage:response.data.message,
|
|
|
|
|
startshixunCombattype:true,
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
window.location.href = "/tasks/" + response.data.game_identifier;
|
|
|
|
|
// window.location.href = path
|
|
|
|
|
// let path="/tasks/"+response.data.game_identifier;
|
|
|
|
|
// this.props.history.push(path);
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hidestartshixunsreplace=(url)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:true,
|
|
|
|
|
})
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
debugger
|
|
|
|
|
if(response.status===200){
|
|
|
|
|
// let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
|
|
|
|
|
// this.props.history.push(path);
|
|
|
|
|
message.success('重置成功,正在进入实训!');
|
|
|
|
|
this.startgameid(response.data.shixun_identifier);
|
|
|
|
|
this.setState({
|
|
|
|
|
shixunsreplace:false,
|
|
|
|
|
isSpin:false,
|
|
|
|
|
startbtn:false,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// message.success('重置成功,正在进入实训!');
|
|
|
|
|
// this.startshixunCombat();
|
|
|
|
|
}}
|
|
|
|
|
).catch((error) => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cardsModalcancel=()=>{
|
|
|
|
@ -252,6 +286,12 @@ class DetailCards extends Component{
|
|
|
|
|
showparagraph:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hidestartshixunCombattype=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
startshixunCombattype:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
render(){
|
|
|
|
|
let { pathCardsList,
|
|
|
|
|
dropid,
|
|
|
|
@ -266,14 +306,14 @@ class DetailCards extends Component{
|
|
|
|
|
cardsModalsave,
|
|
|
|
|
cardsModalcancel,
|
|
|
|
|
delecttype,
|
|
|
|
|
editdelectid,
|
|
|
|
|
hidestartshixunsreplacevalue,
|
|
|
|
|
editbuttomtype,
|
|
|
|
|
editbuttomtypeadd,
|
|
|
|
|
showparagraph,
|
|
|
|
|
showparagraphkey,
|
|
|
|
|
showparagraphindex
|
|
|
|
|
}=this.state;
|
|
|
|
|
|
|
|
|
|
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
|
|
|
|
|
return(
|
|
|
|
|
<div>
|
|
|
|
|
<Modals
|
|
|
|
@ -284,6 +324,45 @@ class DetailCards extends Component{
|
|
|
|
|
modalSave={delecttype===true?this.delectpathCardseditfun:cardsModalsave}
|
|
|
|
|
>
|
|
|
|
|
</Modals>
|
|
|
|
|
<Modal
|
|
|
|
|
keyboard={false}
|
|
|
|
|
title="提示"
|
|
|
|
|
visible={this.state.startshixunCombattype}
|
|
|
|
|
closable={false}
|
|
|
|
|
footer={null}
|
|
|
|
|
>
|
|
|
|
|
<div className="task-popup-content">
|
|
|
|
|
<p className="task-popup-text-center font-16 pb20">本实训的开启时间:{this.state.shixunsmessage} <br/>开启时间之前不能挑战 </p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="task-popup-submit clearfix">
|
|
|
|
|
{/*<a onClick={this.hidestartshixunCombattype} className="task-btn fl">取消</a>*/}
|
|
|
|
|
<a className="task-btn task-btn-orange fr"
|
|
|
|
|
style={{marginRight:'51px'}}
|
|
|
|
|
onClick={this.hidestartshixunCombattype}>知道了</a>
|
|
|
|
|
</div>
|
|
|
|
|
{/*<p className="inviteTipbtn with100 fl">*/}
|
|
|
|
|
{/*<a onClick={this.hidestartshixunCombattype}>知道了</a>*/}
|
|
|
|
|
{/*</p>*/}
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
<Modal
|
|
|
|
|
keyboard={false}
|
|
|
|
|
title="提示"
|
|
|
|
|
visible={this.state.shixunsreplace}
|
|
|
|
|
closable={false}
|
|
|
|
|
footer={null}
|
|
|
|
|
>
|
|
|
|
|
<Spin indicator={antIcon} spinning={this.state.isSpin}>
|
|
|
|
|
<div className="task-popup-content">
|
|
|
|
|
<p className="task-popup-text-center font-16 pb20">实训已经更新了,正在为您重置!</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="task-popup-submit clearfix">
|
|
|
|
|
<a className="task-btn task-btn-orange fr"
|
|
|
|
|
style={{marginRight:'51px'}}
|
|
|
|
|
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
|
|
|
|
|
</div>
|
|
|
|
|
</Spin>
|
|
|
|
|
</Modal>
|
|
|
|
|
<div className="lesson-saved-list">
|
|
|
|
|
{
|
|
|
|
|
pathCardsList && pathCardsList.map((item,key)=>{
|
|
|
|
|