dev_tj
杨树明 5 years ago
parent 72cea08939
commit 6f610eebd2

@ -14,6 +14,7 @@ import passpartImg from '../../../images/tpi/passpart.png'
import empiricgreenImg from '../../../images/tpi/empiricgreen.png'
import { trigger } from 'educoder';
import SecondTab from "../../paths/SchoolStatistics/SecondTab";
class TaskResultLayer extends Component {
@ -29,7 +30,7 @@ class TaskResultLayer extends Component {
}
componentWillReceiveProps(newProps, newContext) {
if (newProps.currentGamePassed && (!this.props.currentGamePassed
if (newProps.currentGamePassed && (!this.props.currentGamePassed
|| (newProps.currentGamePassed !== this.props.currentGamePassed ))) {
// this.fakeRanking = this._fakeRanking()
const $ = window.$;
@ -51,10 +52,10 @@ class TaskResultLayer extends Component {
}
}
}
onStarChange(challenge, index, value) {
this.props.onStarChange(challenge, index, value);
this.setState({
stared: value ? true : false,
})
@ -87,11 +88,11 @@ class TaskResultLayer extends Component {
// this.context.router.push('/sample');
if (goNext === true) {
if (next_game) { // https://www.trustie.net/issues/18573
this.goNext = true;
this.goNext = true;
}
// 隐藏掉效果查看页面
window.$('#picture_display').hide()
}
}
this.props.onGamePassed();
this.setState({
stared: false
@ -110,9 +111,9 @@ class TaskResultLayer extends Component {
// return;
// }
// const { showLanguagePictrue } = this.props.challenge;
// if ( prevProps.challenge.showLanguagePictrue != showLanguagePictrue &&
// if ( prevProps.challenge.showLanguagePictrue != showLanguagePictrue &&
// showLanguagePictrue == true ) {
// }
// }
initEffectDisplayServerTimer = () => {
@ -128,7 +129,7 @@ class TaskResultLayer extends Component {
this.setState({ timeRemain })
}, 1000)
})
}
componentWillUnmount() {
this.intervalHandler && clearInterval(this.intervalHandler);
@ -162,7 +163,7 @@ class TaskResultLayer extends Component {
// const fakeRanking = this.fakeRanking;
return (
<div>
{currentGamePassed ?
{currentGamePassed ?
<div className="taskResultLayer">
<div className="pr passTaskContent" style={{display:'none'}} >
<i className="far fa-times-circle closeIcon" onClick={closeTaskResultLayer} title="关闭"></i>
@ -174,52 +175,60 @@ class TaskResultLayer extends Component {
<p className="inline inlines exp">
<img src={empiricgreenImg} className="mr8 mt5 fl"/>
{currentPassedGameGainExperience >= 0 ? `+${currentPassedGameGainExperience}` : '+0'}
</p>
</p>
</div>
<div className="winPanel">
<style>
{
`
.page--body{
z-index: 0 !important;
}
`
}
</style>
<div className="cl"></div>
{ !game.star ?
{ !game.star ?
<React.Fragment>
<p className="rateLabel ">您的评价决定老师的江湖地位~</p>
<Rate
defaultValue={0}
allowClear={false}
onChange={(value) => this.onStarChange(this.props.game, this.props.challenge.position, value)}
/>
/>
</React.Fragment>
: ''}
<p>
<p>
{/*<a href="javascript:void(0)" className="passNext">下一关</a>*/}
<a href="javascript:void(0)" className={`passed ${ stared || game.star ? 'stared' : '' }`}
{...titleObj} onClick={()=>this.onFinish(true)}>{ next_game ? '下一关' : '完成'}</a>
{ challenge.showLanguagePictrue &&
{ challenge.showLanguagePictrue &&
<a href="javascript:void(0)" className={`passed ${ stared || game.star ? 'stared' : '' }`}
{...titleObj} onClick={()=>this.onFinish()}>
{ `查看效果` }
{/* ${ moment(this.state.timeRemain * 1000).format('mm:ss') } */}
</a>
}
{/*
(this.state.timeRemain ?
{/*
(this.state.timeRemain ?
<Tooltip title={"注意效果查看服务只会保留5分钟"} disableFocusListener={true}>
</Tooltip>
</Tooltip>
:
<Tooltip title={"效果查看服务已被终止运行,需要重新评测后才能查看"} disableFocusListener={true}>
<a href="javascript:void(0)" className={`passed ${ stared || game.star ? 'stared' : '' }`}
{...titleObj} onClick={()=>{}} style={{ backgroundColor: 'gray'}}>
{ `查看效果` }
</a>
</Tooltip>
</Tooltip>
)
*/}
{/*
{/*
注意效果查看服务只会保留5分钟
效果查看服务已被终止运行需要重新评测后才能查看
*/}

Loading…
Cancel
Save