lsc 1 年之前
父节点
当前提交
55b57c5f2d

+ 1 - 1
dist/index.html

@@ -18,7 +18,7 @@
       border-radius: 10px;
       -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
       background-color: rgba(0, 0, 0, 0.1);
-    }</style><link href=./static/css/app.6837b1ffd99146f77aa768f4625da2c2.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.2ea62301d5bc18e5b15b.js></script><script type=text/javascript src=./static/js/app.cf2a7b3b1686eaa5f0e2.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.2b23a9fa2bd62d85fe4cf825cabc95f6.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.2ea62301d5bc18e5b15b.js></script><script type=text/javascript src=./static/js/app.924da9bb0c512c3a098d.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.2b23a9fa2bd62d85fe4cf825cabc95f6.css


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.2b23a9fa2bd62d85fe4cf825cabc95f6.css.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.6837b1ffd99146f77aa768f4625da2c2.css.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.924da9bb0c512c3a098d.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.924da9bb0c512c3a098d.js.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.cf2a7b3b1686eaa5f0e2.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


+ 151 - 11
src/components/EnglishVoice2/component/right.vue

@@ -4,14 +4,26 @@
 
     </div>
     <div class="o_content">
-      <div class="word_box" v-if="cjson.type == 'word' || cjson.type == 'QA'">
-        <img class="word_img" :src="cjson.img" alt="" v-if="cjson.img" @click="previewImg(cjson.img)">
-        <div class="word_content">
-          {{ cjson.content }}
+      <div class="word_box" v-if="cjson.type == 'word' || cjson.type == 'QA'" ref="wb">
+        <div class="word_bbox" :style="{maxHeight: oheight}">
+          <img class="word_img" :src="cjson.img" alt="" v-if="cjson.img" @click="previewImg(cjson.img)">
+          <div class="word_content" v-html="cjson.content">
+          </div>
         </div>
       </div>
-      <div class="sentence_box" v-if="cjson.type == 'sentence'">
-        <span>{{ cjson.content }}</span>
+      <div class="sentence_box" v-if="cjson.type == 'sentence'" ref="wb">
+        <span v-html="cjson.content"></span>
+      </div>
+      <div class="word_box" v-if="cjson.type == 'theme'" ref="wb" style="max-height: calc(100% - 95px);">
+        <div class="word_bbox" :style="{maxHeight: oheight}">
+          <div class="word_content" v-html="cjson.content"></div>
+          <div class="word_content2" v-html="cjson.content2" v-if="cjson.content2"></div>
+        </div>
+      </div>
+      <div class="tips_box" v-if="cjson.type == 'theme' && !isRecord && !LuAudioUrl">提示:准备完成后,点击话筒开始录音</div>
+      <div class="time_box" v-if="cjson.type == 'theme' && isRecord">
+        <span>倒计时</span>
+        <span>{{ Times.min }}:{{ Times.secode }}</span>
       </div>
     </div>
     <div class="o_bottom" v-loading="isloading">
@@ -88,13 +100,54 @@ export default {
       isRecord: false,
       isPlayerRecord: false,
       isloading: false,
+      oheight: 'auto',
+      calcTimer: null,
+      totalSeconds: 0,
     }
   },
+  computed: {
+    // oheight: function() {
+    //   // 获取父元素
+    //   var parentElement = this.$refs['wb'];
+
+    //   // 计算父元素的高度
+    //   var parentHeight = parentElement.offsetHeight;
+    //   return parentHeight + 'px'
+    // }
+    Times() {
+      let min = this.totalSeconds ? Math.floor(this.totalSeconds / 60) : 0
+      let secode = this.totalSeconds ? this.totalSeconds % 60 : 0
+      let time = {
+        min: min >= 10 ? min : '0' + min,
+        secode: secode >= 10 ? secode : '0' + secode
+      }
+      return time;
+    },
+  },
   watch: {
     checkType: {
       handler: function (newVal, oldVal) {
         this.cjson = JSON.parse(JSON.stringify(this.checkJson[newVal]));
         this.LuAudioUrl = this.work[newVal] ? JSON.parse(JSON.stringify(this.work[newVal])) : ''
+        this.oheight = 'auto'
+
+        const images = document.querySelectorAll('img');
+        let loadedCount = 0;
+
+        if(images.length){
+          Array.from(images).forEach((image) => {
+            image.addEventListener('load', () => {
+              loadedCount++;
+
+              if (loadedCount === images.length) {
+                this.calculateParentHeight()
+              }
+            });
+          });
+        }else{
+          this.calculateParentHeight()
+        }
+
       },
       deep: true,
     },
@@ -128,6 +181,9 @@ export default {
       if (!_this.isRecord) {
         recorder.destroy(); // 销毁录音
         _this.isRecord = true;
+        if(this.cjson.type == 'theme'){
+          this.setSecodes()
+        }
         recorder.start().then(
           () => { },
           (error) => {
@@ -136,9 +192,18 @@ export default {
             _this.$message.error(`没有找到可使用的麦克风,或者您没有允许此网页使用麦克风`);
             // 出错了
             console.log(`${error.name} : ${error.message}`);
+            if(_this.calcTimer){
+              clearInterval(_this.calcTimer)
+              _this.calcTimer = null;
+            }
           }
         );
+
       } else {
+        if(_this.calcTimer){
+          clearInterval(_this.calcTimer)
+          _this.calcTimer = null;
+        }
         _this.isRecord = false;
         recorder.stop(); // 结束录音
         this.getMp3Data()
@@ -276,6 +341,32 @@ export default {
           });
       }
     },
+    calculateParentHeight() {
+      this.$nextTick(() => {
+         setTimeout(() => {
+           // 获取父元素
+           var parentElement = this.$refs['wb'];
+
+          // 计算父元素的高度
+          var parentHeight = parentElement.offsetHeight + 1;
+          this.oheight = parentHeight + 'px'
+         }, 1000);
+      });
+    },
+    setSecodes(){
+      this.totalSeconds = this.checkJson[this.checkType].oTime * 60
+      // this.totalSeconds = 10
+      this.calcTimer = setInterval(() => {
+        if (this.totalSeconds > 0) {
+          this.totalSeconds--;
+        } else {
+          clearInterval(this.calcTimer);
+          this.calcTimer = null
+          this.startRecorder()
+          console.log("倒计时结束"); // 输出日志
+        }
+      }, 1000);
+    }
   },
   mounted() {
     this.cjson = JSON.parse(JSON.stringify(this.checkJson[this.checkType]));
@@ -303,6 +394,7 @@ export default {
   align-items: center;
   justify-content: center;
   overflow: hidden;
+  flex-direction: column;
 }
 
 .o_bottom {
@@ -310,15 +402,30 @@ export default {
 }
 
 .word_box {
-  width: 500px;
+  min-width: 500px;
+  width: 70%;
   background: #fff;
   border-radius: 10px;
   position: relative;
+  max-height: calc(100% - 40px);
+  /* overflow: auto; */
+}
+.tips_box{
+  margin-top: 30px;
+  color: #727272;
+}
+.word_box > .word_bbox {
+  width: 100%;
+  position: relative;
+  z-index: 999;
+  max-height: 100%;
+  overflow: auto;
 }
 
 .sentence_box {
   background: #e0e0e04d;
-  width: 500px;
+  min-width: 500px;
+  width: 70%;
   border-radius: 15px;
   max-height: 100%;
   overflow: auto;
@@ -356,7 +463,7 @@ export default {
   left: 15px;
 }
 
-.word_box>.word_img {
+.word_box > .word_bbox>.word_img {
   width: calc(100% - 30px);
   max-height: 300px;
   z-index: 999;
@@ -369,7 +476,7 @@ export default {
 }
 
 
-.word_box>.word_content {
+.word_box > .word_bbox>.word_content {
   position: relative;
   z-index: 999;
   text-align: center;
@@ -378,8 +485,22 @@ export default {
   font-weight: bold;
   color: #000;
   width: calc(100% - 30px);
+  word-break: break-word;
+  white-space: pre-line;
 }
 
+.word_box > .word_bbox>.word_content2 {
+  position: relative;
+  z-index: 999;
+  text-align: left;
+  font-size: 16px;
+  margin: 15px;
+  color: #727272;
+  width: calc(100% - 30px);
+  word-break: break-word;
+  white-space: pre-line;
+  margin-top: 10px;
+}
 
 
 .o_bottom .audio {
@@ -508,4 +629,23 @@ export default {
 }
 .audio_b >>> .vueAudioBetter .iconfont:active{
   position: unset !important;
-}</style>
+}
+
+.time_box{
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  margin-top: 25px;
+}
+
+.time_box > span:nth-child(1){
+  color: #727272;
+  font-size: 16px;
+}
+.time_box > span:nth-child(2){
+  /* margin-top: 10px; */
+  font-size: 32px;
+  color: #3581FC;
+}
+</style>

+ 59 - 41
src/components/checkEnglishVoice/component/right.vue

@@ -4,21 +4,17 @@
     <div class="o_content">
       <div class="word_box">
         <div class="word_box2" v-if="cjson.type == 'word' || cjson.type == 'QA'">
-          <div class="word_content">
-            {{ cjson.content }}
-          </div>
-          <img
-            class="word_img"
-            :src="cjson.img"
-            alt=""
-            v-if="cjson.img"
-            @click="previewImg(cjson.img)"
-          />
+          <div class="word_content" v-html="cjson.content"></div>
+          <img class="word_img" :src="cjson.img" alt="" v-if="cjson.img" @click="previewImg(cjson.img)" />
         </div>
         <div class="sentence_box" v-if="cjson.type == 'sentence'">
           <div class="word_content" v-html="cjson.content">
           </div>
         </div>
+        <div class="word_box2" v-if="cjson.type == 'theme'" style="flex-direction: column;">
+          <div class="word_content" v-html="cjson.content"></div>
+          <div class="word_content2" v-html="cjson.content2"></div>
+        </div>
       </div>
     </div>
     <div class="o_bottom" v-loading="isloading">
@@ -71,7 +67,7 @@ const recorder = new Recorder({
 });
 
 // 绑定事件-打印的是当前录音数据
-recorder.onprogress = function(params) {
+recorder.onprogress = function (params) {
   // console.log('--------------START---------------')
   // console.log('录音时长(秒)', params.duration);
   // console.log('录音大小(字节)', params.fileSize);
@@ -102,7 +98,7 @@ export default {
   },
   watch: {
     checkType: {
-      handler: function(newVal, oldVal) {
+      handler: function (newVal, oldVal) {
         this.cjson = JSON.parse(JSON.stringify(this.checkJson[newVal]));
         this.LuAudioUrl = this.work[newVal]
           ? JSON.parse(JSON.stringify(this.work[newVal]))
@@ -141,7 +137,7 @@ export default {
         recorder.destroy(); // 销毁录音
         _this.isRecord = true;
         recorder.start().then(
-          () => {},
+          () => { },
           error => {
             _this.isRecord = false;
             // _this.$message.error(`${error.name} : ${error.message}`);
@@ -268,12 +264,12 @@ export default {
         };
         bucket
           .upload(params, options)
-          .on("httpUploadProgress", function(evt) {
+          .on("httpUploadProgress", function (evt) {
             //这里可以写进度条
             // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
             // _this.progress = parseInt((evt.loaded * 80) / evt.total);
           })
-          .send(function(err, data) {
+          .send(function (err, data) {
             _this.isloading = false;
             // _this.progress = 100;
             if (err) {
@@ -340,9 +336,10 @@ export default {
   align-items: center;
   justify-content: center;
 }
+
 .word_box2 {
-  max-height:  calc(100% - 20px);
-  max-width:  calc(100% - 20px);
+  max-height: calc(100% - 20px);
+  max-width: calc(100% - 20px);
   min-width: 350px;
   display: flex;
   width: auto;
@@ -353,14 +350,15 @@ export default {
   overflow: auto;
   color: #000;
 }
+
 .sentence_box {
   font-size: 16px;
   color: #000;
   line-height: 20px;
   word-break: break-word;
   white-space: pre-line;
-  max-height:  calc(100% - 20px);
-  max-width:  calc(100% - 20px);
+  max-height: calc(100% - 20px);
+  max-width: calc(100% - 20px);
   min-width: 350px;
   display: flex;
   width: auto;
@@ -370,15 +368,19 @@ export default {
   box-sizing: border-box;
   overflow: auto;
 }
-.sentence_box > .word_content {
+
+.sentence_box>.word_content {
   position: relative;
-    z-index: 999;
-    /* text-align: center; */
-    color: #000;
-    width: calc(100%);
+  z-index: 999;
+  /* text-align: center; */
+  color: #000;
+  width: calc(100%);
+  word-break: break-word;
+  white-space: pre-line;
 }
 
-.word_box2 > .word_img {
+
+.word_box2>.word_img {
   min-width: 100px;
   width: 100px;
   height: 50px;
@@ -391,14 +393,30 @@ export default {
   object-fit: cover;
 }
 
-.word_box2 > .word_content {
+.word_box2>.word_content {
+  position: relative;
+  z-index: 999;
+  text-align: center;
+  font-size: 30px;
+  margin: 7px 0 7px 0px;
+  color: #000;
+  width: calc(100%);
+  word-break: break-word;
+  white-space: pre-line;
+}
+
+.word_box2>.word_content2 {
   position: relative;
-    z-index: 999;
-    text-align: center;
-    font-size: 30px;
-    margin: 7px 0 7px 0px;
-    color: #000;
-    width: calc(100%);
+  z-index: 999;
+  /* text-align: center; */
+  /* font-size: 30px; */
+  margin: 7px 0 7px 0px;
+  color: #727272;
+  width: calc(100%);
+  word-break: break-word;
+  white-space: pre-line;
+  font-size: 16px;
+
 }
 
 .o_bottom .audio {
@@ -407,7 +425,7 @@ export default {
   justify-content: center;
 }
 
-.o_bottom .audio > img {
+.o_bottom .audio>img {
   width: 75px;
   height: 75px;
   cursor: pointer;
@@ -440,8 +458,8 @@ export default {
   cursor: pointer;
 }
 
-.audio_index_last > img,
-.audio_index_next > img {
+.audio_index_last>img,
+.audio_index_next>img {
   width: 15px;
   height: auto;
 }
@@ -451,7 +469,7 @@ export default {
   opacity: 0.6;
 }
 
-.audio_index_last > img {
+.audio_index_last>img {
   transform: rotate(180deg);
 }
 
@@ -491,7 +509,7 @@ export default {
   margin-bottom: 15px;
 }
 
-.audio_rerecord > span {
+.audio_rerecord>span {
   display: flex;
   border: 1px solid #3981fa;
   align-items: center;
@@ -501,7 +519,7 @@ export default {
   cursor: pointer;
 }
 
-.audio_rerecord > span::before {
+.audio_rerecord>span::before {
   content: "";
   width: 15px;
   height: 15px;
@@ -516,15 +534,15 @@ export default {
   margin: 0 !important;
 }
 
-.audio_b >>> .vueAudioBetter span:before{
+.audio_b>>>.vueAudioBetter span:before {
   color: #fff;
 }
 
-.audio_class >>> .slider .process {
+.audio_class>>>.slider .process {
   background: #000;
 }
 
-.audio_b >>> .vueAudioBetter .iconfont:active{
+.audio_b>>>.vueAudioBetter .iconfont:active {
   position: unset;
 }
 </style>

部分文件因为文件数量过多而无法显示