فهرست منبع

一期集成页面支持部分答题后继续作答 提交答案方法与嵌入页面交互

natasha 5 ساعت پیش
والد
کامیت
7bf1ac3605
1فایلهای تغییر یافته به همراه11 افزوده شده و 1 حذف شده
  1. 11 1
      src/views/courseWare.vue

+ 11 - 1
src/views/courseWare.vue

@@ -118,6 +118,7 @@
         <template v-if="category == 'EEP'">
           <BookEep
             v-if="view_content && view_content.content && chapterId"
+            ref="previewEEP"
             :id="chapterId"
             :content="view_content.content"
             :content-group-row-list="view_content.content_group_row_list"
@@ -234,6 +235,7 @@ export default {
     },
   },
   async created() {
+    console.log("2026-12-04");
     const _this = this;
     if (_this.AccessToken) {
       const Mname = "login_control-ParseAccessToken";
@@ -250,8 +252,9 @@ export default {
     }
     if (_this.ViewMode === "Answer") {
       // 答题模式下 显示提交按钮 隐藏查看答案按钮
-      this.showSaveFlag = true;
+      // this.showSaveFlag = true;
       this.isAnswerItemShow = false;
+      this.getUserAnswer();
     } else if (_this.ViewMode === "Result") {
       this.isAnswerItemShow = false;
       this.TaskModel = "ANSWER";
@@ -267,6 +270,8 @@ export default {
       function (event) {
         if (event.data === "Selected") {
           _this.finishPreviewGroupIds();
+        } else if (event.data === "SubmitCourse" && _this.category === "NPC") {
+          _this.$refs.previewBook.submitUserAnswerNPC();
         }
       },
       false
@@ -379,6 +384,7 @@ export default {
             const _this = this;
             _this.context = null;
           }
+          this.loading = false;
           if (_this.ViewMode !== "Result") {
             this.loading = false;
           }
@@ -438,10 +444,12 @@ export default {
             this.loading = false;
             if (res.status === 1) {
               this.$message.success("提交成功");
+              window.parent.postMessage("RequestSuccess", "*");
             }
           })
           .catch(() => {
             this.loading = false;
+            window.parent.postMessage("RequestFail", "*");
           });
       } else {
         const AppID = this.AppID;
@@ -464,10 +472,12 @@ export default {
             this.loading = false;
             if (res.status === 1) {
               this.$message.success("提交成功");
+              window.parent.postMessage("RequestSuccess", "*");
             }
           })
           .catch(() => {
             this.loading = false;
+            window.parent.postMessage("RequestFail", "*");
           });
       }
     },