Selaa lähdekoodia

update:更新得分问题

DESKTOP-HI4L4AH\Administrator 4 kuukautta sitten
vanhempi
commit
767dc2fadb
2 muutettua tiedostoa jossa 18 lisäystä ja 3 poistoa
  1. 17 2
      src/views/course/courses.vue
  2. 1 1
      src/views/login.vue

+ 17 - 2
src/views/course/courses.vue

@@ -267,6 +267,7 @@ export default {
   },
 
   mounted() {
+    this.setStepModel()
     this.getCourseList()
     this.getLearnList()
     this.getGradeList()
@@ -649,9 +650,7 @@ export default {
       this.currentCourse.checked = false
       this.currentCourse = c
       this.currentCourse.checked = true
-
       getStepModel().then(resp=>{
-
         if(resp.status == 200) {
             let res = resp.data
             if(res.code == 1) {
@@ -666,6 +665,22 @@ export default {
          this.getGoalInfoByCourse(this.currentCourse.id)
       })
     },
+    setStepModel(){
+      getStepModel().then(resp=>{
+        if(resp.status == 200) {
+          let res = resp.data
+          if(res.code == 1) {
+            let stepModels = res.data.dataList
+            for(let n =0 ;n<stepModels.length;n++) {
+              let m = stepModels[n]
+              this.stepscore[m.name] = m.score
+            }
+          }
+        }
+      }).finally(d=>{
+        this.getGoalInfoByCourse(this.currentCourse.id)
+      })
+    },
 
     getCourseList() {
       this.loading = true

+ 1 - 1
src/views/login.vue

@@ -77,7 +77,7 @@
                   duration:1000,
                 })
                 setTimeout(() =>{
-                  this.$router.push('/home')
+                  this.$router.push('/courses')
                 }, 1000)
               })
           }