|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import React,{ Component } from "react";
|
|
|
|
|
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form,Icon,message,Progress} from "antd";
|
|
|
|
|
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form,Icon,message,Progress,notification} from "antd";
|
|
|
|
|
import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder';
|
|
|
|
|
import './myelearning.css'
|
|
|
|
|
import axios from 'axios';
|
|
|
|
@ -95,46 +95,63 @@ class Elearning extends Component{
|
|
|
|
|
}else {
|
|
|
|
|
let {stages}=this.state;
|
|
|
|
|
if(stages.length>0){
|
|
|
|
|
var stagesdatas=[];
|
|
|
|
|
for(var i=0;i<stages.length;i++){
|
|
|
|
|
if(i===0){
|
|
|
|
|
var id=stages[0].shixuns_list[0].identifier;
|
|
|
|
|
let url = "/shixuns/" + id + "/shixun_exec.json";
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
|
|
|
|
|
if (response.data.status === -2) {
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
|
|
shixunsreplaces:true,
|
|
|
|
|
hidestartshixunsreplacevalues:response.data.message+".json"
|
|
|
|
|
})
|
|
|
|
|
} else if (response.data.status === -1) {
|
|
|
|
|
console.log(response)
|
|
|
|
|
}else if(response.data.status===-3){
|
|
|
|
|
this.setState({
|
|
|
|
|
shixunsmessages:response.data.message,
|
|
|
|
|
startshixunCombattypes:true,
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
console.log("开始学习了");
|
|
|
|
|
window.open("/tasks/" + response.data.game_identifier,'_blank');
|
|
|
|
|
//这个是传过来 调用刷新
|
|
|
|
|
this.Myreload();
|
|
|
|
|
// window.location.href = path
|
|
|
|
|
// let path="/tasks/"+response.data.game_identifier;
|
|
|
|
|
// this.props.history.push(path);
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
console.log("这是"+i);
|
|
|
|
|
for(var ki=0;ki<stages[i].shixuns_list.length;ki++){
|
|
|
|
|
if(stages[i].shixuns_list[ki].shixun_status !=="暂未公开"){
|
|
|
|
|
var id=stages[i].shixuns_list[ki].identifier;
|
|
|
|
|
console.log(id);
|
|
|
|
|
stagesdatas.push(id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log(stagesdatas[0]);
|
|
|
|
|
if(stagesdatas.length>0){
|
|
|
|
|
this.kaishishixun(stagesdatas[0]);
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
notification.open({
|
|
|
|
|
message:"提示",
|
|
|
|
|
description: "实训暂未公开!"
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
console.log("这是"+i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
kaishishixun=(id)=>{
|
|
|
|
|
let url = "/shixuns/" + id + "/shixun_exec.json";
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
console.log("精品课堂开发学习");
|
|
|
|
|
console.log(response);
|
|
|
|
|
console.log(JSON.stringify(response));
|
|
|
|
|
debugger
|
|
|
|
|
if (response.data.status === -2) {
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
|
|
shixunsreplaces:true,
|
|
|
|
|
hidestartshixunsreplacevalues:response.data.message+".json"
|
|
|
|
|
})
|
|
|
|
|
} else if (response.data.status === -1) {
|
|
|
|
|
console.log(response)
|
|
|
|
|
}else if(response.data.status===-3){
|
|
|
|
|
this.setState({
|
|
|
|
|
shixunsmessages:response.data.message,
|
|
|
|
|
startshixunCombattypes:true,
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
console.log("开始学习了");
|
|
|
|
|
window.open("/tasks/" + response.data.game_identifier,'_blank');
|
|
|
|
|
//这个是传过来 调用刷新
|
|
|
|
|
this.Myreload();
|
|
|
|
|
// window.location.href = path
|
|
|
|
|
// let path="/tasks/"+response.data.game_identifier;
|
|
|
|
|
// this.props.history.push(path);
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Startlearningtwo=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|