Pārlūkot izejas kodu

管乐团单元测验分数传递

liushengqiang 2 gadi atpakaļ
vecāks
revīzija
afe07d5010

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/colexiu-76f06ba7.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/colexiu-legacy-9f8b02e4.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-29f04850.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-85bb3328.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-aa4f2764.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-aac4f622.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-legacy-3b84ba9e.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-legacy-7da5f470.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-legacy-ca1f829c.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-legacy-f3d119da.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/orchestra-7e004990.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/orchestra-legacy-3226c5d9.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/polyfills-legacy-5b203273.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/report-share-eef2d1f8.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/report-share-legacy-64380fe8.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/vue3-lottie.es-1ffa0ff6.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/vue3-lottie.es-legacy-2b6c4d63.js


+ 7 - 7
dist/colexiu.html

@@ -22,11 +22,11 @@
       display: block;
     }
   </style>
-  <script type="module" crossorigin src="./assets/colexiu-525a8697.js"></script>
-  <link rel="modulepreload" crossorigin href="./assets/index-78819d9a.js">
-  <link rel="modulepreload" crossorigin href="./assets/index-1a8293fe.js">
-  <link rel="modulepreload" crossorigin href="./assets/vue3-lottie.es-cf25b0fb.js">
-  <link rel="modulepreload" crossorigin href="./assets/index-c3c2eb2e.js">
+  <script type="module" crossorigin src="./assets/colexiu-76f06ba7.js"></script>
+  <link rel="modulepreload" crossorigin href="./assets/index-29f04850.js">
+  <link rel="modulepreload" crossorigin href="./assets/index-85bb3328.js">
+  <link rel="modulepreload" crossorigin href="./assets/vue3-lottie.es-1ffa0ff6.js">
+  <link rel="modulepreload" crossorigin href="./assets/index-aa4f2764.js">
   <link rel="stylesheet" href="./assets/index-996a25e4.css">
   <link rel="stylesheet" href="./assets/index-fc8404d2.css">
   <link rel="stylesheet" href="./assets/colexiu-7ef7fd8c.css">
@@ -39,8 +39,8 @@
   <img id="loading" class="show" src="./loading.svg" alt="loading" />
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
-  <script nomodule crossorigin id="vite-legacy-polyfill" src="./assets/polyfills-legacy-db3263a8.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./assets/colexiu-legacy-e7de07a2.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-polyfill" src="./assets/polyfills-legacy-5b203273.js"></script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./assets/colexiu-legacy-9f8b02e4.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 6 - 6
dist/index.html

@@ -73,10 +73,10 @@
       }
     })
   </script>
-  <script type="module" crossorigin src="./assets/index-828b67db.js"></script>
-  <link rel="modulepreload" crossorigin href="./assets/index-78819d9a.js">
-  <link rel="modulepreload" crossorigin href="./assets/index-1a8293fe.js">
-  <link rel="modulepreload" crossorigin href="./assets/index-c3c2eb2e.js">
+  <script type="module" crossorigin src="./assets/index-aac4f622.js"></script>
+  <link rel="modulepreload" crossorigin href="./assets/index-29f04850.js">
+  <link rel="modulepreload" crossorigin href="./assets/index-85bb3328.js">
+  <link rel="modulepreload" crossorigin href="./assets/index-aa4f2764.js">
   <link rel="stylesheet" href="./assets/index-996a25e4.css">
   <link rel="stylesheet" href="./assets/index-fc8404d2.css">
   <link rel="stylesheet" href="./assets/index-efde85b1.css">
@@ -93,8 +93,8 @@
   <img id="loading" class="show" src="./loading.svg" alt="loading" />
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
-  <script nomodule crossorigin id="vite-legacy-polyfill" src="./assets/polyfills-legacy-db3263a8.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./assets/index-legacy-2b16d8a8.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-polyfill" src="./assets/polyfills-legacy-5b203273.js"></script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./assets/index-legacy-ca1f829c.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 6 - 6
dist/orchestra.html

@@ -23,10 +23,10 @@
       transition: opacity .3s;
     }
   </style>
-  <script type="module" crossorigin src="./assets/orchestra-87670ed5.js"></script>
-  <link rel="modulepreload" crossorigin href="./assets/index-78819d9a.js">
-  <link rel="modulepreload" crossorigin href="./assets/index-1a8293fe.js">
-  <link rel="modulepreload" crossorigin href="./assets/vue3-lottie.es-cf25b0fb.js">
+  <script type="module" crossorigin src="./assets/orchestra-7e004990.js"></script>
+  <link rel="modulepreload" crossorigin href="./assets/index-29f04850.js">
+  <link rel="modulepreload" crossorigin href="./assets/index-85bb3328.js">
+  <link rel="modulepreload" crossorigin href="./assets/vue3-lottie.es-1ffa0ff6.js">
   <link rel="stylesheet" href="./assets/index-996a25e4.css">
   <link rel="stylesheet" href="./assets/index-fc8404d2.css">
   <link rel="stylesheet" href="./assets/orchestra-b1847d4d.css">
