|
|
@ -174,43 +174,48 @@ class Challenges extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//开始实战按钮
|
|
|
|
//开始实战按钮
|
|
|
|
startshixunCombat = (type, ids, path) => {
|
|
|
|
startshixunCombat = (type, ids, path) => {
|
|
|
|
let { ChallengesDataList } = this.state;
|
|
|
|
let { ChallengesDataList } = this.state;
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
if(path===null){
|
|
|
|
if (type > 3 || type === false) {
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
startbtns: true
|
|
|
|
startbtns: true
|
|
|
|
})
|
|
|
|
})
|
|
|
|
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) {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
startbtns:false,
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
|
|
|
startbtns:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} 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) => {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
startbtns: false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
if (type > 4 || type === false) {
|
|
|
|
|
|
|
|
window.location.href = path;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
window.location.href = "/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + ids + path;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (response.data.status === -2) {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
startbtns:false,
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
|
|
|
startbtns:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} 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) => {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
startbtns: false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
window.location.href = "/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + ids + path;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
hidestartshixunCombattype=()=>{
|
|
|
|
hidestartshixunCombattype=()=>{
|
|
|
|