From 71bf733632f8f150e3c32d336e8a6605b809e604 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 18 Jul 2019 09:27:11 +0800 Subject: [PATCH 1/3] html --- .../context/EvaluateSuccessEffectDisplay.js | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/public/react/src/context/EvaluateSuccessEffectDisplay.js b/public/react/src/context/EvaluateSuccessEffectDisplay.js index f09b6d2f2..7ce321bc2 100644 --- a/public/react/src/context/EvaluateSuccessEffectDisplay.js +++ b/public/react/src/context/EvaluateSuccessEffectDisplay.js @@ -17,7 +17,16 @@ class EvaluateSuccessEffectDisplay extends Component { } 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 = () => { window.$('#picture_display').hide(); @@ -26,7 +35,7 @@ class EvaluateSuccessEffectDisplay extends Component { // qrcode // const type = 'image' // 'qrcode' const { type, qrcode_str, - answer_picture, orignal_picture, user_picture } = this.props; + answer_picture, orignal_picture, user_picture, contents } = this.props; if (type == 'qrcode') { // 单张图片,比如安卓评测完显示qrcode return ( @@ -71,10 +80,14 @@ class EvaluateSuccessEffectDisplay extends Component {

实际输出

- +
) + } else if (type == "html") { + return ( + + ) } /*
@@ -95,12 +108,17 @@ class EvaluateSuccessEffectDisplay extends Component { height: 100%; box-sizing: border-box; } + + iframe#_displayIframe { + width: 100%; + height: 100%; + } `}
-

查看效果

+

查看效果

From 7fd82dce44e8592fcac2699c524d58e498d60aea Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 18 Jul 2019 09:27:45 +0800 Subject: [PATCH 2/3] with80 --- public/react/src/context/EvaluateSuccessEffectDisplay.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/context/EvaluateSuccessEffectDisplay.js b/public/react/src/context/EvaluateSuccessEffectDisplay.js index 7ce321bc2..4d283928b 100644 --- a/public/react/src/context/EvaluateSuccessEffectDisplay.js +++ b/public/react/src/context/EvaluateSuccessEffectDisplay.js @@ -78,7 +78,7 @@ class EvaluateSuccessEffectDisplay extends Component { if (type == "txt") { return (
-
+

实际输出

From d0ede265c6446bd44d2d9fc5ed3e650447a48815 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 18 Jul 2019 10:14:16 +0800 Subject: [PATCH 3/3] isPassThrough --- public/react/src/context/TPIContextProvider.js | 7 +++++++ public/react/src/modules/page/layers/TaskResultLayer.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/public/react/src/context/TPIContextProvider.js b/public/react/src/context/TPIContextProvider.js index 4874906d8..e49c6d9d6 100644 --- a/public/react/src/context/TPIContextProvider.js +++ b/public/react/src/context/TPIContextProvider.js @@ -397,7 +397,12 @@ pop_box_new(htmlvalue, 480, 182); let game = resData.game; game.prev_game = resData.prev_game; game.next_game = resData.next_game; + if (game.status == 2) { + // 已通关 + game.isPassThrough = true + } resData.game = game; + const { tpm_cases_modified, tpm_modified, tpm_script_modified, myshixun } = resData; if (myshixun.system_tip) { @@ -576,6 +581,7 @@ pop_box_new(htmlvalue, 480, 182); let currentGamePassed = false if (challenge_chooses_count === choose_correct_num) { game.status = 2; + game.isPassThrough = true game.next_game = next_game; currentGamePassed = true; @@ -728,6 +734,7 @@ pop_box_new(htmlvalue, 480, 182); compileSuccess && this.language_display(response); if (currentGamePassed) { game.status = 2; + game.isPassThrough = true game.next_game = next_game; } else { this.showDialog({ diff --git a/public/react/src/modules/page/layers/TaskResultLayer.js b/public/react/src/modules/page/layers/TaskResultLayer.js index 8b4bde838..7c8e6b6d9 100644 --- a/public/react/src/modules/page/layers/TaskResultLayer.js +++ b/public/react/src/modules/page/layers/TaskResultLayer.js @@ -152,7 +152,7 @@ class TaskResultLayer extends Component { this.goNext = false; return ; } - if (shixun.status <= 1) { // 模拟实战 + if (shixun.status <= 1 || game.isPassThrough == true) { // 模拟实战 game.star = 8; // 跳过评星 }