浏览代码

问题修改

guanchunjie 3 年之前
父节点
当前提交
7329ce53cd

+ 258 - 258
src/api/ajax.js

@@ -1,318 +1,318 @@
 import request from '@/utils/request'
 import { getToken } from '@/utils/auth'
 export function getContent(MethodName, data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSBookWebSI/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSBookWebSI/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }
 
 export function getYinbiao(data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        // /GCLSHMToolsServer/api/dict/basic
-        url: `/GCLSHMToolsServer/api/dict/basic?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    // /GCLSHMToolsServer/api/dict/basic
+    url: `/GCLSHMToolsServer/api/dict/basic?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }
 
 export function getLogin(MethodName, data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSFileServer/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSFileServer/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }
 
 export function getContentFile(
-    MethodName,
-    data
+  MethodName,
+  data
 ) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSFileServer/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSFileServer/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }
 
 export function getStaticContent(MethodName, data) {
-    return request({
-        url: `/GCLSFileServer/ServiceInterface?MethodName=${MethodName}`,
-        method: 'post',
-        data
-    })
+  return request({
+    url: `/GCLSFileServer/ServiceInterface?MethodName=${MethodName}`,
+    method: 'post',
+    data
+  })
 }
 
 //获取分词结果 == gcls.helxsoft.cn/GCLSFCServer/ServiceInterface?userCode=2021052116-QA2HTCS5J6C6ZER&userType=STUDENT&sessionId=S-QPUKZAXLEFESNRBAZ0
 export function getSegContent(data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSFCServer/ServiceInterface?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSFCServer/ServiceInterface?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }
 export function LearnWebSI(MethodName, data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSLearnWebSI/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data,
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSLearnWebSI/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data,
+  })
 }
 //教材
 export function TextbookAPI(MethodName, data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSBookWebSI/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data,
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSBookWebSI/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data,
+  })
 }
 export function getLearnWebContent(MethodName, data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSLearnWebSI/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSLearnWebSI/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }
 // 发送聊天
 export function sendrobot(data) {
-    return request({
-        url: `/GCLSAIServer/unit/utterance`,
-        method: 'post',
-        data
-    })
+  return request({
+    url: `/GCLSAIServer/unit/utterance`,
+    method: 'post',
+    data
+  })
 }
 // 语音识别 GCLSAIServer/speech/recognize
 export function speechrecognize(data) {
-    return request({
-        url: `/GCLSAIServer/speech/recognize`,
-        method: 'post',
-        data
-    })
+  return request({
+    url: `/GCLSAIServer/speech/recognize`,
+    method: 'post',
+    data
+  })
 }
 
 //分句
 export function segSentences(data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSHMToolsServer/api/nlp/chinese/text2Sentences?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSHMToolsServer/api/nlp/chinese/text2Sentences?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }
 //批量分词
 export function BatchSegContent(data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSHMToolsServer/api/nlp/chinese/text2word?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSHMToolsServer/api/nlp/chinese/text2word?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }
 // 生成拼音
 export function createPinyin(data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSHMToolsServer/api/nlp/chinese/text2pinyin?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSHMToolsServer/api/nlp/chinese/text2pinyin?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }
 
 // /GCLSHMToolsServer/api/nlp/hskDict/query
 //
 export function getHZChineseInfo(data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSHMToolsServer/api/baidu/chineseInfo?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSHMToolsServer/api/baidu/chineseInfo?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }
 
 //音频预处理
 export function prepareTranscribe(data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSHMToolsServer/api/xunfei/speech/prepareTranscribe?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSHMToolsServer/api/xunfei/speech/prepareTranscribe?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }
 //音频识别结果获取
 export function getWordTime(data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSHMToolsServer/api/xunfei/speech/getResult?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSHMToolsServer/api/xunfei/speech/getResult?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }
 export function textCreadMp3(data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSHMToolsServer/api/xunfei/speech/tts?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSHMToolsServer/api/xunfei/speech/tts?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }
 export function compareSenTenceTime(data) {
-    let userInfor = getToken();
-    let UserCode = '',
-        UserType = '',
-        SessionID = ''
-    if (userInfor) {
-        let user = JSON.parse(getToken());
-        UserCode = user.user_code;
-        UserType = user.user_type;
-        SessionID = user.session_id;
-    }
-    return request({
-        url: `/GCLSHMToolsServer/api/xunfei/speech/adjustResult?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
-        method: 'post',
-        data
-    })
+  let userInfor = getToken();
+  let UserCode = '',
+    UserType = '',
+    SessionID = ''
+  if (userInfor) {
+    let user = JSON.parse(getToken());
+    UserCode = user.user_code;
+    UserType = user.user_type;
+    SessionID = user.session_id;
+  }
+  return request({
+    url: `/GCLSHMToolsServer/api/xunfei/speech/adjustResult?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+    method: 'post',
+    data
+  })
 }

