Browse Source

修改样式显示功能

zengyicheng 2 years ago
parent
commit
222acaf6e0
2 changed files with 75 additions and 23 deletions
  1. 47 9
      src/components/study.vue
  2. 28 14
      src/components/studyStudent.vue

+ 47 - 9
src/components/study.vue

@@ -328,7 +328,9 @@
                           class="vedioTimeBox"
                           v-for="(media, vedioIndex) in vedio[jdIndex][rwIndex]"
                           :key="vedioIndex + '1'"
-                          @click="lookVedio(media.url, jdIndex, rwIndex,vedioIndex)"
+                          @click="
+                            lookVedio(media.url, jdIndex, rwIndex, vedioIndex)
+                          "
                         >
                           <div
                             class="media"
@@ -353,7 +355,17 @@
                               {{ vedioTime[jdIndex][rwIndex][vedioIndex] }}
                             </div> -->
                           </div>
-                          <div class="vedioName" :class="isClickNavOne[jdIndex][rwIndex][vedioIndex] == vedioIndex ? 'isClickNavOne' : '' ">{{ media.name }}</div>
+                          <div
+                            class="vedioName"
+                            :class="
+                              isClickNavOne[jdIndex][rwIndex][vedioIndex] ==
+                              'video' + vedioIndex
+                                ? 'isClickNavOne'
+                                : ''
+                            "
+                          >
+                            {{ media.name }}
+                          </div>
                         </div>
                       </div>
                       <div
@@ -381,7 +393,15 @@
                           文档
                         </div> -->
                         <div style="width: calc(100% - 115px)">
-                          <div class="navText" :class="isClickNavOne[jdIndex][rwIndex][textIndex] == textIndex ? 'isClickNavOne' : ''">
+                          <div
+                            class="navText"
+                            :class="
+                              isClickNavOne[jdIndex][rwIndex][textIndex] ==
+                              'text' + textIndex
+                                ? 'isClickNavOne'
+                                : ''
+                            "
+                          >
                             {{
                               textList[jdIndex][rwIndex].length > 0
                                 ? text.name
@@ -449,7 +469,15 @@
                           文档
                         </div> -->
                         <div style="width: calc(100% - 115px)">
-                          <div class="navText" :class="isClickNavOne[jdIndex][rwIndex][fileIndex] == fileIndex ? 'isClickNavOne' : ''">
+                          <div
+                            class="navText"
+                            :class="
+                              isClickNavOne[jdIndex][rwIndex][fileIndex] ==
+                              'word' + fileIndex
+                                ? 'isClickNavOne'
+                                : ''
+                            "
+                          >
                             {{ f.name }}
                           </div>
                         </div>
@@ -2185,7 +2213,7 @@ export default {
       answerDialogVisible: false,
       timeDialogVisible: false,
       radio: [],
-      isClickNavOne:[],
+      isClickNavOne: [],
       isAsk: false,
       askJson: {
         askCount: 1,
@@ -3107,6 +3135,7 @@ export default {
                       ) {
                         this.showType[i][j] = 3;
                         this.pptImgUrl1[i][j] = _url;
+                        this.isClickNavOne[i][j][0] = "word0";
                       } else if (
                         this.isAssetTypeAnImage(
                           _url
@@ -3116,15 +3145,18 @@ export default {
                       ) {
                         this.showType[i][j] = 4;
                         this.pptImgUrl1[i][j] = _url;
+                        this.isClickNavOne[i][j][0] = "word0";
                       } else {
                         this.showType[i][j] = 2;
                         this.pptImgUrl1[i][j] =
                           "https://view.officeapps.live.com/op/view.aspx?src=" +
                           _url;
+                        this.isClickNavOne[i][j][0] = "word0";
                       }
                     } else if (f[j].chapterData[0].type == 6) {
                       this.showType[i][j] = 1;
                       this.text = this.textList[i][j][0];
+                      this.isClickNavOne[i][j][0] = "text0";
                     }
                   } else {
                     for (var y = 0; y < f[j].chapterData.length; y++) {
@@ -3140,6 +3172,7 @@ export default {
                           ) {
                             this.showType[i][j] = 3;
                             this.pptImgUrl1[i][j] = _url;
+                            this.isClickNavOne[i][j][0] = "word0";
                           } else if (
                             this.isAssetTypeAnImage(
                               _url
@@ -3149,20 +3182,25 @@ export default {
                           ) {
                             this.showType[i][j] = 4;
                             this.pptImgUrl1[i][j] = _url;
+                            this.isClickNavOne[i][j][0] = "word0";
                           } else {
                             this.showType[i][j] = 2;
                             this.pptImgUrl1[i][j] =
                               "https://view.officeapps.live.com/op/view.aspx?src=" +
                               _url;
+                            this.isClickNavOne[i][j][0] = "word0";
                           }
                         } else if (f[j].chapterData[y].type == 6) {
                           this.showType[i][j] = 1;
                           this.text = this.textList[i][j][0];
+                          this.isClickNavOne[i][j][0] = "text0";
                         }
                       }
                     }
                   }
                 }
+              } else {
+                this.isClickNavOne[i][j][0] = "video0";
               }
             }
           }
@@ -3268,20 +3306,20 @@ export default {
     //   this.playerO = this.playerOptions;
     // },
     // onPlayerPlay() {},
-    lookVedio(u, i, j,v) {
+    lookVedio(u, i, j, v) {
       this.isClickNavOne[i][j] = [];
       var e = JSON.parse(JSON.stringify(this.playerOptions));
       e.sources[0].src = u;
       this.playerO[i][j] = e;
       this.showType[i][j] = 0;
-      this.isClickNavOne[i][j][v] = v;
+      this.isClickNavOne[i][j][v] = "video" + v;
     },
     lookText(i, j, t) {
       this.isClickNavOne[i][j] = [];
       // this.textList[i][j][t] = this.textList[i][j][t];
       // this.dialogVisible1 = true;
       this.showType[i][j] = 1;
-      this.isClickNavOne[i][j][t] = t;
+      this.isClickNavOne[i][j][t] = "text" + t;
     },
     lookTools(i, t) {
       this.chapTools = this.chapToolList[i][t];
@@ -3336,7 +3374,7 @@ export default {
       } else {
         window.open(this.file[i].url);
       }
-      this.isClickNavOne[j][k][i] = i;
+      this.isClickNavOne[j][k][i] = "word" + i;
     },
     downFileList(i) {
       window.open(this.noImgList[i].url);

+ 28 - 14
src/components/studyStudent.vue

@@ -275,7 +275,7 @@
                   <div
                     class="wheel"
                     v-if="showType == 2"
-                    style="height: 520px; width: 95%; margin: 0 auto"
+                    style="height: 800px; width: 95%; margin: 0 auto"
                   >
                     <iframe
                       style="width: 100%; height: 100%; border: none"
@@ -285,7 +285,7 @@
                   <div
                     class="wheel"
                     v-if="showType == 3"
-                    style="height: 520px; width: 95%; margin: 0 auto"
+                    style="height: 800px; width: 95%; margin: 0 auto"
                   >
                     <!-- <iframe
                       style="width: 100%; height: 100%; border: none"
@@ -299,7 +299,7 @@
                   <div
                     class="wheel"
                     v-if="showType == 4"
-                    style="height: 520px; width: 95%; margin: 0 auto"
+                    style="height: 800px; width: 95%; margin: 0 auto"
                   >
                     <el-image
                       :src="pptImgUrl1"
@@ -387,7 +387,11 @@
                         </div>
                         <div
                           class="vedioName"
-                          :class="isClickNav == vedioIndex ? 'isClickNav' : ''"
+                          :class="
+                            isClickNav == 'video' + vedioIndex
+                              ? 'isClickNav'
+                              : ''
+                          "
                         >
                           {{ media.name }}
                         </div>
@@ -417,10 +421,12 @@
                       >
                         文档
                       </div> -->
-                      <div style="width: calc(100% - 115px)">
+                      <div style="width: calc(100% - 0px)">
                         <div
                           class="navText"
-                          :class="isClickNav == textIndex ? 'isClickNav' : ''"
+                          :class="
+                            isClickNav == 'text' + textIndex ? 'isClickNav' : ''
+                          "
                         >
                           {{
                             textList[taskCount].length > 0 ? text.name : ""
@@ -474,7 +480,7 @@
                       >
                         链接
                       </div> -->
-                      <div style="width: calc(100% - 115px)">
+                      <div style="width: calc(100% - 0px)">
                         <div
                           class="navText"
                           :class="isClickNav == lineIndex ? 'isClickNav' : ''"
@@ -511,10 +517,12 @@
                       >
                         文档
                       </div> -->
-                      <div style="width: calc(100% - 115px)">
+                      <div style="width: calc(100% - 0px)">
                         <div
                           class="navText"
-                          :class="isClickNav == fileIndex ? 'isClickNav' : ''"
+                          :class="
+                            isClickNav == 'word' + fileIndex ? 'isClickNav' : ''
+                          "
                         >
                           {{ f.name }}
                         </div>
@@ -2818,8 +2826,8 @@ export default {
             this.checkJson[i] = [];
             for (var j = 0; j < b.length; j++) {
               var likesCount = 0;
-            var commentCount = 0;
-            var isLikes = false;
+              var commentCount = 0;
+              var isLikes = false;
               var data = b[j];
               if (i == b[j].tool) {
                 if (data.type == 2 && a[i].tool[0] == 4) {
@@ -3440,6 +3448,7 @@ export default {
                   ) {
                     this.showType = 3;
                     this.pptImgUrl1 = _url;
+                    this.isClickNav = "word0";
                   } else if (
                     this.isAssetTypeAnImage(
                       _url
@@ -3449,11 +3458,13 @@ export default {
                   ) {
                     this.showType = 4;
                     this.pptImgUrl1 = _url;
+                    this.isClickNav = "word0";
                   } else {
                     this.showType = 2;
                     this.pptImgUrl1 =
                       "https://view.officeapps.live.com/op/view.aspx?src=" +
                       _url;
+                    this.isClickNav = "word0";
                   }
                 } else if (
                   this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
@@ -3462,6 +3473,7 @@ export default {
                 ) {
                   this.showType = 1;
                   this.text = this.textList[this.taskCount][0];
+                  this.isClickNav = "text0";
                 }
               } else {
                 for (
@@ -3518,6 +3530,8 @@ export default {
                 }
               }
             }
+          } else {
+            this.isClickNav = "video0";
           }
           setTimeout(() => {
             this.checkEva();
@@ -3639,7 +3653,7 @@ export default {
       d.sources[0].src = u;
       this.playerO[this.taskCount] = d;
       this.showType = 0;
-      this.isClickNav = i;
+      this.isClickNav = "video" + i;
       this.$forceUpdate();
     },
     lookText(i, t) {
@@ -3647,7 +3661,7 @@ export default {
       this.text = this.textList[i][t];
       // this.dialogVisible1 = true;
       this.showType = 1;
-      this.isClickNav = t;
+      this.isClickNav = "text" + t;
     },
     lookTools(i, t) {
       this.chapTools = this.chapToolList[i][t];
@@ -3702,7 +3716,7 @@ export default {
       } else {
         window.open(this.file[i].url);
       }
-      this.isClickNav = i;
+      this.isClickNav = "word" + i;
     },
     downFileList(i) {
       window.open(this.noImgList[i].url);