Bladeren bron

只有首页能看视频

taiji_caozhaorui 3 weken geleden
bovenliggende
commit
b7d7661459

+ 1 - 1
src/views/study/home/index.vue

@@ -35,7 +35,7 @@
                     @click="
                       $router.push({
                         name: item.subject + 'plan',
-                        query: { isVideo: true, planId: item.planId },
+                        query: { showVideo: true, planId: item.planId },
                       })
                     "
                   >

+ 0 - 1
src/views/study/subject/question/index.vue

@@ -203,7 +203,6 @@ const initTree = () => {
         })
       }
       state.tree.data = deep(data)
-      console.log(state.tree.data)
     })
     .finally(() => {
       state.tree.loading = false

+ 2 - 1
src/views/study/subject/question/list.vue

@@ -32,7 +32,7 @@
             </div>
           </template>
           <!-- 视频解析列表 -->
-          <div v-if="item.questionVideos?.length > 0">
+          <div v-if="showVideo && item.questionVideos?.length > 0">
             <div class="mb-2 text-sm font-medium text-gray-800">视频解析:</div>
             <ul class="space-y-2">
               <template v-for="video in item.questionVideos">
@@ -126,6 +126,7 @@ import { ElMessage } from 'element-plus'
 
 const props = defineProps({
   data: { default: () => [] },
+  showVideo: { default: false },
 })
 const state: any = reactive({
   history: {

+ 5 - 1
src/views/study/subject/question/plan.vue

@@ -31,7 +31,7 @@
           v-loading="state.question.loading"
         >
           <template v-if="state.question.data?.length > 0">
-            <listCom :data="state.question.data" />
+            <listCom :data="state.question.data" :showVideo="state.showVideo" />
             <!-- 分页控件 -->
             <div class="mt-6 flex justify-center">
               <div class="q-pa-lg flex-center flex">
@@ -81,6 +81,7 @@ const state: any = reactive({
     page: 1,
     size: 10,
   },
+  showVideo: false,
 })
 const initQuestion = () => {
   state.question.loading = true
@@ -102,6 +103,9 @@ const dataCpt = computed(() => {
   )
 })
 onMounted(() => {
+  if (route.query.showVideo) {
+    state.showVideo = route.query.showVideo
+  }
   initQuestion()
 })
 onBeforeMount(() => {