lex-xin 3 năm trước cách đây
mục cha
commit
673db131af
2 tập tin đã thay đổi với 42 bổ sung37 xóa
  1. 5 1
      src/views/audition/ArrangeWork.vue
  2. 37 36
      src/views/audition/CourseEvaluation.vue

+ 5 - 1
src/views/audition/ArrangeWork.vue

@@ -76,6 +76,7 @@ import MHeader from "@/components/MHeader"
 import { browser, _throttle }  from '@/common/common'
 import dayjs from "dayjs";
 import { addHomeWork } from '@/api/audition'
+import { getCourseStudents } from '@/api/teacher'
 import AccompanimentModal from './modal/accompanimentModal'
 import cleanDeep from 'clean-deep'
 export default {
@@ -108,7 +109,7 @@ export default {
       tabActive: 'changDi'
     };
   },
-  mounted() {
+  async mounted() {
     let params = this.$route.query;
     if (params.Authorization) {
       localStorage.setItem("Authorization", decodeURI(params.Authorization));
@@ -118,6 +119,9 @@ export default {
     if(browser().android || browser().iPhone) {
       this.headerStatus = false
     }
+    await getCourseStudents({ courseScheduleId: this.courseId }).then(res => {
+      console.log(res)
+    })
   },
   methods: {
     formatter(type, val) {

+ 37 - 36
src/views/audition/CourseEvaluation.vue

@@ -162,8 +162,7 @@ import {
   courseReviewAdd,
   getReviewInfo,
   updateReviewInfo,
-  checkeIsAssignHomework,
-  getCourseStudents
+  checkeIsAssignHomework
 } from "@/api/teacher";
 import { browser } from "@/common/common";
 import MHeader from "@/components/MHeader";
@@ -198,7 +197,7 @@ export default {
       memberStatus: 0, // 是否有学生或者乐团是会员
     };
   },
-  created() {
+  async mounted() {
     let params = this.$route.query;
     if (params.Authorization) {
       localStorage.setItem("Authorization", decodeURI(params.Authorization));
@@ -210,16 +209,26 @@ export default {
     if (!this.courseId) {
       this.$toast("课程信息错误");
     }
-  },
-  async mounted() {
-    let params = this.$route.query;
-    if (params.Authorization) {
-      localStorage.setItem("Authorization", decodeURI(params.Authorization));
-      localStorage.setItem("userInfo", decodeURI(params.Authorization));
-    }
     if (browser().android || browser().iPhone) {
       this.headerStatus = false;
     }
+
+    await checkeIsAssignHomework({ courseScheduleId: this.courseId }).then((res) => {
+      let result = res.data;
+      if (result.code == 200) {
+        let tempData = result.data || {}
+        this.isAssignHomework = tempData.isAssignHomework;
+        this.enableAssignHomework = tempData.enableAssignHomework;
+        const memberNum = tempData.memberNum;
+        const courseStudentNum = tempData.courseStudentNum;
+        if(courseStudentNum == memberNum) {
+          this.memberStatus = 1
+        }
+      } else {
+        this.$toast(result.msg);
+      }
+    });
+
     // 获取头部信息
     if (this.reviewId) {
       // 获取老评价
@@ -270,32 +279,24 @@ export default {
           this.classType = result.courseScheduleType;
         }
       });
-    }
-    await checkeIsAssignHomework({ courseScheduleId: this.courseId }).then((res) => {
-      let result = res.data;
-      if (result.code == 200) {
-        let tempData = result.data || {}
-        this.isAssignHomework = tempData.isAssignHomework;
-        this.enableAssignHomework = tempData.enableAssignHomework;
-        // const courseViewType = tempData.courseViewType || 0;
-        const memberNum = tempData.memberNum;
-        const courseStudentNum = tempData.courseStudentNum;
-        if(courseStudentNum == memberNum) {
-          this.memberStatus = 1
-        }
-      } else {
-        this.$toast(result.msg);
-      }
-    });
-
-    await getCourseStudents({ courseScheduleId: this.courseId }).then(res => {
-      console.log(res)
-    })
 
-    let courseEvaluationObj = sessionStorage.getItem('courseEvaluationObj')
-    courseEvaluationObj = courseEvaluationObj ? JSON.parse(courseEvaluationObj) : null
-    // if()
-    // console.log(courseEvaluationObj)
+      // 只有添加的时候才会有缓存数据
+      let courseEvaluationObj = sessionStorage.getItem('courseEvaluationObj')
+      courseEvaluationObj = courseEvaluationObj ? JSON.parse(courseEvaluationObj) : null
+      sessionStorage.removeItem('courseEvaluationObj')
+      if(courseEvaluationObj) {
+        this.teachingMaterial = courseEvaluationObj.teachingMaterial
+        this.song = courseEvaluationObj.song
+        this.pronunciation = courseEvaluationObj.pronunciation
+        this.tempo = courseEvaluationObj.tempo
+        this.musicTheory = courseEvaluationObj.musicTheory
+        this.memo = courseEvaluationObj.memo
+        this.hasLiaison = courseEvaluationObj.hasLiaison
+        this.handHomework = courseEvaluationObj.handHomework
+        this.courseId = courseEvaluationObj.courseId
+      }
+      // console.log(courseEvaluationObj)
+    }
   },
   methods: {
     submitReview() {
@@ -462,7 +463,7 @@ export default {
 /deep/.van-field__control,
 /deep/.van-cell__value {
   font-size: 16px;
-  color: #666;
+  color: #1A1A1A !important;
   width: 70%;
   flex: auto;
 }