ソースを参照

添加点击阶段跳转,与评课刷新样式问题

11wqe1 1 年間 前
コミット
8d7919d2df

+ 2 - 2
src/views/course/components/commentBox.vue

@@ -38,9 +38,9 @@
       <img src="@/assets/images/course/noPz.png" alt="" />
     </div>
 
-    <div class="commentInput" @click="setPanelVisible(true)">
+    <!-- <div class="commentInput" @click="setPanelVisible(true)">
       <div class="input">点击发一条评课内容</div>
-    </div>
+    </div> -->
     <commentPanel
       @setPanelVisible="setPanelVisible"
       :panelVisible="panelVisible"

+ 15 - 4
src/views/course/index.vue

@@ -12,7 +12,11 @@
       </template>
     </head-bar>
     <div class="course-box" ref="cBox">
-      <van-pull-refresh v-model="isLoading" @refresh="onRefresh" :disabled="panelVisible || answerPanelVisible || askPanelVisible">
+      <van-pull-refresh
+        v-model="isLoading"
+        @refresh="onRefresh"
+        :disabled="panelVisible || answerPanelVisible || askPanelVisible"
+      >
         <course-title :chapInfo="chapInfo" :courseType="courseType" :taskCount="taskCount"></course-title>
         <course-content-list v-if="false"></course-content-list>
         <div class="course-type-box">
@@ -118,8 +122,8 @@ export default {
       isLoading: false,
       panelVisible: false,
       answerPanelVisible: false,
-      askPanelVisible:false,
-      choosePanelVisible:false
+      askPanelVisible: false,
+      choosePanelVisible: false
     }
   },
   methods: {
@@ -179,13 +183,20 @@ export default {
     },
     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 } })
     },
     onRefresh() {
       this.getCourse()
     }
   },
   created() {
+    if (this.$route.query.stage) {
+      this.courseType = this.$route.query.stage * 1
+      sessionStorage.setItem('stage', this.courseType)
+    } else {
+      this.courseType = sessionStorage.getItem('stage') * 1
+    }
+
     this.getCourse()
   }
 }

+ 3 - 3
src/views/courseDetail/components/courseChap.vue

@@ -8,7 +8,7 @@
       {{ brief ? brief : '暂无详情' }}
     </div>
     <div v-if="isStep == 0" class="courseJdBox">
-      <div class="blue_box_one" v-for="(item, index) in chInfo" :key="index" @click="goCourse">
+      <div class="blue_box_one" v-for="(item, index) in chInfo" :key="index" @click="goCourse(index)">
         <div>第{{ index + 1 }}阶段</div>
         <div :title="item.dyName">{{ item.dyName }}</div>
         <div>{{ item.chapterInfo[0].taskJson.length }}个任务</div>
@@ -34,8 +34,8 @@ export default {
     }
   },
   methods: {
-    goCourse() {
-      this.$emit('goCourse')
+    goCourse(val) {
+      this.$emit('goCourse', val)
     }
   }
 }

+ 8 - 3
src/views/courseDetail/index.vue

@@ -19,7 +19,7 @@
         :cJson="courseTypeJson"
         :tName="Tname"
       ></course-message>
-      <course-chap :chInfo="chapInfo" :brief="courseDetail.brief" @goCourse="goToStudy"></course-chap>
+      <course-chap :chInfo="chapInfo" :brief="courseDetail.brief" @goCourse="goToStage"></course-chap>
     </div>
     <div class="studyCss">
       <div style="stuButton" @click="goToStudy">点击学习</div>
@@ -54,9 +54,12 @@ export default {
     back() {
       this.$router.push({ path: '/home' })
     },
+    goToStage(val) {
+      this.$router.push({ path: '/course', query: { courseid: this.courseid, stage: val } })
+    },
     goToStudy() {
       // eslint-disable-next-line object-curly-spacing
-      this.$router.push({ path: '/course', query: { courseid: this.courseid } })
+      this.$router.push({ path: '/course', query: { courseid: this.courseid, stage: 0 } })
     },
     getCourse() {
       const params = {
@@ -94,6 +97,7 @@ export default {
     }
   },
   created() {
+
     console.log('type', this.$route.query)
     if (this.$route.query.urlType) {
       sessionStorage.setItem('urlType', this.$route.query.urlType)
@@ -101,13 +105,14 @@ export default {
 
     this.routeType = sessionStorage.getItem('urlType')
     if (this.routeType == 1) {
+    // 跳转到登录界面之后,不让其回退。就直接添加下面这段代码即可实现
       history.pushState(null, null, document.URL)
       window.addEventListener('popstate', function() {
         history.pushState(null, null, document.URL)
       })
     }
-    // 跳转到登录界面之后,不让其回退。就直接添加下面这段代码即可实现
   },
+ 
   mounted() {
     this.getCourse()
   }