Browse Source

酷乐秀

liushengqiang 2 years ago
parent
commit
099e1167f6

+ 17 - 1
colexiu.html

@@ -6,7 +6,7 @@
   <link rel="icon" type="image/svg+xml" href="/vite.svg" />
   <meta name="viewport"
     content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
-  <title>酷乐秀</title>
+  <title>小酷AI</title>
   <link rel="icon" href="/favicon.ico" />
   <script src="/flexible.js" charset="UTF-8"></script>
   <style>
@@ -22,6 +22,22 @@
       display: block;
     }
   </style>
+  <script>
+    function _postMessage(data, callback) {
+      const instance = window.COLEXIU || (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.COLEXIU)
+      if (instance) {
+        console.log('h5发送开启全屏loading')
+        instance.postMessage(JSON.stringify(data))
+      }
+    }
+    _postMessage({
+      api: 'cloudLoading',
+      content: {
+        show: true,
+        type: 'fullscreen',
+      },
+    })
+  </script>
 </head>
 
 <body>

+ 3 - 3
src/helpers/communication.ts

@@ -145,12 +145,12 @@ export const api_back = () => {
 		api: "back",
 	});
 };
-/** 关闭loading */
-export const api_cloudLoading = () => {
+/** 切换全屏loading */
+export const api_cloudLoading = (show = false) => {
 	postMessage({
 		api: "cloudLoading",
 		content: {
-			show: false,
+			show,
 			type: "fullscreen",
 		},
 	});

+ 1 - 1
src/page-colexiu/evaluat-model/index.module.less

@@ -22,7 +22,7 @@
   .endBtn{
     position: fixed;
     left: 50%;
-    top: 16px;
+    bottom: 16px;
     width: 120px;
     height: 40px;
     margin-left: -70px;

+ 2 - 10
src/page-colexiu/evaluat-model/index.tsx

@@ -40,13 +40,6 @@ export default defineComponent({
 			isSaveVideo: state.setting.camera && state.setting.saveToAlbum,
 			shareMode: false,
 		});
-		/**
-		 * 木管(长笛 萨克斯 单簧管)乐器一级的2、3、6测评要放原音音频
-		 * 铜管乐器一级的1a,1b,5,6测评要放原音音频
-		 */
-		const getMusicMode = () => {
-			return "music";
-		};
 		const browserInfo = browser();
 		/** 是否是节奏练习 */
 		const isRhythmicExercises = () => {
@@ -141,10 +134,9 @@ export default defineComponent({
 				speed: state.speed,
 				heardLevel: state.setting.evaluationDifficulty,
 				beatLength: Math.round((state.fixtime * 1000) / rate),
-				// evaluationCriteria: getEvaluationCriteria(),
 			};
 			await connectWebsocket(content);
-			state.playSource = "music";
+			// state.playSource = "music";
 		};
 
 		/** 评测结果按钮处理 */
@@ -202,7 +194,7 @@ export default defineComponent({
 			() => evaluatingData.checkEnd,
 			() => {
 				if (evaluatingData.checkEnd) {
-					console.log("检测结束,连接websocket");
+					console.log("检测结束,生成数据");
 					handleConnect();
 				}
 			}

+ 1 - 1
src/state.ts

@@ -476,7 +476,7 @@ export const scrollViewNote = () => {
 	offsetTop = cursorElement.offsetTop;
 	if (offsetTop > 50) {
 		musicAndSelection.scrollTo({
-			top: (offsetTop - 40) * state.musicZoom ,
+			top: (offsetTop - 50) * state.musicZoom ,
 			behavior: "smooth",
 		});
 	} else {