Jelajahi Sumber

Merge branch 'beta' into HK

lsc 9 bulan lalu
induk
melakukan
e8e8d8efc7

+ 1 - 1
dist/index.html

@@ -27,7 +27,7 @@
     html,
     body{
       font-family: '黑体';
-    }</style><link href=./static/css/app.b3a469229ddb63f21eab8d0f54428a00.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.c0ee66fa35994fdf36e3.js></script><script type=text/javascript src=./static/js/app.393bea2b714adcd69b35.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.78a33af1c1daca2ba49aecaa007c6936.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.231e1498b0c571af4492.js></script><script type=text/javascript src=./static/js/app.f586f6a3c07a1f5864a5.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/css/app.78a33af1c1daca2ba49aecaa007c6936.css


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/css/app.78a33af1c1daca2ba49aecaa007c6936.css.map


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/css/app.b3a469229ddb63f21eab8d0f54428a00.css.map


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/app.f586f6a3c07a1f5864a5.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/app.f586f6a3c07a1f5864a5.js.map


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/vendor.231e1498b0c571af4492.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/vendor.231e1498b0c571af4492.js.map


+ 11 - 0
package-lock.json

@@ -26,6 +26,7 @@
         "lamejs": "^1.2.1",
         "language-hk-loader": "^1.0.1",
         "markdown-it": "^13.0.1",
+        "opencc-js": "^1.0.5",
         "pdfjs-dist": "^2.5.207",
         "pdfvuer": "^1.7.5",
         "qrcodejs2": "^0.0.2",
@@ -16009,6 +16010,11 @@
         "node": ">=8"
       }
     },
+    "node_modules/opencc-js": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmmirror.com/opencc-js/-/opencc-js-1.0.5.tgz",
+      "integrity": "sha512-LD+1SoNnZdlRwtYTjnQdFrSVCAaYpuDqL5CkmOaHOkKoKh7mFxUicLTRVNLU5C+Jmi1vXQ3QL4jWdgSaa4sKjg=="
+    },
     "node_modules/opener": {
       "version": "1.5.2",
       "resolved": "https://registry.npm.taobao.org/opener/download/opener-1.5.2.tgz",
@@ -37481,6 +37487,11 @@
         "is-wsl": "^1.1.0"
       }
     },
