dev_forum
杨树明 5 years ago
parent e2b8c69f1e
commit 7379af6d4d

@ -616,12 +616,12 @@ a.white-btn.use_scope-btn:hover{
border-radius: 10px; border-radius: 10px;
} }
.Navmodal .ant-modal-content .ant-modal-header{ .Navmodal .ant-modal-content .ant-modal-header{
border-radius: 10px 10px 0 0; /*border-radius: 10px 10px 0 0;*/
} }
.ant-modal-content{ .ant-modal-content{
-webkit-box-shadow: 0 4px 12px transparent !important; -webkit-box-shadow: 0 4px 12px transparent !important;
box-shadow: 0 4px 12px transparent !important; box-shadow: 0 4px 12px transparent !important;
border-radius: 10px !important; /*border-radius: 10px !important;*/
} }
.Navmodal .ant-modal-body{ .Navmodal .ant-modal-body{

@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'educoder';
import {Tooltip} from 'antd'; import {Tooltip,Modal,Icon,Spin,message} from 'antd';
import '../../paths/ShixunPaths.css'; import '../../paths/ShixunPaths.css';
import DetailCardsEditAndAdd from './DetailCardsEditAndAdd'; import DetailCardsEditAndAdd from './DetailCardsEditAndAdd';
import DetailCardsEditAndEdit from './DetailCardsEditAndEdit'; import DetailCardsEditAndEdit from './DetailCardsEditAndEdit';
@ -46,7 +46,8 @@ class DetailCards extends Component{
editbuttomtypeadd:false, editbuttomtypeadd:false,
showparagraph:false, showparagraph:false,
showparagraphkey:"", showparagraphkey:"",
showparagraphindex:"" showparagraphindex:"",
isSpin:false
} }
@ -192,27 +193,60 @@ class DetailCards extends Component{
} }
startgameid=(id)=>{ startgameid=(id)=>{
let url = "/shixuns/" + id + "/shixun_exec.json"; let url = "/shixuns/" + id + "/shixun_exec.json";
axios.get(url).then((response) => { axios.get(url).then((response) => {
if (response.data.status === -2) { if (response.data.status === -2) {
this.setState({ this.setState({
Modalstype:true,
Modalstopval:response.data.message, shixunsreplace:true,
hidestartshixunsreplacevalue:response.data.message+".json"
}) })
} else if (response.data.status === -1) { } else if (response.data.status === -1) {
console.log(response)
}else if(response.data.status===-3){ }else if(response.data.status===-3){
this.setState({ this.setState({
Modalstype:true, shixunsmessage:response.data.message,
Modalstopval:response.data.message, startshixunCombattype:true,
}) })
} else { } else {
window.location.href = "/tasks/" + response.data.game_identifier; window.location.href = "/tasks/" + response.data.game_identifier;
// window.location.href = path
// let path="/tasks/"+response.data.game_identifier; // let path="/tasks/"+response.data.game_identifier;
// this.props.history.push(path); // this.props.history.push(path);
} }
}).catch((error) => { }).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=()=>{ cardsModalcancel=()=>{
@ -252,6 +286,12 @@ class DetailCards extends Component{
showparagraph:false showparagraph:false
}) })
} }
hidestartshixunCombattype=()=>{
this.setState({
startshixunCombattype:false
})
}
render(){ render(){
let { pathCardsList, let { pathCardsList,
dropid, dropid,
@ -266,14 +306,14 @@ class DetailCards extends Component{
cardsModalsave, cardsModalsave,
cardsModalcancel, cardsModalcancel,
delecttype, delecttype,
editdelectid, hidestartshixunsreplacevalue,
editbuttomtype, editbuttomtype,
editbuttomtypeadd, editbuttomtypeadd,
showparagraph, showparagraph,
showparagraphkey, showparagraphkey,
showparagraphindex showparagraphindex
}=this.state; }=this.state;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return( return(
<div> <div>
<Modals <Modals
@ -284,6 +324,45 @@ class DetailCards extends Component{
modalSave={delecttype===true?this.delectpathCardseditfun:cardsModalsave} modalSave={delecttype===true?this.delectpathCardseditfun:cardsModalsave}
> >
</Modals> </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"> <div className="lesson-saved-list">
{ {
pathCardsList && pathCardsList.map((item,key)=>{ pathCardsList && pathCardsList.map((item,key)=>{

@ -156,7 +156,35 @@ class Challenges extends Component {
} }
} }
startgameid=(id)=>{
let url = "/shixuns/" + id + "/shixun_exec.json";
axios.get(url).then((response) => {
if (response.data.status === -2) {
this.setState({
shixunsreplace:true,
hidestartshixunsreplacevalue:response.data.message+".json"
})
} else if (response.data.status === -1) {
console.log(response)
}else if(response.data.status===-3){
this.setState({
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)=>{ hidestartshixunsreplace=(url)=>{
this.setState({ this.setState({
@ -167,7 +195,7 @@ class Challenges extends Component {
// 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);
message.success('重置成功,正在进入实训!'); message.success('重置成功,正在进入实训!');
this.startshixunCombat(response.data.shixun_identifier); this.startgameid(response.data.shixun_identifier);
this.setState({ this.setState({
shixunsreplace:false, shixunsreplace:false,
isSpin:false, isSpin:false,
@ -179,11 +207,7 @@ class Challenges extends Component {
).catch((error) => { ).catch((error) => {
}); });
this.setState({
startbtn:false,
shixunsreplace:false,
isSpin:false
})
} }
//编辑实训题目选择题 //编辑实训题目选择题

Loading…
Cancel
Save