lsc 2 years ago
parent
commit
e049d565dc
2 changed files with 10 additions and 6 deletions
  1. 1 1
      src/views/course/components/commentPanel.vue
  2. 9 5
      src/views/course/index.vue

+ 1 - 1
src/views/course/components/commentPanel.vue

@@ -105,7 +105,7 @@ export default {
   position: fixed;
   top: 0;
   background: #fff;
-
+  z-index: 2;
   .cp-title {
     height: 1.5rem;
     width: 100%;

+ 9 - 5
src/views/course/index.vue

@@ -28,7 +28,7 @@
           </div>
         </div>
         <steps-box
-          v-if="type == 1"
+          v-show="type == 1"
           :courseDetail="courseDetail"
           :chapInfo="chapInfo"
           :courseType="courseType"
@@ -38,10 +38,11 @@
           :oid="oid"
         ></steps-box>
         <comment-box
-          v-if="type == 2"
+          v-show="type == 2"
           :courseid="courseid"
           :courseType="courseType"
           :taskCount="taskCount"
+          ref="comment"
         ></comment-box>
       </div>
       <div class="courseNavIcon">
@@ -146,18 +147,21 @@ export default {
     },
     setType(type) {
       this.type = type
+      if (type === 2) {
+        this.$refs['comment'].panelVisible = true
+      }
     },
     navCheck() {
       this.navVisible = true
     },
     nextOrpreSteps(t) {
       this.$refs.navbox.nextOrpreSteps(t)
-      var a = this.$refs["cBox"];
-      a.scrollTop = 0;
+      var a = this.$refs['cBox']
+      a.scrollTop = 0
     },
     back() {
       // eslint-disable-next-line prettier/prettier
-      this.$router.push({ path: '/courseDetail', query: { courseid: this.courseid } })
+      this.$router.push({ path: '/courseDetail', query: { courseid: this.courseid }})
     }
   },
   created() {