dev_admin
hjm 6 years ago
parent eefaf77b5f
commit 90136595f2

@ -59,4 +59,6 @@ export function toPath(path) {
}
// export default queryString
export function getTaskUrlById(id) {
return `/tasks/${id}`
}

@ -3,7 +3,8 @@ import { from } from '_array-flatten@2.1.2@array-flatten';
// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil';
export { getImageUrl as getImageUrl, getUrl as getUrl, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth } from './UrlTool';
, getUploadActionUrl as getUploadActionUrl, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById } from './UrlTool';
export { default as queryString } from './UrlTool2';
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';

@ -1,6 +1,6 @@
import React,{ Component } from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import { WordsBtn } from 'educoder';
import { WordsBtn, getTaskUrlById } from 'educoder';
import {Tooltip,message,Modal} from 'antd';
import {Link} from 'react-router-dom';
import axios from 'axios';
@ -56,7 +56,7 @@ class ShixunhomeWorkItem extends Component{
startbtn:true,
})
let url= list+".json";
const w=window.open('about:blank');
// const w=window.open('about:blank');
axios.get(url).then((response) => {
if(response.status===200){
@ -66,7 +66,7 @@ class ShixunhomeWorkItem extends Component{
shixunsreplace:true,
hidestartshixunsreplacevalue:response.data.message+".json"
})
w.close()
// w.close()
}else if(response.data.status===-1){
console.log(response)
}else if(response.data.status===-3){
@ -75,11 +75,15 @@ class ShixunhomeWorkItem extends Component{
startshixunCombattype:true,
startbtn:false
})
w.close()
// w.close()
}else{
if(response.data.status!=401&&response.data.status!=403){
w.location.href= "/tasks/"+response.data.game_identifier
}
this.setState({
startbtn:false
})
// if(response.data.status!=401&&response.data.status!=403){
// w.location.href= "/tasks/"+response.data.game_identifier
// }
window.location.href = "/tasks/"+response.data.game_identifier
}
}
@ -87,7 +91,7 @@ class ShixunhomeWorkItem extends Component{
this.setState({
startbtn:false
})
w.close()
// w.close()
});
@ -389,9 +393,15 @@ class ShixunhomeWorkItem extends Component{
{this.props.isStudent===true?this.props.course_identity===5?
<WordsBtn style="blue" className="colorblue font-16 mr20 fr mt10">
{startbtn===false?<a className="btn colorblue" onClick={()=>this.taskoperationId(discussMessage.task_operation[1])}>
{discussMessage.task_operation[0]}
</a>:<a className="btn colorblue" ></a>}
{startbtn===false?
(discussMessage.task_operation[0] == '继续挑战' || discussMessage.task_operation[0] == '查看实战' ?
<a className="btn colorblue" href={getTaskUrlById(discussMessage.task_operation[1])}>
{discussMessage.task_operation[0]}
</a>
:
<a className="btn colorblue" onClick={()=>this.taskoperationId(discussMessage.task_operation[1])}>
{discussMessage.task_operation[0]}
</a>):<a className="btn colorblue" ></a>}
</WordsBtn>:"":""
}

Loading…
Cancel
Save