Pārlūkot izejas kodu

Merge branch 'gym-online' into feature-patch

TIANYONG 1 mēnesi atpakaļ
vecāks
revīzija
3f55f225cf

+ 4 - 4
dist/instrument.html

@@ -41,9 +41,9 @@
       })
     }
   </script>
-  <script type="module" crossorigin src="./js/instrument-8d283b10.js"></script>
-  <link rel="modulepreload" crossorigin href="./js/node_modules-dbbb91f3.js">
-  <link rel="modulepreload" crossorigin href="./js/src-51e11e57.js">
+  <script type="module" crossorigin src="./js/instrument-19994ef7.js"></script>
+  <link rel="modulepreload" crossorigin href="./js/node_modules-081fca9f.js">
+  <link rel="modulepreload" crossorigin href="./js/src-f076abb8.js">
   <link rel="stylesheet" href="./css/instrument-9723cd86.css">
   <script type="module">import.meta.url;import("_").catch(()=>1);async function* g(){};window.__vite_is_modern_browser=true;</script>
   <script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
@@ -128,7 +128,7 @@
   </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="./js/polyfills-legacy-00a2b340.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/instrument-legacy-a8b01f33.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/instrument-legacy-827ff9a8.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

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


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


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


+ 1 - 1
dist/js/index-7f64e00e.js → dist/js/index-daba13d5.js

@@ -1 +1 @@
-import{d as s,g as a,r as e,E as t,o,s as n,c as i,M as r}from"./instrument-8d283b10.js";import"./node_modules-dbbb91f3.js";import"./src-51e11e57.js";const d="_detail_vtlsh_12",l="_container_vtlsh_20",c=s({name:"music-list",setup(){const s=a(),c=e({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:t.staff,base64:""},{state:!1,name:"首调",type:t.firstTone,base64:""},{state:!1,name:"固定调",type:t.fixedTone,base64:""}]});o((()=>{window.appName="colexiu",n.xmlUrl=s.xmlUrl,c.isLoading=!1}));const m=async()=>{console.log("渲染完成")};return()=>i("div",{class:d},[i("div",{id:"scrollContainer",class:[l,"hideCursor"]},[!c.isLoading&&i(r,{onRendered:m},null)])])}});export{c as default};
+import{d as s,g as a,r as e,E as t,o,s as n,c as i,M as r}from"./instrument-19994ef7.js";import"./node_modules-081fca9f.js";import"./src-f076abb8.js";const d="_detail_vtlsh_12",l="_container_vtlsh_20",c=s({name:"music-list",setup(){const s=a(),c=e({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:t.staff,base64:""},{state:!1,name:"首调",type:t.firstTone,base64:""},{state:!1,name:"固定调",type:t.fixedTone,base64:""}]});o((()=>{window.appName="colexiu",n.xmlUrl=s.xmlUrl,c.isLoading=!1}));const m=async()=>{console.log("渲染完成")};return()=>i("div",{class:d},[i("div",{id:"scrollContainer",class:[l,"hideCursor"]},[!c.isLoading&&i(r,{onRendered:m},null)])])}});export{c as default};

+ 1 - 1
dist/js/index-legacy-56cd2179.js → dist/js/index-legacy-41d4f9ac.js

