杨树林 6 years ago
commit 9b7feb29da

@ -17,7 +17,16 @@ class EvaluateSuccessEffectDisplay extends Component {
} }
componentDidMount() { componentDidMount() {
if (this.props.type == 'html') {
const iframe = document.getElementById('_displayIframe')
if (iframe && iframe.contentWindow) {
iframe.contentWindow.open()
iframe.contentWindow.document.write(this.props.iframe_src);
iframe.contentWindow.document.close();
} else {
console.error('not mounted')
}
}
} }
hidepicture = () => { hidepicture = () => {
window.$('#picture_display').hide(); window.$('#picture_display').hide();
@ -26,7 +35,7 @@ class EvaluateSuccessEffectDisplay extends Component {
// qrcode // qrcode
// const type = 'image' // 'qrcode' // const type = 'image' // 'qrcode'
const { type, qrcode_str, const { type, qrcode_str,
answer_picture, orignal_picture, user_picture } = this.props; answer_picture, orignal_picture, user_picture, contents } = this.props;
if (type == 'qrcode') { if (type == 'qrcode') {
// 单张图片比如安卓评测完显示qrcode // 单张图片比如安卓评测完显示qrcode
return ( return (
@ -69,12 +78,16 @@ class EvaluateSuccessEffectDisplay extends Component {
if (type == "txt") { if (type == "txt") {
return ( return (
<div className="task-popup-content clearfix"> <div className="task-popup-content clearfix">
<div className="with49" style={{margin: '0 auto'}}> <div className="with80" style={{margin: '0 auto'}}>
<p className="color-blue font-18 mb20 edu-txt-center">实际输出</p> <p className="color-blue font-18 mb20 edu-txt-center">实际输出</p>
<textarea className="output-txt" readonly="" defaultValue={content}></textarea> <textarea className="output-txt" readonly="" defaultValue={contents}></textarea>
</div> </div>
</div> </div>
) )
} else if (type == "html") {
return (
<iframe id="_displayIframe"></iframe>
)
} }
/* <div className="with49 fr"> /* <div className="with49 fr">
@ -95,12 +108,17 @@ class EvaluateSuccessEffectDisplay extends Component {
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
iframe#_displayIframe {
width: 100%;
height: 100%;
}
`} `}
</style> </style>
<div className="photo_display"> <div className="photo_display">
<div className="task-popup"> <div className="task-popup">
<div className="task-popup-title clearfix"> <div className="task-popup-title clearfix">
<h3 className="fl color-grey3">查看效果</h3> <h3 className="fl color-grey3 mt4">查看效果</h3>
<a href="javascript:void(0);" onClick={this.hidepicture} <a href="javascript:void(0);" onClick={this.hidepicture}
data-tip-left="关闭查看效果" className="pop_close fr"> data-tip-left="关闭查看效果" className="pop_close fr">
<i className="fa fa-times-circle font-18 link-color-grey mt5"></i> <i className="fa fa-times-circle font-18 link-color-grey mt5"></i>

@ -397,8 +397,13 @@ pop_box_new(htmlvalue, 480, 182);
let game = resData.game; let game = resData.game;
game.prev_game = resData.prev_game; game.prev_game = resData.prev_game;
game.next_game = resData.next_game; game.next_game = resData.next_game;
if (game.status == 2) {
// 已通关
game.isPassThrough = true
}
resData.game = game; resData.game = game;
const { tpm_cases_modified, tpm_modified, tpm_script_modified, myshixun } = resData; const { tpm_cases_modified, tpm_modified, tpm_script_modified, myshixun } = resData;
if (myshixun.system_tip) { if (myshixun.system_tip) {
// system_tip为true的时候 不弹框提示用户更新 // system_tip为true的时候 不弹框提示用户更新
@ -576,6 +581,7 @@ pop_box_new(htmlvalue, 480, 182);
let currentGamePassed = false let currentGamePassed = false
if (challenge_chooses_count === choose_correct_num) { if (challenge_chooses_count === choose_correct_num) {
game.status = 2; game.status = 2;
game.isPassThrough = true
game.next_game = next_game; game.next_game = next_game;
currentGamePassed = true; currentGamePassed = true;
@ -728,6 +734,7 @@ pop_box_new(htmlvalue, 480, 182);
compileSuccess && this.language_display(response); compileSuccess && this.language_display(response);
if (currentGamePassed) { if (currentGamePassed) {
game.status = 2; game.status = 2;
game.isPassThrough = true
game.next_game = next_game; game.next_game = next_game;
} else { } else {
this.showDialog({ this.showDialog({

@ -152,7 +152,7 @@ class TaskResultLayer extends Component {
this.goNext = false; this.goNext = false;
return <Redirect push to={`/tasks/${next_game}`} />; return <Redirect push to={`/tasks/${next_game}`} />;
} }
if (shixun.status <= 1) { // 模拟实战 if (shixun.status <= 1 || game.isPassThrough == true) { // 模拟实战
game.star = 8; // 跳过评星 game.star = 8; // 跳过评星
} }

Loading…
Cancel
Save