+ 12 - 0
src/components/Adult/Preview.vue

@@ -663,6 +663,7 @@ export default {
     // 上一页
     handleNNPEprev() {
       let _this = this;
+      _this.puaseAudio();
       if (_this.queIndex == 0) {
         this.idArr.forEach((item, i) => {
           if (item == _this.currentTreeID) {
@@ -698,9 +699,20 @@ export default {
         });
       }
     },
+    puaseAudio() {
+      let audio = document.getElementsByTagName("audio");
+      audio.forEach((item) => {
+        item.pause();
+      });
+      let video = document.getElementsByTagName("video");
+      video.forEach((item) => {
+        item.pause();
+      });
+    },
     // 下一页
     handleNNPEnext() {
       const _this = this;
+      _this.puaseAudio();
       if (_this.queIndex == _this.queTotal - 1) {
         this.idArr.forEach((item, i) => {
           if (item == _this.currentTreeID) {

+ 15 - 5
src/components/Adult/preview/Voicefullscreen.vue

@@ -108,7 +108,7 @@
             <span
               :class="[
                 'en-icon',
-                item && !item.enwords ? 'disabled' : '',
+                !enwords ? 'disabled' : '',
                 !isShowEN ? 'disabled' : '',
                 isShowEN && bgIndex == 1 ? 'en-icon-yellow' : '',
               ]"
@@ -378,12 +378,13 @@
           </div>
         </div>
         <div style="clear: both; overflow: hidden"></div>
+
         <div
-          v-if="item.enwords"
+          v-if="enwords && isShowEN"
           :class="['enwords', bgIndex == 1 ? 'enwords-green' : '']"
           :style="{ fontSize: enSize + 'px' }"
         >
-          {{ item.enwords }}
+          {{ enwords }}
         </div>
       </div>
       <div
@@ -584,6 +585,7 @@ export default {
       isRecording: false,
       recordPlaying: false,
       isCollArr: [],
+      enwords: "",
     };
   },
   computed: {
@@ -747,7 +749,13 @@ export default {
       this.getSentence();
     },
     changeStatus(key) {
-      this[key] = !this[key];
+      if (key == "isShowEN") {
+        if (this.enwords) {
+          this[key] = !this[key];
+        }
+      } else {
+        this[key] = !this[key];
+      }
     },
     setStatus() {
       let _this = this;
@@ -821,9 +829,11 @@ export default {
       let item = JSON.parse(JSON.stringify(_this.sentList[_this.curSentIndex]));
       if (item.sentArr) {
         _this.item = item.sentArr;
+        _this.enwords = item.enwords;
       } else {
         _this.item = item;
       }
+
       _this.sentList.forEach((item) => {
         this.isCollArr.push(false);
       });
@@ -1412,7 +1422,7 @@ export default {
       padding: 0 67px;
       .enwords {
         padding: 0 3px;
-        margin-top: 40px;
+        margin-top: 24px;
         color: rgba(0, 0, 0, 0.45);
         font-size: 24px;
         line-height: 32px;

+ 143 - 70
src/components/Adult/preview/WordPhrase.vue

@@ -78,45 +78,94 @@
                 v-else
                 style="width: 16px; height: 16px; margin-left: 8px"
               ></div>
-              <template v-if="sItem.pinyin_site&&(sItem.pinyin_site=='top'||sItem.pinyin_site=='bottom')">
-                  <div class="NPC-word-tab-box">
-                        <span class="NPC-word-tab-common NPC-word-tab-pinyin" :class="[sItem.motif_color?'NPC-word-tab-pinyin-'+themeColor:'']" v-if="sItem.pinyin_site=='top'">
-                            {{ sItem.pinyin }}
-                        </span>
-                        <span class="NPC-word-tab-common NPC-word-tab-word" :class="[sItem.motif_color?'NPC-word-tab-word-'+themeColor:'']">
-                            {{ sItem.new_word }}
-                        </span>
-                        <span class="NPC-word-tab-common NPC-word-tab-pinyin" :class="[sItem.motif_color?'NPC-word-tab-pinyin-'+themeColor:'']" v-if="sItem.pinyin_site=='bottom'">
-                            {{ sItem.pinyin }}
-                        </span>
-                  </div>
-                    <span
-                        class="NPC-word-tab-common NPC-word-tab-cixing"
-                        v-html="sItem.cixing"
-                    ></span>
-                    <span
-                        class="NPC-word-tab-common NPC-word-tab-def"
-                        v-html="sItem.def_str"
-                    ></span>
+              <template
+                v-if="
+                  sItem.pinyin_site &&
+                  (sItem.pinyin_site == 'top' || sItem.pinyin_site == 'bottom')
+                "
+              >
+                <div class="NPC-word-tab-box">
+                  <span
+                    class="NPC-word-tab-common NPC-word-tab-pinyin"
+                    :class="[
+                      sItem.motif_color
+                        ? 'NPC-word-tab-pinyin-' + themeColor
+                        : '',
+                    ]"
+                    v-if="sItem.pinyin_site == 'top'"
+                  >
+                    {{ sItem.pinyin }}
+                  </span>
+                  <span
+                    class="NPC-word-tab-common NPC-word-tab-word"
+                    :class="[
+                      sItem.motif_color
+                        ? 'NPC-word-tab-word-' + themeColor
+                        : '',
+                    ]"
+                  >
+                    {{ sItem.new_word }}
+                  </span>
+                  <span
+                    class="NPC-word-tab-common NPC-word-tab-pinyin"
+                    :class="[
+                      sItem.motif_color
+                        ? 'NPC-word-tab-pinyin-' + themeColor
+                        : '',
+                    ]"
+                    v-if="sItem.pinyin_site == 'bottom'"
+                  >
+                    {{ sItem.pinyin }}
+                  </span>
+                </div>
+                <span
+                  class="NPC-word-tab-common NPC-word-tab-cixing"
+                  v-html="sItem.cixing"
+                ></span>
+                <span
+                  class="NPC-word-tab-common NPC-word-tab-def"
+                  v-html="sItem.def_str"
+                ></span>
               </template>
               <template v-else>
-                    <span class="NPC-word-tab-common NPC-word-tab-pinyin" :class="[sItem.motif_color?'NPC-word-tab-pinyin-'+themeColor:'']" v-if="!sItem.pinyin_site||sItem.pinyin_site=='first'">
-                        {{ sItem.pinyin }}
-                    </span>
-                    <span class="NPC-word-tab-common NPC-word-tab-word" :class="[sItem.motif_color?'NPC-word-tab-word-'+themeColor:'']">
-                        {{ sItem.new_word }}
-                    </span>
-                    <span class="NPC-word-tab-common NPC-word-tab-pinyin" :class="[sItem.motif_color?'NPC-word-tab-pinyin-'+themeColor:'']" v-if="sItem.pinyin_site=='last'">
-                        {{ sItem.pinyin }}
-                    </span>
-                    <span
-                        class="NPC-word-tab-common NPC-word-tab-cixing"
-                        v-html="sItem.cixing"
-                    ></span>
-                    <span
-                        class="NPC-word-tab-common NPC-word-tab-def"
-                        v-html="sItem.def_str"
-                    ></span>
+                <span
+                  class="NPC-word-tab-common NPC-word-tab-pinyin"
+                  :class="[
+                    sItem.motif_color
+                      ? 'NPC-word-tab-pinyin-' + themeColor
+                      : '',
+                  ]"
+                  v-if="!sItem.pinyin_site || sItem.pinyin_site == 'first'"
+                >
+                  {{ sItem.pinyin }}
+                </span>
+                <span
+                  class="NPC-word-tab-common NPC-word-tab-word"
+                  :class="[
+                    sItem.motif_color ? 'NPC-word-tab-word-' + themeColor : '',
+                  ]"
+                >
+                  {{ sItem.new_word }}
+                </span>
+                <span
+                  class="NPC-word-tab-common NPC-word-tab-pinyin"
+                  :class="[
+                    sItem.motif_color
+                      ? 'NPC-word-tab-pinyin-' + themeColor
+                      : '',
+                  ]"
+                  v-if="sItem.pinyin_site == 'last'"
+                >
+                  {{ sItem.pinyin }}
+                </span>
+                <span
+                  class="NPC-word-tab-common NPC-word-tab-cixing"
+                  v-html="sItem.cixing"
+                ></span>
+                <span
+                  class="NPC-word-tab-common NPC-word-tab-def"
+                  v-html="sItem.def_str"
+                ></span>
               </template>
               <span v-if="curQue.isInfor">
                 <img
@@ -142,6 +191,7 @@
         type="newWordDetail"
       />
     </div>
+    <audio ref="newwordAudio" />
   </div>
 </template>
 
@@ -171,6 +221,7 @@ export default {
       mp3List: [],
       isSuccess: false,
       loading: false,
+      mp3: "",
     };
   },
   //计算属性 类似于data概念
@@ -200,7 +251,6 @@ export default {
       let audio = document.getElementsByTagName("audio");
       audio.forEach((item) => {
         if (item.src != mp3) {
-          // this.audio.pause();
           item.pause();
         }
       });
@@ -247,6 +297,7 @@ export default {
       _this.data = _this.optionRes[_this.detailIndex];
       //_this.getWordLiju(_this.data.new_word);
     },
+
     playNewwords() {
       let _this = this;
       if (_this.playWord) {
@@ -257,7 +308,7 @@ export default {
       let mp3 = _this.mp3List[mp3_index].mp3_list[0].id;
       _this.mp3_index = _this.mp3List[mp3_index].sIndex;
       _this.handlePlayVoice(mp3);
-      _this.audio.addEventListener("ended", function () {
+      _this.$refs.newwordAudio.addEventListener("ended", function () {
         if (mp3_index < leg - 1) {
           mp3_index = mp3_index + 1;
           _this.mp3_index = _this.mp3List[mp3_index].sIndex;
@@ -272,19 +323,19 @@ export default {
         }
       });
     },
-    handlePlayVoice(mp3) {
+    handlePlayVoice3(mp3) {
       let _this = this;
       let audio = document.getElementsByTagName("audio");
       audio.forEach((item) => {
         if (item.src != mp3) {
-          this.audio.pause();
+          item.pause();
         }
       });
       if (!mp3) {
         return;
       }
-      if (!this.audio.paused) {
-        this.audio.pause();
+      if (!_this.audio.paused) {
+        _this.audio.pause();
       } else {
         _this.audio.pause();
         _this.audio.load();
@@ -293,11 +344,33 @@ export default {
         _this.audio.play();
       }
     },
-    stopAudio() {
-      if (this.audio) {
-        this.audio.pause();
+    handlePlayVoice(mp3) {
+      let _this = this;
+
+      let audio = document.getElementsByTagName("audio");
+      audio.forEach((item) => {
+        if (item.src != mp3) {
+          item.pause();
+        }
+      });
+      if (!mp3) {
+        return;
+      }
+      if (!_this.$refs.newwordAudio.paused) {
+        _this.$refs.newwordAudio.pause();
+        _this.mp3_index = -1;
+      } else {
+        setTimeout(() => {
+          _this.$refs.newwordAudio.pause();
+          _this.$refs.newwordAudio.src = mp3;
+          _this.$refs.newwordAudio.load();
+          _this.$refs.newwordAudio.play();
+        }, 10);
       }
     },
+    stopAudio() {
+      this.$refs.newwordAudio.pause();
+    },
     initData() {
       if (this.curQue.type == "NewWord_chs") {
         let resIndex = 0;
@@ -333,13 +406,13 @@ export default {
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     let _this = this;
-    _this.audio.addEventListener("play", function () {
+    _this.$refs.newwordAudio.addEventListener("play", function () {
       _this.playClass = "active";
     });
-    _this.audio.addEventListener("pause", function () {
+    _this.$refs.newwordAudio.addEventListener("pause", function () {
       _this.playClass = "";
     });
-    _this.audio.addEventListener("ended", function () {
+    _this.$refs.newwordAudio.addEventListener("ended", function () {
       _this.playClass = "";
     });
   },
@@ -420,14 +493,14 @@ export default {
         margin-top: 4px;
         margin-left: 8px;
       }
-      .NPC-word-tab-box{
-          width: 240px;
-          span{
-              display: block;
-              width: 100%;
-              color: #000000;
-              margin: 2px 0;
-          }
+      .NPC-word-tab-box {
+        width: 240px;
+        span {
+          display: block;
+          width: 100%;
+          color: #000000;
+          margin: 2px 0;
+        }
       }
       .NPC-word-tab-common {
         padding-left: 8px;
@@ -438,28 +511,28 @@ export default {
         font-family: "GB-PINYINOK-B";
         white-space: nowrap;
         font-size: 12px;
-        &.NPC-word-tab-pinyin-red{
-            color: #e35454;
+        &.NPC-word-tab-pinyin-red {
+          color: #e35454;
         }
-        &.NPC-word-tab-pinyin-green{
-            color: #24b99e;
+        &.NPC-word-tab-pinyin-green {
+          color: #24b99e;
         }
-        &.NPC-word-tab-pinyin-brown{
-            color: #bd8865;
+        &.NPC-word-tab-pinyin-brown {
+          color: #bd8865;
         }
       }
       .NPC-word-tab-word {
         font-family: "FZJCGFKTK";
         white-space: nowrap;
         font-size: 16px;
-        &.NPC-word-tab-word-red{
-            color: #e35454;
+        &.NPC-word-tab-word-red {
+          color: #e35454;
         }
-        &.NPC-word-tab-word-green{
-            color: #24b99e;
+        &.NPC-word-tab-word-green {
+          color: #24b99e;
         }
-        &.NPC-word-tab-word-brown{
-            color: #bd8865;
+        &.NPC-word-tab-word-brown {
+          color: #bd8865;
         }
       }
       .NPC-word-tab-cixing {
@@ -467,7 +540,7 @@ export default {
         width: 48px;
         box-sizing: border-box;
         text-align: left;
-        font-style:italic;
+        font-style: italic;
       }
       .NPC-word-tab-def {
         flex: 1;

+ 1 - 1
src/components/Adult/preview/components/AudioRed.vue

@@ -81,7 +81,7 @@ export default {
     _this.audio.addEventListener("play", function () {
       _this.voiceSrc = _this.isCompare
         ? _this.comparePlaySrc
-        : _this.voicePauseSrc;
+        : _this.voicePlaySrc;
       _this.$emit("getPlayStatus", true);
     });
     _this.audio.addEventListener("pause", function () {

+ 55 - 37
src/components/Adult/preview/components/WordPhraseDetail.vue

@@ -252,8 +252,8 @@ export default {
       height: "",
       margintop: "",
       wordShow: true,
-      wordShow2: true,
-      wordShow3: true,
+      wordShow2: false,
+      wordShow3: false,
       list1: [],
       list2: [],
       list3: [],
@@ -352,41 +352,60 @@ export default {
         });
     },
     handleExample(list) {
-    let _this = this;
-        // let list1Ora = JSON.parse(JSON.stringify(_this.data.list1))
-        list = list.map((item,index) =>{
-            let position_str = []
-            let sentence = JSON.parse(JSON.stringify(item.sentence))
-            let res = ""
-            for(let i=0;i<item.position_list.length;i++){
-                let part1 = "";
-                let part2 = "";
-                let part3 = "";
-                if(item.position_list.length>1){
-                    if(i==0){
-                        part1 = sentence.substring(0, item.position_list[i].begin);
-                        part2 = sentence.substring(item.position_list[i].begin,item.position_list[i].end);
-                        part3 = sentence.substring(item.position_list[i].end,item.position_list[i+1].begin)
-                    }else if(i==item.position_list.length-1){
-                        part1 = "";
-                        part2 = sentence.substring(item.position_list[i].begin,item.position_list[i].end);
-                        part3 = sentence.substring(item.position_list[i].end)
-                    }else{
-                        part1 = "";
-                        part2 = sentence.substring(item.position_list[i].begin,item.position_list[i].end);
-                        part3 = sentence.substring(item.position_list[i].end,item.position_list[i+1].begin)
-                    }
-                }else{
-                    part1 = sentence.substring(0, item.position_list[i].begin);
-                    part2 = sentence.substring(item.position_list[i].begin,item.position_list[i].end);
-                    part3 = sentence.substring(item.position_list[i].end)
-                }
-                res +=  part1 + '<span style="color:#DE4444;">' + part2 + "</span>" + part3;
+      let _this = this;
+      // let list1Ora = JSON.parse(JSON.stringify(_this.data.list1))
+      list = list.map((item, index) => {
+        let position_str = [];
+        let sentence = JSON.parse(JSON.stringify(item.sentence));
+        let res = "";
+        for (let i = 0; i < item.position_list.length; i++) {
+          let part1 = "";
+          let part2 = "";
+          let part3 = "";
+          if (item.position_list.length > 1) {
+            if (i == 0) {
+              part1 = sentence.substring(0, item.position_list[i].begin);
+              part2 = sentence.substring(
+                item.position_list[i].begin,
+                item.position_list[i].end
+              );
+              part3 = sentence.substring(
+                item.position_list[i].end,
+                item.position_list[i + 1].begin
+              );
+            } else if (i == item.position_list.length - 1) {
+              part1 = "";
+              part2 = sentence.substring(
+                item.position_list[i].begin,
+                item.position_list[i].end
+              );
+              part3 = sentence.substring(item.position_list[i].end);
+            } else {
+              part1 = "";
+              part2 = sentence.substring(
+                item.position_list[i].begin,
+                item.position_list[i].end
+              );
+              part3 = sentence.substring(
+                item.position_list[i].end,
+                item.position_list[i + 1].begin
+              );
             }
-            item.res = res;
-            return item
-        })
-        return list;
+          } else {
+            part1 = sentence.substring(0, item.position_list[i].begin);
+            part2 = sentence.substring(
+              item.position_list[i].begin,
+              item.position_list[i].end
+            );
+            part3 = sentence.substring(item.position_list[i].end);
+          }
+          res +=
+            part1 + '<span style="color:#DE4444;">' + part2 + "</span>" + part3;
+        }
+        item.res = res;
+        return item;
+      });
+      return list;
     },
 
     initData() {
@@ -433,7 +452,6 @@ export default {
   width: 100%;
   z-index: 999;
   overflow-y: scroll;
-
   .module-inner {
     padding: 30px 0;
     > div {

+ 14 - 5
src/components/Adult/preview/components/Wordcard.vue

@@ -76,11 +76,20 @@
     </p>
     <template v-if="word.detail">
       <span class="word-ben-def">
-        <span>{{
-          word.detail.definition_list && word.detail.definition_list.length > 0
-            ? "本课释义"
-            : "词典释义"
-        }}</span>
+        <span
+          v-if="
+            word.detail.definition_list &&
+            word.detail.definition_list.length > 0
+          "
+          >本课释义</span
+        >
+        <span
+          v-else-if="
+            word.detail.paraphrase && word.detail.paraphrase.length > 0
+          "
+          >词典释义</span
+        >
+        <span v-else>暂无释义</span>
       </span>
       <div
         class="bwc-word-en"

+ 3 - 1
src/utils/request.js

@@ -10,6 +10,8 @@ axios.defaults.dataType = 'json'
 axios.defaults.headers['cache-control'] = 'no-cache'
 axios.defaults.headers['Content-Type'] = 'application/json'
 axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest'
+
+
 // create an axios instance
 const service = axios.create({
   baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
@@ -47,8 +49,8 @@ service.interceptors.response.use(
    * You can also judge the status by HTTP Status Code
    */
   response => {
-    const res = response.data
     // console.log(res)
+    const res = response.data;
     let msg = null
     // if the custom code is not 20000, it is judged as an error.
     if (res.status == 0 || res.status == -2) {

+ 1 - 0
src/views/courseView.vue

@@ -96,6 +96,7 @@ export default {
       _this.chapterId = id;
       _this.chapterName = name;
       _this.isAnswerShow = false;
+
       _this.onGetData();
     },
     // 点击全屏展示 隐藏tree