+    "opencc-js": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmmirror.com/opencc-js/-/opencc-js-1.0.5.tgz",
+      "integrity": "sha512-LD+1SoNnZdlRwtYTjnQdFrSVCAaYpuDqL5CkmOaHOkKoKh7mFxUicLTRVNLU5C+Jmi1vXQ3QL4jWdgSaa4sKjg=="
+    },
     "opener": {
       "version": "1.5.2",
       "resolved": "https://registry.npm.taobao.org/opener/download/opener-1.5.2.tgz",

+ 1 - 0
package.json

@@ -30,6 +30,7 @@
     "lamejs": "^1.2.1",
     "language-hk-loader": "^1.0.1",
     "markdown-it": "^13.0.1",
+    "opencc-js": "^1.0.5",
     "pdfjs-dist": "^2.5.207",
     "pdfvuer": "^1.7.5",
     "qrcodejs2": "^0.0.2",

+ 1 - 1
src/components/EnglishVoice2/component/right.vue

@@ -71,7 +71,7 @@
       </div>
     </div>
     <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;"
-      src="https://beta.cloud.cocorobo.cn/browser/public/index.html" ref="iiframe" v-show="false"></iframe>
+      src="https://cloud.cocorobo.hk/browser/public/index.html" ref="iiframe" v-show="false"></iframe>
   </div>
 </template>
 

+ 1 - 1
src/components/EnglishVoice2/component/testRole new.vue

@@ -94,7 +94,7 @@
       </div>
     </div>
     <!-- <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;"
-                src="https://beta.cloud.cocorobo.cn/browser/public/index.html" ref="iiframe"></iframe> -->
+                src="https://cloud.cocorobo.hk/browser/public/index.html" ref="iiframe"></iframe> -->
   </div>
 </template>
     

+ 1 - 1
src/components/EnglishVoice2/component/testRole.vue

@@ -13,7 +13,7 @@
             </div>
         </div>
         <!-- <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;"
-                src="https://beta.cloud.cocorobo.cn/browser/public/index.html" ref="iiframe"></iframe> -->
+                src="https://cloud.cocorobo.hk/browser/public/index.html" ref="iiframe"></iframe> -->
     </div>
 </template>
     

+ 1 - 1
src/components/checkEnglishVoice/component/testRole.vue

@@ -13,7 +13,7 @@
             </div>
         </div>
         <!-- <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;"
-                src="https://beta.cloud.cocorobo.cn/browser/public/index.html" ref="iiframe"></iframe> -->
+                src="https://cloud.cocorobo.hk/browser/public/index.html" ref="iiframe"></iframe> -->
     </div>
 </template>
     

+ 13 - 4
src/components/classRoomHelper/component/dialogArea.vue

@@ -248,6 +248,12 @@
 <script>
 import { v4 as uuidv4 } from "uuid";
 import MarkdownIt from "markdown-it";
+
+var OpenCC = require("opencc-js");
+let converter = OpenCC.Converter({
+		from:'cn',
+		to:'hk'
+})
 export default {
 	props:{
 		fileId:{
@@ -399,10 +405,11 @@ export default {
         this.ajax
           .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
           .then(res => {
-            if (res.data.FunctionResponse.result == "发送成功") {
+            if (converter(res.data.FunctionResponse.result) == converter("发送成功")) {
             } else {
               this.chatLoading = false;
-              this.$message.warning(res.data.FunctionResponse.result);
+							console.log(res.data.FunctionResponse.result)
+              //this.$message.warning(res.data.FunctionResponse.result);
             }
           })
           .catch(err => {
@@ -494,10 +501,11 @@ export default {
           // .post("https://gpt4.cocorobo.cn/chat", params)
 					.post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
           .then(res => {
-            if (res.data.FunctionResponse.result == "发送成功") {
+            if (converter(res.data.FunctionResponse.result) == converter("发送成功")) {
             } else {
               this.chatLoading = false;
-              this.$message.warning(res.data.FunctionResponse.result);
+              // this.$message.warning(res.data.FunctionResponse.result);
+							console.log(res.data.FunctionResponse.result)
             }
           })
           .catch(e => {
@@ -828,6 +836,7 @@ export default {
         })
         .catch(e => {
           this.chatLoading = false;
+					this.chatList.find(i => i.uid == _uuid).loading = false;
           console.log(e);
         });
 		},

+ 82 - 52
src/components/classRoomHelper/component/levitatedSphere.vue

@@ -40,7 +40,7 @@
     <!-- 录音转文字 -->
     <iframe
       allow="camera *; microphone *;display-capture;midi;encrypted-media;"
-      src="https://beta.cloud.cocorobo.cn/browser/public/index.html"
+      src="https://cloud.cocorobo.hk/browser/public/index.html"
       ref="iiframe"
       v-show="false"
     ></iframe>
@@ -48,7 +48,7 @@
     <!-- 文字转语音-->
     <iframe
       allow="camera *; microphone *;display-capture;midi;encrypted-media;"
-      src="https://beta.cloud.cocorobo.cn/browser/public/index1.html"
+      src="https://cloud.cocorobo.hk/browser/public/index1.html"
       ref="iiframe2"
       v-show="false"
     ></iframe>
@@ -86,6 +86,11 @@ export default {
   },
   methods: {
     recordStart(_text) {
+      var OpenCC = require("opencc-js");
+      let converter = OpenCC.Converter({
+        from: "cn",
+        to: "hk"
+      });
       // try {
       // this.$parent.changeRecordType(1);
       // return this.$message.success("已开启语音助手,请说“可可同学”来唤醒")
@@ -100,12 +105,14 @@ export default {
       this.$parent.changeRecordType(1);
       this.isOpen = true;
       iiframe.contentWindow.onRecognizedResult = e => {
-        let _msg = e.privText;
+        let _msg = converter(e.privText);
+        // let _msg2 = e.privText;
         // let _msg = _text;
         console.log("👇");
         console.log(_msg);
+        // _msg = converter(_msg)
         if (!_msg) return console.log("输出为空");
-        if (_msg.indexOf("可可同学") != -1 && !this.show) {
+        if (_msg.indexOf(converter("可可同学")) != -1 && !this.show) {
           this.aiText = "您好,我是小可,有什么可以帮助您的?";
           this.aiStatus = 0;
           this.showIndex = 0;
@@ -113,12 +120,19 @@ export default {
           console.log("已唤醒");
           return;
         } else if (this.show == true) {
-					if(_msg.indexOf('可可同学')!=-1 && _msg.indexOf("停止")!=-1){
-						this.stopTalk();
-          }else if (this.showTextIndex == 2 || this.chatLoading || this.talkLoading) {
+          if (
+            _msg.indexOf(converter("可可同学")) != -1 &&
+            _msg.indexOf(converter("停止")) != -1
+          ) {
+            this.stopTalk();
+          } else if (
+            this.showTextIndex == 2 ||
+            this.chatLoading ||
+            this.talkLoading
+          ) {
             return console.log("组织语言中");
-					// }else if(_msg.indexOf('可可同学')!=-1 && _msg.indexOf("停止")!=-1){
-					// 	this.stopTalk();
+            // }else if(_msg.indexOf('可可同学')!=-1 && _msg.indexOf("停止")!=-1){
+            // 	this.stopTalk();
           } else {
             this.showTextIndex = 1;
             this.aiText = "";
@@ -129,10 +143,10 @@ export default {
               this.timer = null;
             }
             this.timer = setTimeout(() => {
-              if (this.userText.indexOf("关闭语音助手") != -1) {
+              if (this.userText.indexOf(converter("关闭语音助手")) != -1) {
                 // return setTimeout(()=>{
                 this.show = false;
-								this.showTextIndex = 3;
+                this.showTextIndex = 3;
                 this.aiStatus = 2;
                 this.aiText = "";
                 this.userText = "";
@@ -142,9 +156,12 @@ export default {
               }
               this.showTextIndex = 2;
               this.aiText = "";
-              if (/计时(.+)分钟/.test(this.userText)) {
+              let regExp = new RegExp(
+                converter("计时") + "(.+)" + converter("分钟")
+              );
+              if (regExp.test(this.userText)) {
                 // setTimeout(() => {
-                let _number = this.userText.match(/计时(.+)分钟/)[1];
+                let _number = this.userText.match(regExp)[1];
                 let _time = 0;
                 if (!/^\d+$/.test(_number)) {
                   _time = this.chineseToNumber(_number) * 60;
@@ -156,7 +173,7 @@ export default {
                 this.showTextIndex = 0;
                 this.aiText =
                   "好的,我已为您计时" +
-                  this.userText.match(/计时(.+)分钟/)[1] +
+                  this.userText.match(regExp)[1] +
                   "分钟。";
                 this.userText = "";
                 this.timer = setTimeout(() => {
@@ -185,7 +202,10 @@ export default {
                     params
                   )
                   .then(res => {
-                    if (res.data.FunctionResponse.result == "发送成功") {
+                    if (
+                      converter(res.data.FunctionResponse.result) ==
+                      converter("发送成功")
+                    ) {
                       this.userText = "";
                     } else {
                       // this.$message.warning(res.data.FunctionResponse.result);
@@ -240,16 +260,16 @@ export default {
       iiframe.contentWindow.window.document
         .getElementById("scenarioStopButton")
         .click();
-				if(this.talkLoading){
-					this.stopTalk();
-				}
-			// this.stopTalk();
+      if (this.talkLoading) {
+        this.stopTalk();
+      }
+      // this.stopTalk();
       // 录音借宿
       iiframe.contentWindow.onSessionStopped = (s, e) => {
         this.isOpen = false;
         this.show = false;
         this.showTextIndex = 3;
-				this.showIndex = 2;
+        this.showIndex = 2;
         this.$parent.changeRecordType(0);
         this.$message.success("已关闭语音助手");
         if (this.talkLoading) {
@@ -260,6 +280,12 @@ export default {
       };
     },
     chineseToNumber(chinese) {
+      var OpenCC = require("opencc-js");
+      let converter = OpenCC.Converter({
+        from: "cn",
+        to: "hk"
+      });
+      chinese = converter(chinese);
       const chineseNumbers = {
         零: 0,
         一: 1,
@@ -399,15 +425,19 @@ export default {
           this.timer = null;
         }
         console.log(`👉转语音:${_text}`);
-				// if(this.talkTextList.length==0){
-				// 	console.log("👉最后一个了,执行结束 👈")
-				// 	_talkTextIiframe2.contentWindow.closesynthesizer();
-				// }
+        // if(this.talkTextList.length==0){
+        // 	console.log("👉最后一个了,执行结束 👈")
+        // 	_talkTextIiframe2.contentWindow.closesynthesizer();
+        // }
         // setTimeout(()=>{
         // 	this.talkText();
         // },2000)
-        _talkTextIiframe2.contentWindow.texttospeech(_text, this.talkText,this.endTalk);
-      }else {
+        _talkTextIiframe2.contentWindow.texttospeech(
+          _text,
+          this.talkText,
+          this.endTalk
+        );
+      } else {
         // console.log("👉转语音结束👈");
         _talkTextIiframe2.contentWindow.closesynthesizer();
         // this.talkLoading = false;
@@ -420,24 +450,24 @@ export default {
         // }, 5000);
       }
     },
-		endTalk(){
-			console.log("👉转语音结束👈");
-			// let _talkTextIiframe2 = this.$refs.iiframe2;
-			// _talkTextIiframe2.contentWindow.closesynthesizer();
-			this.talkLoading = false;
-		},
-		stopTalk(){
-			this.talkTextList = [];
+    endTalk() {
+      console.log("👉转语音结束👈");
+      // let _talkTextIiframe2 = this.$refs.iiframe2;
+      // _talkTextIiframe2.contentWindow.closesynthesizer();
+      this.talkLoading = false;
+    },
+    stopTalk() {
+      this.talkTextList = [];
 
-			let _talkTextIiframe2 = this.$refs.iiframe2;
-			_talkTextIiframe2.contentWindow.closesynthesizer();
-			_talkTextIiframe2.contentWindow.pausesynthesizer();
-			this.talkLoading = false;
-			// this.talkLoading = false;
-			// this.talkLoading = false;
-			// let _talkTextIiframe2 = this.$refs.iiframe2;
-			// _talkTextIiframe2.contentWindow.closesynthesizer();
-		},
+      let _talkTextIiframe2 = this.$refs.iiframe2;
+      _talkTextIiframe2.contentWindow.closesynthesizer();
+      _talkTextIiframe2.contentWindow.pausesynthesizer();
+      this.talkLoading = false;
+      // this.talkLoading = false;
+      // this.talkLoading = false;
+      // let _talkTextIiframe2 = this.$refs.iiframe2;
+      // _talkTextIiframe2.contentWindow.closesynthesizer();
+    }
   },
   mounted() {
     // // this.recordStart()
@@ -471,19 +501,19 @@ export default {
   position: absolute;
   top: 0;
   right: 0;
-	animation: smallToBig 1s both;
+  animation: smallToBig 1s both;
 }
 
 /* 定义渐入动画 */
 @keyframes smallToBig {
-    from {
-        opacity: 0;
-        transform: scale(0.1);
-    }
-    to {
-        opacity: 1;
-        transform: scale(1);
-    }
+  from {
+    opacity: 0;
+    transform: scale(0.1);
+  }
+  to {
+    opacity: 1;
+    transform: scale(1);
+  }
 }
 
 .ls_text {

+ 18 - 8
src/components/classRoomHelper/component/searchArea.vue

@@ -490,6 +490,11 @@
 import { v4 as uuidv4 } from "uuid";
 import MarkdownIt from "markdown-it";
 import { tools } from "../../../common/tools";
+var OpenCC = require("opencc-js");
+let converter = OpenCC.Converter({
+		from:'cn',
+		to:'hk'
+})
 export default {
   props: {
     courseDetail: {
@@ -1032,9 +1037,10 @@ export default {
         // .post("https://gpt4.cocorobo.cn/chat", params)
 				.post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
         .then(res => {
-          if (res.data.FunctionResponse.result == "发送成功") {
+          if (converter(res.data.FunctionResponse.result) == converter("发送成功")) {
           } else {
-            this.$message.warning(res.data.FunctionResponse.result);
+            // this.$message.warning(res.data.FunctionResponse.result);
+						console.log(res.data.FunctionResponse.result)
             this.chatLoading = false;
           }
         })
@@ -1198,9 +1204,10 @@ ${_atList
         // .post("https://claude3.cocorobo.cn/chat", params)
 				.post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
         .then(res => {
-          if (res.data.FunctionResponse.result == "发送成功") {
+          if (converter(res.data.FunctionResponse.result) == converter("发送成功")) {
           } else {
-            this.$message.warning(res.data.FunctionResponse.result);
+            // this.$message.warning(res.data.FunctionResponse.result);
+						console.log(res.data.FunctionResponse.result)
             this.chatLoading = false;
           }
         })
@@ -1684,6 +1691,7 @@ Instruction: Based on the context, follow "Format example", write content
         })
         .catch(e => {
           this.chatLoading = false;
+					this.chatList.find(i => i.uid == _uuid).loading = false;
           console.log(e);
         });
 		},
@@ -1930,10 +1938,11 @@ ${_wordData}
             // .post("https://claude3.cocorobo.cn/chat", params)
 						.post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
             .then(res => {
-              if (res.data.FunctionResponse.result == "发送成功") {
+              if (converter(res.data.FunctionResponse.result) == converter("发送成功")) {
                 this.loading = false;
               } else {
-                this.$message.warning(res.data.FunctionResponse.result);
+                // this.$message.warning(res.data.FunctionResponse.result);
+								console.log(res.data.FunctionResponse.result)
                 this.chatLoading = false;
                 this.loading = false;
               }
@@ -2123,9 +2132,10 @@ ${_wordData}
         // .post("https://claude3.cocorobo.cn/chat", params)
 				.post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
         .then(res => {
-          if (res.data.FunctionResponse.result == "发送成功") {
+          if (converter(res.data.FunctionResponse.result) == converter("发送成功")) {
           } else {
-            this.$message.warning(res.data.FunctionResponse.result);
+            // this.$message.warning(res.data.FunctionResponse.result);
+						console.log(res.data.FunctionResponse.result)
             this.chatLoading = false;
           }
         })

+ 12 - 4
src/components/classRoomHelper/component/taskArea.vue

@@ -188,6 +188,11 @@
 import { v4 as uuidv4 } from "uuid";
 import MarkdownIt from "markdown-it";
 import { tools } from "../../../common/tools";
+var OpenCC = require("opencc-js");
+let converter = OpenCC.Converter({
+		from:'cn',
+		to:'hk'
+})
 export default {
   props: {
     courseDetail: {
@@ -682,9 +687,10 @@ export default {
         // .post("https://gpt4.cocorobo.cn/chat", params)
 				.post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
         .then(res => {
-          if (res.data.FunctionResponse.result == "发送成功") {
+          if (converter(res.data.FunctionResponse.result) == converter("发送成功")) {
           } else {
-            this.$message.warning(res.data.FunctionResponse.result);
+            // this.$message.warning(res.data.FunctionResponse.result);
+						console.log(res.data.FunctionResponse.result)
             this.chatLoading = false;
           }
         })
@@ -902,9 +908,10 @@ Instruction: Based on the context, follow "Format example", write content.
 				.post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
         // .post("https://gpt4.cocorobo.cn/chat", params)
         .then(res => {
-          if (res.data.FunctionResponse.result == "发送成功") {
+          if (converter(res.data.FunctionResponse.result) == converter("发送成功")) {
           } else {
-            this.$message.warning(res.data.FunctionResponse.result);
+            //this.$message.warning(res.data.FunctionResponse.result);
+						console.log(res.data.FunctionResponse.result)
             this.chatLoading = false;
           }
         })
@@ -1022,6 +1029,7 @@ Instruction: Based on the context, follow "Format example", write content.
         })
         .catch(e => {
           this.chatLoading = false;
+					this.chatList.find(i => i.uid == _uuid).loading = false;
           console.log(e);
         });
 		},

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini