SanHQin 7 months ago
parent
commit
e4fb204f20

+ 154 - 57
src/components/classRoomHelper/component/countdown.vue

@@ -235,25 +235,29 @@
       style="margin-bottom:30px;padding:20px;cursor: pointer;"
       v-if="showType == 0"
     >
-      <span @click.stop="showType = 1">教学活动备忘>></span>
+      <span @click.stop="changeShowType(1)">教学活动备忘>></span>
     </div>
 
-    <div v-if="showType == 1" style="padding-top:20px;height:100%;box-sizing: border-box;">
-      <span style="padding:20px;cursor: pointer;" @click.stop="showType = 0"
+    <div
+      v-if="showType == 1"
+      style="padding-top:20px;height:100%;box-sizing: border-box;"
+    >
+      <span style="padding:20px;cursor: pointer;" @click.stop="changeShowType(0)"
         ><<返回</span
       >
 
-      <div class="c_step" ref="stepRef">
-			<el-timeline>
-  		  <el-timeline-item
-  		    v-for="(activity, index) in memorandumList"
-  		    :key="index"
-  		    :timestamp="activity.timestamp"
-					>
-					<span v-html="activity.content"></span>
-  		  </el-timeline-item>
-  		</el-timeline>
-			</div>
+      <div class="c_step" ref="stepRef" v-loading="memorandumLoading">
+        <el-timeline>
+          <el-timeline-item
+            v-for="(item, index) in memorandumList"
+            :key="index"
+            :timestamp="item.time"
+          >
+					<div v-html="item.text"></div>
+            <!-- <span v-html="activity.content"></span> -->
+          </el-timeline-item>
+        </el-timeline>
+      </div>
     </div>
     <mini-audio
       v-show="false"
@@ -290,7 +294,8 @@ export default {
       showType: 0,
       sourceUrl:
         "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%80%92%E8%AE%A1%E6%97%B6%E9%9F%B3%E4%B9%901721355956636.mp3",
-      endSourceUrl: "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%80%92%E6%95%B010%E7%A7%92%E5%8F%A0%E5%8A%A0%E9%9F%B3%E6%95%881721638403882.MP3",
+      endSourceUrl:
+        "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%80%92%E6%95%B010%E7%A7%92%E5%8F%A0%E5%8A%A0%E9%9F%B3%E6%95%881721638403882.MP3",
       sourceActive: false,
       type: 0, //0:倒计时   1:计时器
       isCountdown: false,
@@ -319,9 +324,8 @@ export default {
         "观察记录"
       ], //常用
       choiceBehavior: [],
-      memorandumList: [
-       
-      ]
+      memorandumList: [],
+			memorandumLoading:false,
     };
   },
   computed: {
@@ -392,19 +396,49 @@ export default {
         this.countdownTimeDefault = newValue;
       }
       if (this.$refs.audioRef.playing && this.sourceActive && newValue == 10) {
-				this.$refs.audioRef.stop();
-				this.$refs.endSourceUrlRef.play();
+        this.$refs.audioRef.stop();
+        this.$refs.endSourceUrlRef.play();
         // this.$refs.audioRef.setVolume(newValue / 10);
       }
     }
   },
   methods: {
-		changeShowType(newType){
-			this.showType = newType;
-			if(this.showType==1){
-				this.$refs.stepRef.scrollTop = this.$refs.stepRef.scrollHeight;
-			}
-		},
+    insertMemorandum(_html) {
+			return;
+      //保存行为操作
+      //variable
+      //btn
+      let params = [
+        {
+          uid: this.userid,
+          courseId: this.courseId,
+          content: _html
+        }
+      ];
+
+      this.ajax
+        .post(
+          this.$store.state.api + "insert_systemOperation_countdownBehavior",
+          params
+        )
+        .then(res => {
+          if (res.data == 1) {
+            console.log("保存操作成功");
+          } else {
+            console.log("保存操作失败");
+          }
+        })
+        .catch(e => {
+          console.log("保存操作失败");
+          console.log(e);
+        });
+    },
+    changeShowType(newType) {
+      this.showType = newType;
+      if (this.showType == 1) {
+				this.selectMemorandum()
+      }
+    },
     changeType(newType) {
       if (this.isCountdown || this.isKeepTime) return;
       this.type = newType;
@@ -481,17 +515,34 @@ export default {
             }
             this.$refs.audioRef.setVolume(volume / 10);
           }, 1000);
-        } else if (this.countdownTime <= 20 && this.countdownTime>10 && this.sourceActive) {
+        } else if (
+          this.countdownTime <= 20 &&
+          this.countdownTime > 10 &&
+          this.sourceActive
+        ) {
           this.$refs.audioRef.setVolume(1);
-        }else if(this.countdownTime <=10 && this.sourceActive){
-					this.$refs.audioRef.stop();
-					this.$refs.endSourceUrlRef.setProgress((10-this.countdownTime)/10)
-					this.$refs.endSourceUrlRef.play();
-				}
+        } else if (this.countdownTime <= 10 && this.sourceActive) {
+          this.$refs.audioRef.stop();
+          this.$refs.endSourceUrlRef.setProgress(
+            (10 - this.countdownTime) / 10
+          );
+          this.$refs.endSourceUrlRef.play();
+        }
         this.countdownTimeTimer = setInterval(() => {
           this.isCountdown = true;
           this.countdownTime -= 1;
         }, 1000);
+        let timeShow = `${this.countdownTimeShow.m1}${this.countdownTimeShow.m2}分钟${this.countdownTimeShow.s1}${this.countdownTimeShow.s2}秒`;
+        this.insertMemorandum(
+          `设置<span class="variable"></span><span class="btn">倒计时${timeShow}</span>${
+            this.choiceBehavior.length > 0
+              ? ",用于" +
+                '<span class="btn">' +
+                this.choiceBehavior.join("、") +
+                "</span>"
+              : ""
+          }`
+        );
       }
     },
     countdownTimeFinish() {
@@ -508,6 +559,7 @@ export default {
         time: this.countdownTimeDefault,
         tag: this.choiceBehavior
       };
+      this.insertMemorandum(`<span class="btn">倒计时</span>结束`);
       this.insertData(_data);
     },
     keepTimeFn() {
@@ -529,20 +581,40 @@ export default {
           this.keepTime += 1;
         }, 1000);
         this.$message.success("已开始计时");
+        this.insertMemorandum(
+          `使用<span class="btn">计时器</span>${
+            this.choiceBehavior.length > 0
+              ? ",用于" +
+                '<span class="btn">' +
+                this.choiceBehavior.join("、") +
+                "</span>"
+              : ""
+          }`
+        );
       }
     },
     music() {
       this.sourceActive = !this.sourceActive;
-      if (this.$refs.audioRef.playing && !this.sourceActive) {
+      if (
+        (this.$refs.audioRef.playing || this.$refs.endSourceUrlRef.playing) &&
+        !this.sourceActive
+      ) {
         this.$refs.audioRef.pause();
+        this.$refs.endSourceUrlRef.stop();
       } else if (this.sourceActive) {
-        if (this.isCountdown > 10) {
+        if (this.isCountdown) {
+          if (this.countdownTime > 10) {
+            this.$refs.audioRef.play();
+          } else {
+            this.$refs.audioRef.stop();
+            this.$refs.endSourceUrlRef.setProgress(
+              (10 - this.countdownTime) / 10
+            );
+            this.$refs.endSourceUrlRef.play();
+          }
+        } else if (this.isKeepTime) {
           this.$refs.audioRef.play();
-        }else{
-					this.$refs.audioRef.stop();
-					this.$refs.endSourceUrlRef.setProgress((10-this.countdownTime)/10)
-					this.$refs.endSourceUrlRef.play();
-				}
+        }
       }
     },
     reset() {
@@ -606,9 +678,21 @@ export default {
                 time: this.keepTime,
                 tag: this.choiceBehavior
               };
+							let timeShow = `${this.keepTimeShow.m1}${this.keepTimeShow.m2}分钟${this.keepTimeShow.s1}${this.keepTimeShow.s2}秒`;
+          this.insertMemorandum(
+            `结束计时器,<span class="btn">计时</span><span class="variable">${timeShow}</span>${
+              this.choiceBehavior.length > 0
+                ? ",用于" +
+                  '<span class="btn">' +
+                  this.choiceBehavior.join("、") +
+                  "</span>"
+                : ""
+            }`
+          );
               this.keepTime = 0;
               this.isKeepTime = false;
               this.insertData(_data);
+							
             })
             .catch(_ => {
               console.log("取消重置");
@@ -623,6 +707,17 @@ export default {
             this.$refs.audioRef.pause();
           }
           this.insertData(_data);
+          let timeShow = `${this.keepTimeShow.m1}${this.keepTimeShow.m2}分钟${this.keepTimeShow.s1}${this.keepTimeShow.s2}秒`;
+          this.insertMemorandum(
+            `结束计时器,<span class="btn">计时</span><span class="variable">${timeShow}</span>${
+              this.choiceBehavior.length > 0
+                ? ",用于" +
+                  '<span class="btn">' +
+                  this.choiceBehavior.join("、") +
+                  "</span>"
+                : ""
+            }`
+          );
           this.keepTime = 0;
           this.isKeepTime = false;
           // this.choiceBehavior = [];
@@ -716,24 +811,27 @@ ${_textData}
           console.log(e);
         });
     },
-		insertMemorandum(_html){
-			//variable
-			//btn
-			let params = [{
+		selectMemorandum(){
+			return;
+			this.memorandumLoading = false;
+			let params = {
 				uid:this.userid,
 				courseId:this.courseId,
-				content:_html
-			}]
-
-			this.ajax.post(this.$store.state.api+'insert_systemOperation_countdownBehavior',params).then(res=>{
-				if(res.data==1){
-					console.log('保存操作成功')
+			}
+			this.memorandumList = [];
+			this.ajax.get(this.$store.state.api+"select_systemOperation_countdownBehavior",params).then(res=>{
+				let _data = res.data[0];
+				if(_data.length){
+					this.memorandumList = _data;
 				}else{
-					console.log('保存操作失败')
+					this.memorandumList = [];
 				}
-			}).catch(e=>{
-				console.log('保存操作失败')
-				console.log(e)
+				this.memorandumLoading = false;
+				console.log(res);
+			}).catch(err=>{
+				console.log(err)
+				this.memorandumLoading = false;
+				this.$message.error("获取行为备忘失败")
 			})
 		}
   }
@@ -1006,10 +1104,9 @@ ${_textData}
   width: 100%;
   height: calc(100% - 80px);
   margin-top: 20px;
-	padding: 20px 50px;
-	box-sizing: border-box;
-	overflow: auto;
-	
+  padding: 20px 50px;
+  box-sizing: border-box;
+  overflow: auto;
 }
 .c_s_item {
   display: flex;

+ 263 - 156
src/components/classRoomHelper/component/languageAssistant.vue

@@ -1,48 +1,151 @@
 <template>
   <div class="languageAssistant">
-		<div class="la_coco">
-			<el-image
+    <div class="la_coco">
+      <el-image
         style="width: 105px; height: 105px;"
         v-show="showIndex == 2"
         :src="require('../../../assets/icon/course/aiVanish.svg')"
         fit="fill"
       ></el-image>
-			<el-image
+      <el-image
         style="width: 105px; height: 105px;"
         v-show="showIndex == 0"
         :src="require('../../../assets/icon/course/aiWait.svg')"
         fit="fill"
       ></el-image>
-			<el-image
+      <el-image
         style="width: 105px; height: 105px;"
         v-show="showIndex == 1"
         :src="require('../../../assets/icon/course/aiTalk.svg')"
         fit="fill"
       ></el-image>
-		</div>
-		<div class="la_message" :style="show?'':'height:calc(100% - 170px - 200px - 40px)'" ref="messageRef" >
-			<div class="la_m_talk" v-if="show">
-				<div v-if="showTextIndex==0" v-html="htmlContent(aiText)"></div>
-				<div v-if="showTextIndex==1">{{userText}}</div>
-				<div v-if="showTextIndex==2">正在组织语言...</div>
-			</div>
-		</div>
-		<div class="la_btn">
-			<div class="la_b_noTel" v-if="!show">
-				<svg @click.stop="recordStart" t="1721367811838"  viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4525" width="64" height="64"><path d="M65.771 502.182c0 246.632 199.937 446.566 446.57 446.565 246.613 0 446.549-199.934 446.551-446.565 0-246.633-199.936-446.549-446.55-446.55-246.635 0.001-446.57 199.917-446.571 446.55z m651.885-173.77c31.489 31.473 1.642 148.828-114.292 264.773C487.396 709.131 370.06 738.929 338.589 707.492c-27.278-27.315-74.96-60.574-12.892-110.423 62.087-49.886 79.429-25.343 107.582 2.772 19.674 19.711 69.436-21.368 112.394-64.328 42.94-42.996 83.986-92.719 64.368-112.43-28.155-28.153-52.679-45.511-2.792-107.562 49.904-62.049 83.125-14.405 110.406 12.891z" p-id="4526"></path></svg>
-			</div>
-			<div class="la_b_isTel" v-else>
-				<span @click.stop="stopTalk">
-					<svg t="1721372070061" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6534" width="64" height="64"><path d="M648.45 247.01c-31.64 0-57.348 27.685-57.348 57.348v427.149c0 31.64 27.685 57.348 57.348 57.348S705.8 761.17 705.8 731.507V304.358c0-31.64-27.686-57.348-57.349-57.348z m-272.9 0c-31.64 0-57.349 27.685-57.349 57.348v427.149c0 31.64 27.686 57.348 57.349 57.348s57.348-27.685 57.348-57.348V304.358c1.978-31.64-25.708-57.348-57.348-57.348z" p-id="6535"></path></svg>
-				</span>
-				<svg @click.stop="stopRecord" t="1721367811838"  viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4525" width="64" height="64"><path d="M65.771 502.182c0 246.632 199.937 446.566 446.57 446.565 246.613 0 446.549-199.934 446.551-446.565 0-246.633-199.936-446.549-446.55-446.55-246.635 0.001-446.57 199.917-446.571 446.55z m651.885-173.77c31.489 31.473 1.642 148.828-114.292 264.773C487.396 709.131 370.06 738.929 338.589 707.492c-27.278-27.315-74.96-60.574-12.892-110.423 62.087-49.886 79.429-25.343 107.582 2.772 19.674 19.711 69.436-21.368 112.394-64.328 42.94-42.996 83.986-92.719 64.368-112.43-28.155-28.153-52.679-45.511-2.792-107.562 49.904-62.049 83.125-14.405 110.406 12.891z" p-id="4526"></path></svg>
-				<span @click.stop="interrupt">
-					<svg t="1721372012678" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5554" width="64" height="64"><path d="M885.6 413.8c-32.3 0-60.1 19.8-71.9 47.9h-18.1c-16.6 0-30 13.4-30 30s13.4 30 30 30h18.1c11.8 28.1 39.5 47.9 71.9 47.9 42.9 0 77.9-34.9 77.9-77.9 0-42.9-35-77.9-77.9-77.9zM690.4 461.7h-21.1c-16.6 0-30 13.4-30 30s13.4 30 30 30h21.1c16.6 0 30-13.4 30-30s-13.4-30-30-30zM564.1 461.7h-10c-16.6 0-30 13.4-30 30s13.4 30 30 30h10c16.6 0 30-13.4 30-30s-13.4-30-30-30zM709.7 115.7c-13.7-9.4-32.3-5.9-41.7 7.8L436.5 461.8c-0.8-0.1-1.6-0.1-2.3-0.1H212.5c-11.8-28.1-39.5-47.9-71.9-47.9-39.4 0-72.1 29.5-77.2 67.5-1.2 3.2-1.8 6.7-1.8 10.3 0 3.6 0.6 7.1 1.8 10.3 5.1 38.1 37.7 67.5 77.2 67.5 32.3 0 60.1-19.8 71.9-47.9h183l-240.1 351c-9.4 13.7-5.9 32.3 7.8 41.7 5.2 3.5 11.1 5.2 16.9 5.2 9.6 0 19-4.6 24.8-13.1l512.6-749c9.4-13.5 5.9-32.2-7.8-41.6z" p-id="5555"></path></svg>
-				</span>
-			</div>
-		</div>
-		 <!-- 录音转文字 -->
-		 <iframe
+    </div>
+    <div
+      class="la_message"
+      :style="show ? '' : 'height:calc(100% - 170px - 200px - 40px)'"
+      ref="messageRef"
+    >
+      <div class="la_m_talk" v-if="show">
+        <div v-if="showTextIndex == 0" v-html="htmlContent(aiText)"></div>
+        <div v-if="showTextIndex == 1">{{ userText }}</div>
+        <div v-if="showTextIndex == 2">正在组织语言...</div>
+      </div>
+    </div>
+    <div class="la_btn">
+      <div class="la_b_noTel" v-if="!show">
+        <el-tooltip class="item" effect="light" content="通话" placement="top">
+          <span>
+            <svg
+              @click.stop="recordStart"
+              t="1721367811838"
+              viewBox="0 0 1024 1024"
+              version="1.1"
+              xmlns="http://www.w3.org/2000/svg"
+              p-id="4525"
+              width="64"
+              height="64"
+            >
+              <path
+                d="M65.771 502.182c0 246.632 199.937 446.566 446.57 446.565 246.613 0 446.549-199.934 446.551-446.565 0-246.633-199.936-446.549-446.55-446.55-246.635 0.001-446.57 199.917-446.571 446.55z m651.885-173.77c31.489 31.473 1.642 148.828-114.292 264.773C487.396 709.131 370.06 738.929 338.589 707.492c-27.278-27.315-74.96-60.574-12.892-110.423 62.087-49.886 79.429-25.343 107.582 2.772 19.674 19.711 69.436-21.368 112.394-64.328 42.94-42.996 83.986-92.719 64.368-112.43-28.155-28.153-52.679-45.511-2.792-107.562 49.904-62.049 83.125-14.405 110.406 12.891z"
+                p-id="4526"
+              ></path>
+            </svg>
+          </span>
+        </el-tooltip>
+      </div>
+      <div class="la_b_isTel" v-else>
+        <el-tooltip
+          class="item"
+          effect="light"
+          content="暂停语音"
+          placement="top"
+          v-if="talkLoading"
+        >
+          <span @click.stop="stopTalk">
+            <svg
+              t="1721372070061"
+              class="icon"
+              viewBox="0 0 1024 1024"
+              version="1.1"
+              xmlns="http://www.w3.org/2000/svg"
+              p-id="6534"
+              width="64"
+              height="64"
+            >
+              <path
+                d="M648.45 247.01c-31.64 0-57.348 27.685-57.348 57.348v427.149c0 31.64 27.685 57.348 57.348 57.348S705.8 761.17 705.8 731.507V304.358c0-31.64-27.686-57.348-57.349-57.348z m-272.9 0c-31.64 0-57.349 27.685-57.349 57.348v427.149c0 31.64 27.686 57.348 57.349 57.348s57.348-27.685 57.348-57.348V304.358c1.978-31.64-25.708-57.348-57.348-57.348z"
+                p-id="6535"
+              ></path>
+            </svg>
+          </span>
+        </el-tooltip>
+
+        <el-tooltip
+          class="item"
+          effect="light"
+          content="朗读"
+          placement="top"
+          v-else
+        >
+          <span @click.stop="talkAllText">
+            <svg
+              t="1721785394251"
+              class="icon"
+              viewBox="0 0 1024 1024"
+              version="1.1"
+              xmlns="http://www.w3.org/2000/svg"
+              p-id="4273"
+              width="64"
+              height="64"
+            >
+              <path
+                d="M310 130.7c-31.3 0-52.4 19.9-52.4 49.5v659.6c0 30.9 25.9 53.4 61.5 53.4 17 0 32.8-5.3 43.9-14.7l444.6-309.3 1.2-1.1c13.3-12.2 20.6-28.4 20.6-45.7s-7.3-33.5-20.6-45.7l-2.1-1.7-443.3-324.9c-13.6-11.8-34.3-19.4-53.4-19.4z"
+                p-id="4274"
+              ></path>
+            </svg>
+          </span>
+        </el-tooltip>
+
+        <el-tooltip class="item" effect="light" content="挂断" placement="top">
+          <svg
+            @click.stop="stopRecord"
+            t="1721367811838"
+            viewBox="0 0 1024 1024"
+            version="1.1"
+            xmlns="http://www.w3.org/2000/svg"
+            p-id="4525"
+            width="64"
+            height="64"
+          >
+            <path
+              d="M65.771 502.182c0 246.632 199.937 446.566 446.57 446.565 246.613 0 446.549-199.934 446.551-446.565 0-246.633-199.936-446.549-446.55-446.55-246.635 0.001-446.57 199.917-446.571 446.55z m651.885-173.77c31.489 31.473 1.642 148.828-114.292 264.773C487.396 709.131 370.06 738.929 338.589 707.492c-27.278-27.315-74.96-60.574-12.892-110.423 62.087-49.886 79.429-25.343 107.582 2.772 19.674 19.711 69.436-21.368 112.394-64.328 42.94-42.996 83.986-92.719 64.368-112.43-28.155-28.153-52.679-45.511-2.792-107.562 49.904-62.049 83.125-14.405 110.406 12.891z"
+              p-id="4526"
+            ></path>
+          </svg>
+        </el-tooltip>
+        <el-tooltip class="item" effect="light" content="中断" placement="top">
+          <span @click.stop="interrupt">
+            <svg
+              t="1721372012678"
+              class="icon"
+              viewBox="0 0 1024 1024"
+              version="1.1"
+              xmlns="http://www.w3.org/2000/svg"
+              p-id="5554"
+              width="64"
+              height="64"
+            >
+              <path
+                d="M885.6 413.8c-32.3 0-60.1 19.8-71.9 47.9h-18.1c-16.6 0-30 13.4-30 30s13.4 30 30 30h18.1c11.8 28.1 39.5 47.9 71.9 47.9 42.9 0 77.9-34.9 77.9-77.9 0-42.9-35-77.9-77.9-77.9zM690.4 461.7h-21.1c-16.6 0-30 13.4-30 30s13.4 30 30 30h21.1c16.6 0 30-13.4 30-30s-13.4-30-30-30zM564.1 461.7h-10c-16.6 0-30 13.4-30 30s13.4 30 30 30h10c16.6 0 30-13.4 30-30s-13.4-30-30-30zM709.7 115.7c-13.7-9.4-32.3-5.9-41.7 7.8L436.5 461.8c-0.8-0.1-1.6-0.1-2.3-0.1H212.5c-11.8-28.1-39.5-47.9-71.9-47.9-39.4 0-72.1 29.5-77.2 67.5-1.2 3.2-1.8 6.7-1.8 10.3 0 3.6 0.6 7.1 1.8 10.3 5.1 38.1 37.7 67.5 77.2 67.5 32.3 0 60.1-19.8 71.9-47.9h183l-240.1 351c-9.4 13.7-5.9 32.3 7.8 41.7 5.2 3.5 11.1 5.2 16.9 5.2 9.6 0 19-4.6 24.8-13.1l512.6-749c9.4-13.5 5.9-32.2-7.8-41.6z"
+                p-id="5555"
+              ></path>
+            </svg>
+          </span>
+        </el-tooltip>
+      </div>
+    </div>
+    <!-- 录音转文字 -->
+    <iframe
       allow="camera *; microphone *;display-capture;midi;encrypted-media;"
       src="https://beta.cloud.cocorobo.cn/browser/public/index.html"
       ref="iiframe"
@@ -63,12 +166,10 @@
 import { v4 as uuidv4 } from "uuid";
 import MarkdownIt from "markdown-it";
 export default {
-  props: {
-
-  },
+  props: {},
   data() {
     return {
-			show: false,
+      show: false,
       showIndex: 2, //0 :在说话 1 : 接收 2:待命
       aiStatus: 0,
       aiText: "我是可可同学,我是个小小百事通,你有什么想和我聊一聊?",
@@ -81,41 +182,47 @@ export default {
       talkLoading: false,
       source: null,
       talkTextList: []
-		}
+    };
   },
-	computed: {
+  computed: {
     htmlContent() {
       const md = new MarkdownIt();
       return _md => {
         return md.render(_md);
       };
-    },
-
+    }
   },
   methods: {
-		scrollBottom(){
-			this.$nextTick(() => {
+    scrollBottom() {
+      this.$nextTick(() => {
         this.$refs.messageRef.scrollTop = this.$refs.messageRef.scrollHeight;
       });
-		},
-		recordStart(_text) {
-			// this.show = true;
-			// this.showIndex = 0;
-			// return
+    },
+    talkAllText() {
+      if (this.talkLoading && this.aiText == "") return;
+      let _resultText = this.removeMarkdown(this.aiText);
+      this.talkTextList.push(_resultText);
+      this.talkText();
+    },
+    recordStart(_text) {
+      // this.show = true;
+      // this.showIndex = 0;
+      // return
       var OpenCC = require("opencc-js");
       let converter = OpenCC.Converter({
         from: "hk",
         to: "cn"
       });
-      if (this.isOpen)return this.$message.info("已开启语音助手,无需重复开启");
+      if (this.isOpen)
+        return this.$message.info("已开启语音助手,无需重复开启");
       let iiframe = this.$refs["iiframe"];
       iiframe.contentWindow.window.document.getElementById(
         "languageOptions"
       ).selectedIndex = 2; //普通话
       iiframe.contentWindow.testdoContinuousPronunciationAssessment();
       this.isOpen = true;
-			this.show = true;
-			this.aiText = "我是可可同学,我是个小小百事通,你有什么想和我聊一聊?"
+      this.show = true;
+      this.aiText = "我是可可同学,我是个小小百事通,你有什么想和我聊一聊?";
       iiframe.contentWindow.onRecognizedResult = e => {
         let _msg = converter(e.privText);
 
@@ -141,7 +248,7 @@ export default {
             this.showTextIndex = 1;
             this.aiText = "";
             this.userText += _msg;
-						this.scrollBottom();
+            this.scrollBottom();
             this.aiStatus = 1;
             if (this.timer) {
               clearTimeout(this.timer);
@@ -173,7 +280,6 @@ export default {
                 // } else {
                 //   _time = parseInt(_numberList[1]) * 60;
                 // }
-
                 // this.$emit("startTime", _time);
                 // this.aiStatus = 0;
                 // this.showTextIndex = 0;
@@ -252,9 +358,9 @@ export default {
       };
     },
     stopRecord() {
-			// this.show = false;
-			// this.showIndex = 2;
-			// return
+      // this.show = false;
+      // this.showIndex = 2;
+      // return
       let iiframe = this.$refs["iiframe"];
       iiframe.contentWindow.window.document
         .getElementById("scenarioStopButton")
@@ -363,8 +469,8 @@ export default {
       this.source.onmessage = _e => {
         let _eData = JSON.parse(_e.data);
         if (_eData.content.replace("'", "").replace("'", "") == "[DONE]") {
-					this.source.close();
-					this.source = null;
+          this.source.close();
+          this.source = null;
           let _result = [];
           if ("result" in _eData) {
             _result = _eData.result;
@@ -374,7 +480,7 @@ export default {
           }
           _mdText = _mdText.replace("_", "");
           this.aiText = _mdText;
-					this.scrollBottom();
+          this.scrollBottom();
           if (_talkText != "") {
             let _resultText = this.removeMarkdown(_talkText);
             this.talkTextList.push(_resultText);
@@ -382,7 +488,6 @@ export default {
             if (!this.talkLoading) this.talkText();
           }
           this.chatLoading = false;
-          
         } else {
           // _talkIndex+=1;
           let _text = _eData.content.replace("'", "").replace("'", "");
@@ -400,7 +505,7 @@ export default {
           if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
           this.aiText = _mdText;
           this.showTextIndex = 0;
-					this.scrollBottom();
+          this.scrollBottom();
           if (/[,。:;?!)]/.test(_talkText)) {
             let _resultText = this.removeMarkdown(_talkText);
             this.talkTextList.push(_resultText);
@@ -435,30 +540,28 @@ export default {
       this.talkLoading = false;
     },
     stopTalk() {
-			// return this.$message.info("停止")
+      // return this.$message.info("停止")
       this.talkTextList = [];
       try {
-				let _talkTextIiframe2 = this.$refs.iiframe2;
-			_talkTextIiframe2.contentWindow.pausesynthesizer();
-      _talkTextIiframe2.contentWindow.closesynthesizer();
-			this.talkLoading = false;
-			} catch (error) {
-				this.talkLoading = false;
-			}
-      
+        let _talkTextIiframe2 = this.$refs.iiframe2;
+        _talkTextIiframe2.contentWindow.pausesynthesizer();
+        _talkTextIiframe2.contentWindow.closesynthesizer();
+        this.talkLoading = false;
+      } catch (error) {
+        this.talkLoading = false;
+      }
     },
-		interrupt(){
-			// return this.$message.info("打断")
-			if(this.source){
-				try {
-					this.source.close()
-				} catch (error) {
-					console.log(error)
-				}
-			}
-			this.stopTalk();
-			
-		}
+    interrupt() {
+      // return this.$message.info("打断")
+      if (this.source) {
+        try {
+          this.source.close();
+        } catch (error) {
+          console.log(error);
+        }
+      }
+      this.stopTalk();
+    }
   }
 };
 </script>
@@ -467,112 +570,116 @@ export default {
 .languageAssistant {
   width: 100%;
   height: 100%;
-	border-radius: 10px 0 0 10px;
-	/* background-image: linear-gradient(to top, #007adf 0%, #00ecbc 100%);
+  border-radius: 10px 0 0 10px;
+  /* background-image: linear-gradient(to top, #007adf 0%, #00ecbc 100%);
 	 */
-	 background-image: linear-gradient(-225deg, #2CD8D5 0%, #6B8DD6 48%, #8E37D7 100%);
+  background-image: linear-gradient(
+    -225deg,
+    #2cd8d5 0%,
+    #6b8dd6 48%,
+    #8e37d7 100%
+  );
   /* display: flex;
   flex-direction: column;
   align-items: center; */
   /* justify-content: center; */
   overflow: auto;
-	text-align:center;
+  text-align: center;
 }
 
-.la_coco{
-	height: 170px;
-	width: 100%;
-	display: flex;
-	justify-content: center;
-	align-items: flex-end;
+.la_coco {
+  height: 170px;
+  width: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: flex-end;
 }
 
-.la_message{
-	/* max-height: 400px; */
-	/* min-height: 400px; */
-	height: auto;
-	max-height: calc(100% - 170px - 200px - 40px);
-	width: 100%;
-	/* display: flex; */
-	padding:10px;
-	box-sizing: border-box;
-	margin: 20px 0;
-	overflow:auto;
+.la_message {
+  /* max-height: 400px; */
+  /* min-height: 400px; */
+  height: auto;
+  max-height: calc(100% - 170px - 200px - 40px);
+  width: 100%;
+  /* display: flex; */
+  padding: 10px;
+  box-sizing: border-box;
+  margin: 20px 0;
+  overflow: auto;
 }
 
-.la_m_talk{
-	/* width:100%; */
-	height:auto;
-	/* max-height: calc(100% - 170px - 200px - 40px); */
-	box-sizing: border-box;
-	
+.la_m_talk {
+  /* width:100%; */
+  height: auto;
+  /* max-height: calc(100% - 170px - 200px - 40px); */
+  box-sizing: border-box;
 }
 
-.la_m_talk>div{
-	background:#BFBFBF;
-	padding: 10px;
-	box-sizing: border-box;
-	border-radius:10px;
+.la_m_talk > div {
+  background: #bfbfbf;
+  padding: 10px;
+  box-sizing: border-box;
+  border-radius: 10px;
+  text-align: left;
 }
 
-.la_btn{
-	height: 200px;
-	width: 100%;
-	display: flex;
+.la_btn {
+  height: 200px;
+  width: 100%;
+  display: flex;
 }
 
-
-.la_b_noTel{
-	width:100%;
-	height:100%;
-	display:flex;
-	justify-content: center;
-	align-items: center;
+.la_b_noTel {
+  width: 100%;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
 }
 
-.la_b_noTel>svg{
-	fill:#52c41a;
-	width:80px;
-	height:80px;
-	cursor: pointer;
+.la_b_noTel >span> svg {
+  fill: #52c41a;
+  width: 80px;
+  height: 80px;
+  cursor: pointer;
 }
 
-.la_b_isTel{
-	width:100%;
-	height:100%;
-	display:flex;
-	justify-content: center;
-	align-items: center;
+.la_b_isTel {
+  width: 100%;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
 }
 
-.la_b_isTel>svg{
-	fill:#FF0E55;
-	width:80px;
-	height:80px;
-	cursor: pointer;
-	transform: rotate(-135deg);
+.la_b_isTel > svg {
+  fill: #ff0e55;
+  width: 80px;
+  height: 80px;
+  cursor: pointer;
+  transform: rotate(-135deg);
 }
 
-.la_b_isTel>span{
-	display: flex;
-	justify-content: center;
-	align-items:center;
-	width:45px;
-	height:45px;
-	border-radius:50%;
-	cursor: pointer;
-	margin: 0 20px;
-	padding:5px;
-	background:#BFBFBF;
+.la_b_isTel > span {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  width: 45px;
+  height: 45px;
+  border-radius: 50%;
+  cursor: pointer;
+  margin: 0 20px;
+  padding: 5px;
+  background: #bfbfbf;
 }
 
-.la_b_isTel>span>svg{
-	border:solid 2px black;
-	border-radius:50%;
-	width:100%;
-	height:100%;
-	display: flex;
-	justify-content: center;
-	align-items:center;
+.la_b_isTel > span > svg {
+  border: solid 2px black;
+  border-radius: 50%;
+  width: 100%;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
 }
 </style>