@@ -1 +1 @@
-System.register(["./instrument-legacy-a8b01f33.js","./node_modules-legacy-c1f7d33d.js","./src-legacy-25faba2c.js"],(function(e,t){"use strict";var n,i,a,o,s,r,l,d,c=document.createElement("style");return c.textContent="._skeleton_vtlsh_1{position:fixed;left:0;top:0;width:100vw;height:100vh;padding:.53333rem .8rem;background-color:#fff;z-index:1000;--van-skeleton-paragraph-height: .8rem}._detail_vtlsh_12{width:100vw;height:100vh;overflow:hidden;overflow-y:auto;--header-height: 1.65333rem;background:var(--container-background)}._detail_vtlsh_12 ._container_vtlsh_20{margin:0 .26667rem;border-radius:.26667rem}._detail_vtlsh_12 #musicAndSelection{overflow:initial!important;height:initial!important;max-height:initial!important}\n",document.head.appendChild(c),{setters:[e=>{n=e.d,i=e.g,a=e.r,o=e.E,s=e.o,r=e.s,l=e.c,d=e.M},null,null],execute:function(){const t="_detail_vtlsh_12",c="_container_vtlsh_20";e("default",n({name:"music-list",setup(){const e=i(),n=a({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:o.staff,base64:""},{state:!1,name:"首调",type:o.firstTone,base64:""},{state:!1,name:"固定调",type:o.fixedTone,base64:""}]});s((()=>{window.appName="colexiu",r.xmlUrl=e.xmlUrl,n.isLoading=!1}));const h=async()=>{console.log("渲染完成")};return()=>l("div",{class:t},[l("div",{id:"scrollContainer",class:[c,"hideCursor"]},[!n.isLoading&&l(d,{onRendered:h},null)])])}}))}}}));
+System.register(["./instrument-legacy-827ff9a8.js","./node_modules-legacy-cc3cd557.js","./src-legacy-53d6b23f.js"],(function(e,t){"use strict";var n,i,a,o,s,r,l,d,c=document.createElement("style");return c.textContent="._skeleton_vtlsh_1{position:fixed;left:0;top:0;width:100vw;height:100vh;padding:.53333rem .8rem;background-color:#fff;z-index:1000;--van-skeleton-paragraph-height: .8rem}._detail_vtlsh_12{width:100vw;height:100vh;overflow:hidden;overflow-y:auto;--header-height: 1.65333rem;background:var(--container-background)}._detail_vtlsh_12 ._container_vtlsh_20{margin:0 .26667rem;border-radius:.26667rem}._detail_vtlsh_12 #musicAndSelection{overflow:initial!important;height:initial!important;max-height:initial!important}\n",document.head.appendChild(c),{setters:[e=>{n=e.d,i=e.g,a=e.r,o=e.E,s=e.o,r=e.s,l=e.c,d=e.M},null,null],execute:function(){const t="_detail_vtlsh_12",c="_container_vtlsh_20";e("default",n({name:"music-list",setup(){const e=i(),n=a({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:o.staff,base64:""},{state:!1,name:"首调",type:o.firstTone,base64:""},{state:!1,name:"固定调",type:o.fixedTone,base64:""}]});s((()=>{window.appName="colexiu",r.xmlUrl=e.xmlUrl,n.isLoading=!1}));const h=async()=>{console.log("渲染完成")};return()=>l("div",{class:t},[l("div",{id:"scrollContainer",class:[c,"hideCursor"]},[!n.isLoading&&l(d,{onRendered:h},null)])])}}))}}}));

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


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


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


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/instrument-19994ef7.js


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


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


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


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/node_modules-081fca9f.js


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


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


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


+ 38 - 1
src/constant/instruments.ts

@@ -276,4 +276,41 @@ export const sortMusical = (name: string, index: number) => {
 		break;
 	}
 	return sortId
-  }
+  }
+
+export const fixInstrumentNameCode = (trackId: string | number) => {
+	let code: any;
+	const trackName = instruments[trackId] || ''
+	if (trackName.includes('长笛')) {
+		code = 2
+	} else if (trackName.includes('单簧管')) {
+		code = 4
+	} else if (trackName.includes('萨克斯')) {
+		code = 5
+	} else if (trackName.includes('小号')) {
+		code = 12
+	} else if (trackName.includes('圆号')) {
+		code = 13
+	} else if (trackName.includes('长号')) {
+		code = 14
+	} else if (trackName.includes('上低音号')) {
+		code = 15
+	} else if (trackName.includes('大号')) {
+		code = 17
+	} else if (trackName.includes('德式竖笛')) {
+		code = 'piccolo'
+	} else if (trackName.includes('英式竖笛')) {
+		code = 'baroque-recorder'
+	} else if (trackName.includes('葫芦丝')) {
+		code = 'hulusi-flute'
+	} else if (trackName.includes('排箫')) {
+		code = 'pan-flute'
+	} else if (trackName.includes('高音陶笛')) {
+		code = 'whistling'
+	} else if (trackName.includes('陶笛')) {
+		code = 'ocarina'
+	} else if (trackName.includes('口风琴')) {
+		code = 'melodica'
+	}
+	return code;
+}

+ 10 - 2
src/state.ts

@@ -25,6 +25,7 @@ import { undoData, moveData } from "/src/view/plugins/move-music-score"
 import { HANDLE_WORK_ADD } from "/src/page-instrument/custom-plugins/work-index";
 import { speedBeatTo, unitImgs } from "/src/helpers/beatConfig"
 import IndexedDBService from "/src/utils/indexedDB";