@@ -50,8 +50,8 @@
   </script>
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
-  <script nomodule crossorigin id="vite-legacy-polyfill" src="./assets/polyfills-legacy-db3263a8.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./assets/orchestra-legacy-a5429519.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-polyfill" src="./assets/polyfills-legacy-5b203273.js"></script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./assets/orchestra-legacy-3226c5d9.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 4 - 4
dist/report-share.html

@@ -23,8 +23,8 @@
       transition: opacity .3s;
     }
   </style>
-  <script type="module" crossorigin src="./assets/report-share-7c703656.js"></script>
-  <link rel="modulepreload" crossorigin href="./assets/index-78819d9a.js">
+  <script type="module" crossorigin src="./assets/report-share-eef2d1f8.js"></script>
+  <link rel="modulepreload" crossorigin href="./assets/index-29f04850.js">
   <link rel="stylesheet" href="./assets/index-996a25e4.css">
   <link rel="stylesheet" href="./assets/report-share-f275da6a.css">
   <script type="module">import.meta.url;import("_").catch(()=>1);async function* g(){};window.__vite_is_modern_browser=true;</script>
@@ -47,8 +47,8 @@
   </script>
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
-  <script nomodule crossorigin id="vite-legacy-polyfill" src="./assets/polyfills-legacy-db3263a8.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./assets/report-share-legacy-8f0f8072.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-polyfill" src="./assets/polyfills-legacy-5b203273.js"></script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./assets/report-share-legacy-64380fe8.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 20 - 2
src/page-orchestra/evaluat-model/index.tsx

@@ -33,6 +33,7 @@ type TCriteria = "frequency" | "amplitude" | "decibels";
 export default defineComponent({
 	name: "evaluat-model",
 	setup() {
+		const query = getQuery()
 		const evaluatModel = reactive({
 			tips: true,
 			evaluatUpdateAudio: false,
@@ -76,7 +77,6 @@ export default defineComponent({
 					return index >= startIndex && index <= endIndex;
 				});
 				starTime = times[0].sourceRelativeTime || times[0].relativeTime;
-				console.log("🚀 ~ times", times);
 			}
 			let measureIndex = -1;
 			let recordMeasure = -1;
@@ -135,7 +135,6 @@ export default defineComponent({
 		};
 		/** 生成数据 */
 		const hanldeCreateData = async () => {
-			const query = getQuery()
 			const behaviorId = localStorage.getItem("behaviorId") || undefined;
 			const rate = state.speed / state.originSpeed;
 			const content = {
@@ -221,6 +220,25 @@ export default defineComponent({
 				}
 			}
 		);
+		/** 监听评测结束 */
+		watch(() => evaluatingData.resulstMode, () => {
+			// 评测结束, 并且完整评测
+			if (evaluatingData.resulstMode && evaluatingData.isComplete){
+				/** 有单元测验时,存储分数缓存 */
+				postMessage({
+					api: 'setCache',
+					content: {
+					  key: 'h5-orchestra-unit',
+					  value: JSON.stringify({
+						musicId: query.id || '',
+						unitId: query.unitId || '',
+						questionId: query.questionId || '',
+						score: evaluatingData.resultData?.score || 0,
+					  }),
+					},
+				  })
+			}
+		})
 		return () => (
 			<div>
 				<Transition name="pop-center">

+ 1 - 1
src/state.ts

@@ -201,7 +201,7 @@ export const onEnded = () => {
 	// 结束播放
 	audioListStart(state.playState);
 	// 调用结束评测
-	handleEndEvaluat();
+	handleEndEvaluat(true);
 	// 调用自动重复播放
 	autoResetPlay();
 };

+ 7 - 1
src/view/evaluating/index.tsx

@@ -20,6 +20,7 @@ import state, { clearSelection, handleStopPlay, resetPlaybackToStart, togglePlay
 import { IPostMessage } from "/src/utils/native-message";
 import { usePageVisibility } from "@vant/use";
 export const evaluatingData = reactive({
+	/** 评测数据 */
 	contentData: {} as any,
 	/** 评测模块是否加载完成 */
 	rendered: false,
@@ -39,6 +40,8 @@ export const evaluatingData = reactive({
 	resultData: {} as any,
 	/** 评测结果弹窗 */
 	resulstMode: false,
+	/** 是否是完整评测 */
+	isComplete: false,
 });
 
 /** 点击开始评测按钮 */
@@ -201,8 +204,10 @@ export const handleStartBegin = async () => {
 
 /**
  * 结束评测
+ * @param isComplete 是否完整评测
+ * @returns 
  */
-export const handleEndEvaluat = () => {
+export const handleEndEvaluat = (isComplete = false) => {
 	console.log("触发结束");
 	// 没有开始评测 , 不是评测模式 , 不评分
 	if (!evaluatingData.startBegin || state.modeType !== "evaluating") return;
@@ -218,6 +223,7 @@ export const handleEndEvaluat = () => {
 		duration: 0,
 		forbidClick: true,
 	});
+	evaluatingData.isComplete = isComplete
 };
 
 /**

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels