guanchunjie il y a 3 ans
Parent
commit
7afbc6a7a4

+ 14 - 0
src/components/Adult/inputModules/ArticleTemChs/index.vue

@@ -51,6 +51,16 @@
         :handleMp3Base64="handleChange"
       />
     </div>
+    <div class="adult-book-input-item">
+      <span class="adult-book-lable">功能配置:</span>
+      <div class="adult-book-main" v-if="curQue.checkList">
+        <el-checkbox-group v-model="curQue.checkList">
+          <el-checkbox :label="1">显示生词功能</el-checkbox>
+          <el-checkbox :label="2">语音练习模式</el-checkbox>
+          <el-checkbox :label="3">取词功能</el-checkbox>
+        </el-checkbox-group>
+      </div>
+    </div>
     <div class="NPC-Book-article">
       <ArticleChs
         :curQue="curQue"
@@ -172,6 +182,7 @@ export default {
         taskId: "",
       },
       isWordTime: false,
+      checkList: [1, 2, 3],
     };
   },
   computed: {},
@@ -377,6 +388,9 @@ export default {
     console.log("文章编辑");
     console.log(this.curQue);
     if (this.curQue) {
+      if (!this.curQue.hasOwnProperty("checkList")) {
+        this.$set(this.curQue, "checkList", [1, 2, 3]);
+      }
       if (!this.curQue.taskId) {
         this.curQue.taskId = "";
       }

+ 9 - 9
src/components/Adult/inputModules/DialogueArticleChs/index.vue

@@ -61,14 +61,14 @@
         :handleMp3Base64="handleChange"
       />
     </div>
-     <div class="adult-book-input-item">
+    <div class="adult-book-input-item">
       <span class="adult-book-lable">功能配置:</span>
       <div class="adult-book-main" v-if="curQue.checkList">
-      <el-checkbox-group v-model="curQue.checkList">
-        <el-checkbox :label="1">显示生词功能</el-checkbox>
-        <el-checkbox :label="2">语音练习模式</el-checkbox>
-        <el-checkbox :label="3">取词功能</el-checkbox>
-      </el-checkbox-group>
+        <el-checkbox-group v-model="curQue.checkList">
+          <el-checkbox :label="1">显示生词功能</el-checkbox>
+          <el-checkbox :label="2">语音练习模式</el-checkbox>
+          <el-checkbox :label="3">取词功能</el-checkbox>
+        </el-checkbox-group>
       </div>
     </div>
     <div class="adult-book-input-item">
@@ -280,7 +280,7 @@ export default {
         detail: [],
         wordTime: [],
         taskId: "",
-        checkList:[]
+        checkList: [1, 2, 3],
       },
       isWordTime: false,
     };
@@ -533,8 +533,8 @@ export default {
       if (!this.curQue.notice) {
         this.curQue.notice = "";
       }
-      if(!this.curQue.checkList){
-        this.$set(this.curQue,'checkList',[1,2,3])
+      if (!this.curQue.checkList) {
+        this.$set(this.curQue, "checkList", [1, 2, 3]);
       }
       if (this.curQue.detail && this.curQue.detail.length > 0) {
         if (this.curQue.detail[0].para) {

+ 36 - 30
src/components/Adult/preview/ArticleViewChs/index.vue

@@ -2,36 +2,42 @@
 <template>
   <div class="NPC-ArticleView NPC-ArticleView-container">
     <div class="ArticleView-header">
-      <el-switch
-        style="display: block"
-        v-model="showPhrases"
-        :active-color="activeColor"
-        inactive-color="rgba(0,0,0,0.1)"
-        active-text=""
-        inactive-text="本课生词"
-        @change="handleSwitchChange('showPractice', 'showWord')"
-      >
-      </el-switch>
-      <el-switch
-        style="display: block"
-        v-model="showPractice"
-        :active-color="activeColor"
-        inactive-color="rgba(0,0,0,0.1)"
-        active-text=""
-        inactive-text="语音练习"
-        @change="handleSwitchChange('showPhrases', 'showWord')"
-      >
-      </el-switch>
-      <el-switch
-        style="display: block"
-        v-model="showWord"
-        :active-color="activeColor"
-        inactive-color="rgba(0,0,0,0.1)"
-        active-text=""
-        inactive-text="取词"
-        @change="handleSwitchChange('showPhrases', 'showPractice')"
-      >
-      </el-switch>
+      <template v-if="curQue.checkList.indexOf(1) > -1">
+        <el-switch
+          style="display: block"
+          v-model="showPhrases"
+          :active-color="activeColor"
+          inactive-color="rgba(0,0,0,0.1)"
+          active-text=""
+          inactive-text="本课生词"
+          @change="handleSwitchChange('showPractice', 'showWord')"
+        >
+        </el-switch>
+      </template>
+      <template v-if="curQue.checkList.indexOf(2) > -1">
+        <el-switch
+          style="display: block"
+          v-model="showPractice"
+          :active-color="activeColor"
+          inactive-color="rgba(0,0,0,0.1)"
+          active-text=""
+          inactive-text="语音练习"
+          @change="handleSwitchChange('showPhrases', 'showWord')"
+        >
+        </el-switch>
+      </template>
+      <template v-if="curQue.checkList.indexOf(3) > -1">
+        <el-switch
+          style="display: block"
+          v-model="showWord"
+          :active-color="activeColor"
+          inactive-color="rgba(0,0,0,0.1)"
+          active-text=""
+          inactive-text="取词"
+          @change="handleSwitchChange('showPhrases', 'showPractice')"
+        >
+        </el-switch>
+      </template>
       <!-- <div class="setting-fontsize">
         <a @click="handleFontsize('-')"
           ><img src="../../../../assets/newImage/common/btn-reduce.png"

+ 15 - 2
src/components/Adult/preview/WordPhrase.vue

@@ -162,6 +162,13 @@ export default {
       let node = document.getElementById(
         "word" + _this.indexs + _this.indexss + sIndex
       );
+      let mp3 = node.src;
+      let audio = document.getElementsByTagName("audio");
+      audio.forEach((item) => {
+        if (item.src != mp3) {
+          this.audio.pause();
+        }
+      });
       _this.playWord = node;
       if (node) {
         this.mp3_index = sIndex;
@@ -281,6 +288,12 @@ export default {
     },
     handlePlayVoice(mp3) {
       let _this = this;
+      let audio = document.getElementsByTagName("audio");
+      audio.forEach((item) => {
+        if (item.src != mp3) {
+          this.audio.pause();
+        }
+      });
       if (!mp3) {
         return;
       }
@@ -616,7 +629,7 @@ export default {
       background: #24b99e !important;
     }
     .tabNum {
-      background: #24b99e;
+      background: #24b99e !important;
     }
   }
 }
@@ -626,7 +639,7 @@ export default {
       background: #bd8865 !important;
     }
     .tabNum {
-      background: #bd8865;
+      background: #bd8865 !important;
     }
   }
 }