+import { fixInstrumentNameCode } from "/src/constant/instruments";
 
 const query: any = getQuery();
 
@@ -1834,7 +1835,10 @@ const setState = (data: any, index: number) => {
   if (state.isSimplePage) {
     state.isCombineRender = false;
   }
-  setCustom(state.isCombineRender ? data.musicSheetSoundList?.length : 0);
+  // 多分轨合并显示的曲子,有可能只有一个原音文件,minCombineNum的最小值至少为2
+  const minCombineNum = data.musicSheetSoundList?.length ? Math.max(data.musicSheetSoundList?.length, 2) : 2;  
+  setCustom(state.isCombineRender ? minCombineNum : 0);
+  // setCustom(state.isCombineRender ? data.musicSheetSoundList?.length : 0);
   // 解析扩展字段
   if (data.extConfigJson) {
     try {
@@ -1899,7 +1903,10 @@ const setState = (data: any, index: number) => {
    * 获取指法code
    */
   // const code = state.isConcert ? matchVoicePart(state.trackId, "CONCERT") : matchVoicePart(state.musicalCodeId, "SINGLE");
-  const code = matchVoicePart(state.trackId, "CONCERT")
+  let code = matchVoicePart(state.trackId, "CONCERT")
+  if (code == 1 || !code) {
+    code = fixInstrumentNameCode(state.trackId)
+  }
   state.fingeringInfo = subjectFingering(code);
   console.log("🚀 ~ state.fingeringInfo:", code, state.fingeringInfo, state.trackId, state.track);
   state.musicalCodeId = state.fingeringInfo?.id || 0
@@ -2379,6 +2386,7 @@ export const checkMoveNoSave = async () => {
 
 /** 刷新谱面 */
 export const refreshMusicSvg = () => {
+  (window as any).DYhideTrackTune = false;
   moveData.noteCoords = []
   moveData.modelList = []
   clearSelection();

+ 10 - 5
src/view/audio-list/index.tsx

@@ -374,6 +374,8 @@ export async function changeCombineAudio (combineIndex: number){
 		audioData.combineIndex = -1
 		state.playSource = "background"
 		state.music = ""
+		// 当开启节拍器的时候,切为伴奏的时候合成节拍器1
+		await handleLoadBeatMusic()
 		// 当没有背景音文件的时候
 		if(!state.accompany) {
 			state.noMusicSource = true
@@ -398,15 +400,18 @@ export async function changeCombineAudio (combineIndex: number){
 		const music = await createAudio(musicUrl)
 		const beatMusic = await mergeBeatAudio(musicUrl)
 		// 当没有背景音的时候 需要绑定事件
-		if(!state.accompany){
+		if(!audioData.songCollection.backgroundEle){
 			if(music){
 				music.addEventListener("play", onPlay);
 				music.addEventListener("ended", onEnded);
 			}			
-			if(beatMusic){
-				beatMusic.addEventListener("play", onPlay);
-				beatMusic.addEventListener("ended", onEnded);
-			}
+		}
+		// 取消掉背景音绑定的时候,然后给当前原音节拍音频绑定事件,这样防止没有背景节拍的时候,能给
+		if(beatMusic){
+			audioData.songCollection.beatBackgroundEle?.removeEventListener("play", onPlay)
+			audioData.songCollection.beatBackgroundEle?.removeEventListener("ended", onEnded)
+			beatMusic.addEventListener("play", onPlay);
+			beatMusic.addEventListener("ended", onEnded);
 		}
 		audioData.combineMusicEles.push({
 			key: combineIndex,

+ 2 - 1
src/view/fingering/fingering-relationships.ts

@@ -325,7 +325,8 @@ const relationships = {
 		30: [1, 5, 6],
 		31: [4, 5, 3],
 		32: [4, 2, 3],
-		33: [4, 2, 6],
+		// 33: [4, 2, 6],
+		33: [1, 5, 3],
 		34: [1, 2, 3],
 		35: [4, 5, 6],
 		36: [4, 2, 6],

+ 1 - 0
src/view/music-score/index.tsx

@@ -62,6 +62,7 @@ export default defineComponent({
 		},
 	},
 	setup(props, { emit, slots, expose }) {
+		(window as any).DYhideTrackTune = false;
 		const query: any = getQuery();
 		let osmd: any = null;
 		/** 设置 曲谱模式,五线谱还是简谱 */

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
stats.html


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