y595705120 3 kuukautta sitten
vanhempi
commit
84c23b3404

+ 0 - 1
src/containers/center/components/pay/IBuyCourse.vue

@@ -133,7 +133,6 @@
     },
     watch:{
       courseId(){
-        console.log("change", this.courseId)
         this.loadPayInfo();
       }
     },

+ 14 - 1
src/containers/center/play/components/iCourseInfo.vue

@@ -85,9 +85,20 @@
     },
     props: ['tpl', 'info', 'extraXs'],
     mounted(){
-      this.finishCount = (this.extraXs.index1) + (+this.extraXs.index2) + (+this.extraXs.index3) + (+this.extraXs.index4)||0
+      this.recalcXs()
+    },
+    watch:{
+      extraXs:{
+        handler(){
+          this.recalcXs()
+        },
+        deep:true
+      }
     },
     methods: {
+      recalcXs(){
+        this.finishCount = (this.extraXs.index1) + (+this.extraXs.index2) + (+this.extraXs.index3) + (+this.extraXs.index4)||0
+      },
       startExam() {
         if (this.tpl.isClosed == 1) {
           this.$message.errorMsg("课程已经关闭", 2)
@@ -96,9 +107,11 @@
         this.$emit("startExam", 0)
       },
       startExamTest() {
+        this.recalcXs()
         this.$emit("startExamTest")
       },
       printCert() {
+        this.recalcXs()
         this.$emit("printCert")
       },
       formatFinish() {

+ 5 - 1
src/containers/center/play/index.vue

@@ -78,7 +78,7 @@
 
         <el-dialog class="previewDialog" :visible.sync="testExamDalog"
           top="50px" width="1024px"
-          @close="testExamDalog=false">
+          @close="closeTestModel()">
           <ICourseAnswerTest :info="info" :extraXs="extraXs" @updateExtraXs="updateExtraXs" :groupId="tpl.testGroupId"> </ICourseAnswerTest>
         </el-dialog>
       </div>
@@ -305,6 +305,10 @@
       formatString(val){
         return ()=> val;
       },
+      closeTestModel(){
+        this.getData()
+        this.testExamDalog = false;
+      },
       getData() {
         let param = { courseId: this.courseId }
         httpServer("course.getCourse", param).then(res => {