index.tsx 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. import { Popup, Skeleton } from "vant";
  2. import { computed, defineComponent, nextTick, onBeforeMount, onBeforeUnmount, onMounted, reactive, Transition, watch, watchEffect, defineAsyncComponent, ref } from "vue";
  3. import { formateTimes } from "../../helpers/formateMusic";
  4. import Metronome, { metronomeData } from "../../helpers/metronome";
  5. import state, { EnumMusicRenderType, evaluatCreateMusicPlayer, handleSetSpeed, IAudioState, IPlatform, isRhythmicExercises, resetPlaybackToStart, togglePlay, getMusicDetail, addNoteBBox } from "/src/state";
  6. import { browser, setGlobalData } from "../../utils";
  7. import AudioList from "../../view/audio-list";
  8. import MusicScore from "../../view/music-score";
  9. import TestCheck from "/src/view/music-score/testCheck";
  10. import { sysMusicScoreAccompanimentQueryPage } from "../api";
  11. import EvaluatModel from "../evaluat-model";
  12. import HeaderTop, { handlerModeChange } from "../header-top";
  13. import styles from "./index.module.less";
  14. import { api_cloudAccompanyMessage, api_cloudLoading, api_keepScreenLongLight, api_openCamera, api_openWebView, api_setEventTracking, api_setRequestedOrientation, api_setStatusBarVisibility, isSpecialShapedScreen } from "/src/helpers/communication";
  15. import { getQuery } from "/src/utils/queryString";
  16. import Evaluating, { evaluatingData } from "/src/view/evaluating";
  17. import MeasureSpeed from "/src/view/plugins/measure-speed";
  18. import { mappingVoicePart, subjectFingering } from "/src/view/fingering/fingering-config";
  19. import Fingering from "/src/view/fingering";
  20. import store from "store";
  21. import Tick, { handleInitTick } from "/src/view/tick";
  22. import FollowPractice, { followData } from "/src/view/follow-practice";
  23. import FollowModel from "../follow-model";
  24. import RecordingTime from "../custom-plugins/recording-time";
  25. import WorkIndex, { resetSection } from "../custom-plugins/work-index";
  26. import TheMusicList, { isMusicList } from "../component/the-music-list";
  27. import { storeData } from "/src/store";
  28. import ViewFigner from "../view-figner";
  29. import { recalculateNoteData } from "/src/view/selection";
  30. import ToggleMusicSheet from "/src/view/plugins/toggleMusicSheet";
  31. import { setCustomGradual, setCustomNoteRealValue } from "/src/helpers/customMusicScore";
  32. import { usePageVisibility } from "@vant/use";
  33. import { initMidi } from "/src/helpers/midiPlay";
  34. import TheAudio from "/src/components/the-audio";
  35. import tickWav from "/src/assets/tick.mp3";
  36. import AuthorName from "../component/authorName";
  37. import { initSmoothAnimation } from "./smoothAnimation";
  38. import EmptyMusic, { isEmptyMusicShow } from "./emptyMusic";
  39. import { position } from "html2canvas/dist/types/css/property-descriptors/position";
  40. import Loading from "./loading"
  41. import LoadingCss from "./loadingCss"
  42. // import bgJson from "./images/index.json";
  43. import bg2Left from "./images/bg2_left_zs.png";
  44. import bg2Right from "./images/bg2_right_zs.png";
  45. // const DelayCheck = defineAsyncComponent(() =>
  46. // import('/src/page-instrument/evaluat-model/delay-check')
  47. // )
  48. /**
  49. * 特殊教材分类id
  50. */
  51. export const classids = [1, 2, 6, 7, 8, 9, 3, 10, 11, 12, 13, 4, 14, 15, 16, 17, 30, 31, 35, 36, 46, 108]; // 大雅金唐, 竖笛教程, 声部训练展开的分类ID
  52. const calcCeilFrequency = (frequency: number) => {
  53. if (frequency < 0) return frequency;
  54. if (frequency) return (frequency * 1000 * 2) / 1000;
  55. return 0;
  56. };
  57. /** 需要处理频率的乐器
  58. */
  59. const resetFrequency = (list: any[]) => {
  60. // const instrumentNames = ["ocarina", "pan-flute", "piccolo", "hulusi-flute"];
  61. const instrumentNames = ["ocarina", "pan-flute", "hulusi-flute"];
  62. if (!state.fingeringInfo?.name || !instrumentNames.includes(state.fingeringInfo.name)) return list;
  63. // console.log(state.subjectId, state.fingeringInfo.name, instrumentNames);
  64. for (let i = 0; i < list.length; i++) {
  65. if (list[i].prevFrequency) list[i].prevFrequency = calcCeilFrequency(list[i].prevFrequency);
  66. if (list[i].frequency) list[i].frequency = calcCeilFrequency(list[i].frequency);
  67. if (list[i].nextFrequency) list[i].nextFrequency = calcCeilFrequency(list[i].nextFrequency);
  68. }
  69. return list;
  70. };
  71. /**
  72. * 乐器指法处理
  73. */
  74. const setNoteHalfTone = (list: any[]) => {
  75. const instrumentNames = ["hulusi-flute"]; // ["ocarina", "pan-flute", "piccolo"];
  76. if (!state.fingeringInfo?.name || !instrumentNames.includes(state.fingeringInfo.name)) return list;
  77. for (let i = 0; i < list.length; i++) {
  78. const note = list[i];
  79. if (note.realKey === 0) continue;
  80. note.realKey = note.realKey + 12;
  81. }
  82. return list;
  83. };
  84. export const musicScoreRef = ref();
  85. export const fingerRef = ref();
  86. export const headerColumnHide = ref(false); // 是否隐藏功能按钮,播放时自动隐藏
  87. export default defineComponent({
  88. name: "music-list",
  89. setup() {
  90. const browsInfo = browser();
  91. const query: any = getQuery();
  92. const detailData = reactive({
  93. isLoading: true,
  94. skeletonLoading: true,
  95. paddingLeft: "0px",
  96. headerHide: false,
  97. fingerPreView: false,
  98. fingerPreViewAnimation: false,
  99. orientation: 0,
  100. fingerPreViewGuide: false,
  101. });
  102. const getAPPData = async () => {
  103. const screenData = await isSpecialShapedScreen();
  104. if (screenData?.content) {
  105. // console.log("🚀 ~ screenData:", screenData.content);
  106. const { isSpecialShapedScreen, notchHeight } = screenData.content;
  107. if (isSpecialShapedScreen) {
  108. // 安卓取刘海值
  109. detailData.paddingLeft = 27 + "px";
  110. }
  111. }
  112. };
  113. onBeforeMount(async () => {
  114. // console.time("渲染加载耗时");
  115. api_keepScreenLongLight();
  116. getAPPData();
  117. api_setStatusBarVisibility();
  118. const settting = store.get("musicscoresetting");
  119. if (settting) {
  120. //state.setting = settting;
  121. Object.assign(state.setting, settting);
  122. //state.setting.beatVolume = state.setting.beatVolume || 50
  123. state.setting.beatVolume = 50;
  124. if (state.setting.camera) {
  125. const res = await api_openCamera();
  126. // 没有授权
  127. if (res?.content?.reson) {
  128. state.setting.camera = false;
  129. store.set("musicscoresetting", state.setting);
  130. }
  131. }
  132. }
  133. });
  134. //给app传伴奏
  135. const pushAppMusic = () => {
  136. api_cloudAccompanyMessage(state.accompany);
  137. };
  138. // console.log(route.params, query)
  139. // 动态加载json背景
  140. const bgJsonData: any = ref(null);
  141. const jsonFiles: any = {
  142. data: () => import('./images/index.json'),
  143. };
  144. const loadJson = async (fileKey: any) => {
  145. try {
  146. const data = await jsonFiles[fileKey]();
  147. bgJsonData.value = data.default;
  148. } catch (error) {
  149. console.error('👀~json背景加载失败', error);
  150. }
  151. };
  152. onMounted(async () => {
  153. (window as any).appName = "colexiu";
  154. const id = query.id || "43554";
  155. state.isCbsView = query.isCbs;
  156. // 如果是纯预览模式,0.65倍缩放谱面
  157. state.isPreView = query.isPreView;
  158. if (state.isPreView) {
  159. state.zoom = query.zoom || 0.65
  160. }
  161. if (id == "1814218144844087298" && state.isSingleLine) {
  162. state.zoom = 0.7;
  163. }
  164. // 只有总控平台和预览 默认是多行谱
  165. //(state.isPreView || query.isCbs) && (state.isSingleLine = false)
  166. // Promise.all([sysMusicScoreAccompanimentQueryPage(id)]).then((values) => {
  167. // getMusicInfo(values[0]);
  168. // });
  169. loadJson('data');
  170. try {
  171. await getMusicDetail(id);
  172. } catch (err) {
  173. console.error(err);
  174. state.isLoading = false;
  175. isEmptyMusicShow.value = true
  176. // 需要向外面(iframe)派发计时器数据的时候触发
  177. if(query.isbeatTimes){
  178. console.log("webApi_beatTimes",err)
  179. window.parent.postMessage(
  180. {
  181. api: "webApi_beatTimes",
  182. data: "节拍器时值错误!!"
  183. },
  184. "*"
  185. );
  186. }
  187. return
  188. }
  189. detailData.isLoading = false;
  190. // 如果后台设置了不显示指法,关闭指法开关 如果默认进来是演奏模式 不显示指法开关
  191. if (!state.isShowFingering || state.playType === "sing") {
  192. state.setting.displayFingering = false;
  193. }
  194. // api_setEventTracking();
  195. });
  196. /** 渲染完成 */
  197. const handleRendered = (osmd: any) => {
  198. api_cloudLoading();
  199. console.timeEnd("渲染加载耗时");
  200. detailData.skeletonLoading = false;
  201. state.osmd = osmd;
  202. // 没有设置速度使用读取的速度
  203. if (state.originSpeed === 0) {
  204. state.originSpeed = state.speed = (osmd as any).bpm || osmd.Sheet.userStartTempoInBPM || 100;
  205. }
  206. // const saveSpeed = (store.get("speeds") || {})[state.examSongId] || state.speed || (osmd as any).bpm || osmd.Sheet.userStartTempoInBPM;
  207. // // 加载本地缓存的速度
  208. // if (saveSpeed) {
  209. // handleSetSpeed(saveSpeed);
  210. // }
  211. setCustomGradual();
  212. setCustomNoteRealValue();
  213. state.times = formateTimes(osmd);
  214. // state.times = resetFrequency(state.times);
  215. state.times = setNoteHalfTone(state.times);
  216. state.xmlHasLyric = state.times.some((item: any) => item?.formatLyricsEntries?.length);
  217. console.log("🚀 ~ state.times:", state.times, state.subjectId, state);
  218. nextTick(() => {
  219. state.activeMeasureIndex = state.times[0].MeasureNumberXML;
  220. });
  221. // 一行谱
  222. if (state.isSingleLine) {
  223. // 音符添加位置信息bbox
  224. addNoteBBox(state.times);
  225. // 一行谱创建 动画
  226. initSmoothAnimation();
  227. }
  228. // 初始化midi音频信息
  229. const songEndTime = state.times[state.times.length - 1 || 0]?.endtime || 0;
  230. if (state.isAppPlay) {
  231. const durationNum = songEndTime;
  232. initMidi(durationNum, state.midiUrl);
  233. }
  234. state.measureTime = state.times[0]?.measureLength || 0;
  235. try {
  236. metronomeData.metro = new Metronome();
  237. metronomeData.metro.init(state.times);
  238. } catch (error) {}
  239. // 需要向外面(iframe)派发计时器数据的时候触发
  240. if (query.isbeatTimes) {
  241. const { isOpenMetronome, isSingOpenMetronome } = state;
  242. const { xmlMp3BeatFixTime, difftime } = state.times[0];
  243. const singBeatTime: number[][] = [];
  244. const beatTime = metronomeData.metroMeasure.map((metroMeasure) => {
  245. const singBeat: number[] = [];
  246. const beatTimeItem = metroMeasure.map((item: any) => {
  247. let singTime = item.time;
  248. if (isSingOpenMetronome && !isOpenMetronome) {
  249. singTime += xmlMp3BeatFixTime;
  250. } else if (!isSingOpenMetronome && isOpenMetronome) {
  251. singTime -= xmlMp3BeatFixTime;
  252. }
  253. singBeat.push(singTime);
  254. return item.time;
  255. });
  256. singBeatTime.push(singBeat);
  257. return beatTimeItem;
  258. });
  259. //改为唱名
  260. state.fixtime = difftime;
  261. state.times.map((item) => {
  262. item.time = item.xmlNoteTime + difftime;
  263. item.endtime = item.xmlNoteEndTime + difftime;
  264. item.fixtime = difftime;
  265. });
  266. metronomeData.metro.calculation(state.times);
  267. const mingBeatTime: number[][] = metronomeData.metroMeasure.map((metroMeasure) => {
  268. const beatTimeItem = metroMeasure.map((item: any) => {
  269. return item.time;
  270. });
  271. return beatTimeItem;
  272. });
  273. const webApi_beatTimes = { beatTime, singBeatTime, mingBeatTime, isBeatTime:!state.isEvxml, isSingBeatTime:!state.isEvxml, isMingBeatTime:!state.isEvxml }
  274. console.log("webApi_beatTimes", webApi_beatTimes);
  275. window.parent.postMessage(
  276. {
  277. api: "webApi_beatTimes",
  278. data: JSON.stringify(webApi_beatTimes),
  279. },
  280. "*"
  281. );
  282. return
  283. }
  284. // 刷新时值
  285. handlerModeChange("play", "music");
  286. /**
  287. * 2024.1.25
  288. * 设置节拍器,跟练需要播放系统节拍器,所以不需要判断needTick状态
  289. */
  290. // if (state.needTick) {
  291. handleInitTick(osmd?.Sheet?.SheetPlaybackSetting?.Rhythm?.Numerator || 4, osmd?.Sheet?.SheetPlaybackSetting?.Rhythm?.denominator);
  292. // }
  293. // api_cloudLoading();
  294. // state.playBtnDirection = query.imagePos === 'left' ? 'left' : 'right';
  295. // state.isAttendClass = (query.imagePos === 'left' || query.imagePos === 'right') ? true : false;
  296. // if (state.fingeringInfo.direction === "vertical" && state.setting.displayFingering) {
  297. // state.musicScoreBtnDirection = state.playBtnDirection === 'right' ? 'left' : 'right';
  298. // } else {
  299. // state.musicScoreBtnDirection = state.playBtnDirection;
  300. // }
  301. state.musicScoreBtnDirection = state.playBtnDirection;
  302. state.musicRendered = true;
  303. evaluatCreateMusicPlayer();
  304. resetPlaybackToStart();
  305. // 需要重新设置作业选段
  306. if (state.workSectionNeedReset) {
  307. resetSection();
  308. }
  309. // pushAppMusic();
  310. // console.timeEnd("渲染加载耗时");
  311. };
  312. function handleOnRendered(osmd: any) {
  313. try{
  314. handleRendered(osmd)
  315. }catch(err:any){
  316. // 需要向外面(iframe)派发计时器数据的时候触发
  317. if(query.isbeatTimes){
  318. console.log("webApi_beatTimes",err)
  319. window.parent.postMessage(
  320. {
  321. api: "webApi_beatTimes",
  322. data: "节拍器时值错误!!"
  323. },
  324. "*"
  325. );
  326. }
  327. }
  328. }
  329. /** 指法配置 */
  330. const fingerConfig = computed<any>(() => {
  331. if (state.setting.displayFingering && state.fingeringInfo?.name) {
  332. if (state.fingeringInfo.direction === "transverse") {
  333. console.log("横向指法", state.fingeringInfo.name);
  334. return {
  335. container: {
  336. //paddingBottom: headerColumnHide.value ? state.fingeringInfo.height : state.fingeringInfo.scaleData?.offset
  337. paddingBottom: state.fingeringInfo.height
  338. },
  339. // 横向指法,跟练&评测模式,默认展示贴底展示
  340. // fingerBox: headerColumnHide.value ? {
  341. // height: state.fingeringInfo.height
  342. // } : {
  343. // height: state.fingeringInfo.height,
  344. // transform: `scale(${state.fingeringInfo.scaleData?.scale})`
  345. // }
  346. fingerBox: {
  347. height: state.fingeringInfo.height
  348. }
  349. };
  350. } else {
  351. console.log("竖向指法", state.fingeringInfo.name, state.playBtnDirection, state.platform);
  352. // 老师端,竖向指法,需要根据功能按钮方向进行设置
  353. if (state.platform === IPlatform.PC) {
  354. return {
  355. container: {
  356. paddingRight: state.playBtnDirection === "right" ? "initial" : state.fingeringInfo.width,
  357. paddingLeft: state.playBtnDirection === "right" ? state.fingeringInfo.width : "initial",
  358. },
  359. fingerBox: {
  360. position: "absolute",
  361. width: state.fingeringInfo.width,
  362. height: state.fingeringInfo.name === "hulusi-flute" ? "86%" : "80%",
  363. right: state.playBtnDirection === "right" ? "initial" : 0,
  364. left: state.playBtnDirection === "right" ? 0 : "initial",
  365. top: (state.fingeringInfo.name === "ocarina" || state.fingeringInfo.name === "whistling") ? "60px" : state.fingeringInfo.name === "hulusi-flute" ? "10px" : (state.fingeringInfo.name === "baroque-recorder" || state.fingeringInfo.name === "piccolo") ? "36px" : 0,
  366. },
  367. };
  368. } else {
  369. return {
  370. container: {
  371. paddingLeft: state.fingeringInfo.width,
  372. },
  373. fingerBox: {
  374. position: "absolute",
  375. width: state.fingeringInfo.width,
  376. height: state.fingeringInfo.name === "hulusi-flute" ? "86%" : "80%",
  377. left: 0,
  378. top: (state.fingeringInfo.name === "ocarina" || state.fingeringInfo.name === "whistling") ? "60px" : state.fingeringInfo.name === "hulusi-flute" ? "10px" : (state.fingeringInfo.name === "baroque-recorder" || state.fingeringInfo.name === "piccolo") ? "36px" : 0,
  379. },
  380. };
  381. }
  382. }
  383. }
  384. return {
  385. container: {},
  386. fingerBox: {},
  387. };
  388. });
  389. // 监听指法显示
  390. watch(
  391. () => state.setting.displayFingering,
  392. () => {
  393. if (state.fingeringInfo.direction === "vertical") {
  394. // if (state.setting.displayFingering) {
  395. // state.musicScoreBtnDirection = state.playBtnDirection === 'left' ? 'right' : 'left'
  396. // } else {
  397. // state.musicScoreBtnDirection = state.playBtnDirection
  398. // }
  399. state.musicScoreBtnDirection = state.playBtnDirection;
  400. }
  401. }
  402. );
  403. watch(
  404. () => state.setting.soundEffect,
  405. () => {
  406. store.set("musicscoresetting", state.setting);
  407. }
  408. );
  409. /**播放状态改变时,向父页面发送事件 */
  410. const sendParentMessage = (playState: IAudioState) => {
  411. window.parent.postMessage(
  412. {
  413. api: "headerTogge",
  414. playState: playState,
  415. },
  416. "*"
  417. );
  418. };
  419. // 监听播放状态
  420. watch(
  421. () => state.playState,
  422. () => {
  423. // if (state.platform != IPlatform.PC) {
  424. // headerColumnHide.value = state.playState === "play" ? true : false;
  425. // }
  426. headerColumnHide.value = state.playState === "play" ? true : false;
  427. sendParentMessage(state.playState);
  428. }
  429. );
  430. // 监听跟练的开启状态
  431. watch(
  432. () => followData.practiceStart,
  433. () => {
  434. headerColumnHide.value = followData.practiceStart;
  435. }
  436. );
  437. // 监听开始评测状态
  438. watch(
  439. () => evaluatingData.startBegin,
  440. () => {
  441. headerColumnHide.value = evaluatingData.startBegin;
  442. }
  443. );
  444. /** 指法预览切换 */
  445. watch(
  446. () => detailData.fingerPreView,
  447. () => {
  448. console.log(2342);
  449. window.parent.postMessage(
  450. {
  451. api: "api_fingerPreView",
  452. state: detailData.fingerPreView,
  453. },
  454. "*"
  455. );
  456. }
  457. );
  458. const pageVisible = usePageVisibility();
  459. watch(
  460. () => pageVisible.value,
  461. (val) => {
  462. if (val === "hidden") {
  463. // 如果是播放状态,需要暂停播放
  464. // console.log("页面隐藏停止播放");
  465. if (state.playState === "play") {
  466. togglePlay("paused");
  467. }
  468. }
  469. }
  470. );
  471. const handleOpenFignerView = () => {
  472. if (!query.modelType) {
  473. detailData.orientation = state.fingeringInfo.orientation || 0;
  474. api_setRequestedOrientation(detailData.orientation);
  475. }
  476. // const url = `${
  477. // /(192|localhost)/.test(location.origin)
  478. // ? "http://192.168.3.114:3000/instrument.html"
  479. // : location.origin + location.pathname
  480. // }#/view-figner`;
  481. // console.log("🚀 ~ url:", url);
  482. // api_openWebView({
  483. // url: url,
  484. // orientation: state.fingeringInfo.orientation || 0,
  485. // });
  486. if (state.playState === "play") {
  487. togglePlay("paused");
  488. setTimeout(() => {
  489. detailData.fingerPreView = true;
  490. }, 500);
  491. return;
  492. }
  493. detailData.fingerPreView = true;
  494. };
  495. const handleCloseFignerView = () => {
  496. if (!query.modelType && detailData.orientation == 1) {
  497. api_setRequestedOrientation(0);
  498. }
  499. detailData.fingerPreView = false;
  500. detailData.fingerPreViewGuide = false;
  501. };
  502. return () => (
  503. <div
  504. class={[styles.detail, styles[state.modeType], state.setting.eyeProtection && "eyeProtection", state.platform === IPlatform.PC && state.zoom > 0.8 && styles.PC, state.isPreView && styles.preViewDetail, state.isCbsView && styles.cbsViewDetail]}
  505. style={{
  506. "--detailDataPaddingLeft": detailData.paddingLeft,
  507. paddingLeft: detailData.paddingLeft,
  508. background: state.setting.camera && state.modeType === 'evaluating' ? `rgba(${state.setting.eyeProtection ? "253,244,229" : "255,255,255"} ,${state.setting.cameraOpacity / 100}) !important` : "",
  509. }}
  510. >
  511. {bgJsonData.value ?
  512. <img
  513. style={{opacity: state.setting.camera && state.modeType === 'evaluating' ? state.setting.cameraOpacity / 100 : 1}}
  514. class={styles.pageBg}
  515. src={state.modeType === 'practise' ? bgJsonData.value[1] : state.modeType === 'evaluating' ? bgJsonData.value[2] : state.modeType === 'follow' ? bgJsonData.value[3] : ''}
  516. /> : <div
  517. style={{opacity: state.setting.camera && state.modeType === 'evaluating' ? state.setting.cameraOpacity / 100 : 1}}
  518. class={[styles.pageBg, styles[state.modeType]]} >
  519. </div>
  520. }
  521. {
  522. state.modeType === 'evaluating' ? (<>
  523. <img src={bg2Left} class={styles.bg2Left} />
  524. <img src={bg2Right} class={styles.bg2Right} />
  525. </>
  526. ) : null}
  527. {/* 骨架屏 */}
  528. {/* <Transition name="van-fade">
  529. {detailData.skeletonLoading && (
  530. <div class={styles.skeleton}>
  531. <Skeleton row={8} />
  532. </div>
  533. )}
  534. </Transition> */}
  535. {/* 曲目加载错误的缺省 */}
  536. <EmptyMusic></EmptyMusic>
  537. {/** 功能按钮 */}
  538. {!state.isPreView && <div class={["headHeight", styles.headHeight, headerColumnHide.value && styles.headHide]}>{state.musicRendered && <HeaderTop />}</div>}
  539. <div
  540. id="scrollContainer"
  541. style={{ ...fingerConfig.value.container }}
  542. class={[styles.container, !state.setting.displayCursor && "hideCursor", browsInfo.xiaomi && styles.xiaomi, state.platform === IPlatform.PC && styles.pcContainer]}
  543. onClick={(e: Event) => {
  544. e.stopPropagation();
  545. // if (state.playState === "play" && state.platform != IPlatform.PC) {
  546. // headerColumnHide.value = !headerColumnHide.value;
  547. // }
  548. // 点击谱面跟练也需要切换显示按钮栏
  549. if (state.playState === "play" || followData.start || evaluatingData.startBegin) {
  550. headerColumnHide.value = !headerColumnHide.value;
  551. }
  552. }}
  553. >
  554. {/* 曲谱渲染 */}
  555. {!detailData.isLoading &&
  556. <MusicScore
  557. ref={musicScoreRef}
  558. musicColor={state.isPreView || state.isCbsView ? '#000000' : '#FFFFFF'}
  559. showPartNames={state.isCombineRender}
  560. onRendered={handleOnRendered}
  561. >
  562. {/* 旋律线关闭时候的 标题和作者 */}
  563. <AuthorName></AuthorName>
  564. {/* 节拍器 */}
  565. {!detailData.isLoading && !detailData.skeletonLoading && <Tick />}
  566. </MusicScore>
  567. }
  568. {/* {
  569. state.musicRendered &&
  570. <TestCheck />
  571. } */}
  572. {/* 指法 */}
  573. {state.setting.displayFingering && state.fingeringInfo?.name && !state.isPreView && state.isShowFingering && (
  574. <div style={{ ...fingerConfig.value.fingerBox }} class={styles.fingeringCon}>
  575. <Fingering
  576. ref={fingerRef}
  577. style={{
  578. background: state.setting.camera ? `rgba(${state.setting.eyeProtection ? "253,244,229" : "255,255,255"} ,${state.setting.cameraOpacity / 100})` : "",
  579. }}
  580. onOpen={() => handleOpenFignerView()}
  581. />
  582. </div>
  583. )}
  584. </div>
  585. {/* 曲目渲染完成,再去下载mp3资源 */}
  586. {!detailData.isLoading && !detailData.skeletonLoading && <AudioList />}
  587. {/* {!detailData.isLoading && <TheAudio src={tickWav} />} */}
  588. {/* 预加载延迟检测组建 */}
  589. {/* {!detailData.isLoading && !detailData.skeletonLoading && evaluatingData.preloadJson && !evaluatingData.jsonLoadDone && (
  590. <div class={styles.preJson}>
  591. <DelayCheck isPreLoad={true} />
  592. </div>
  593. )} */}
  594. {/* 评测 */}
  595. {state.modeType === "evaluating" && (
  596. <>
  597. <Evaluating />
  598. {evaluatingData.rendered && <EvaluatModel />}
  599. </>
  600. )}
  601. {/* 跟练模式 */}
  602. {state.modeType === "follow" && (
  603. <>
  604. <FollowPractice />
  605. <FollowModel />
  606. </>
  607. )}
  608. {/* 切换曲谱 */}
  609. {!query.lessonTrainingId && !query.questionId && state.isConcert && <ToggleMusicSheet />}
  610. {state.musicRendered && !state.isPreView && (
  611. <>
  612. {/* 统计训练时长 */}
  613. {storeData.isApp && <RecordingTime />}
  614. {/* 作业 */}
  615. {query.workRecord && <WorkIndex />}
  616. {/* 曲谱列表 */}
  617. {isMusicList.value && <TheMusicList />}
  618. </>
  619. )}
  620. <Loading tipText={state.loadingText} />
  621. <LoadingCss />
  622. <Popup
  623. zIndex={5050}
  624. teleport="body"
  625. v-model:show={detailData.fingerPreView}
  626. position="bottom"
  627. onClosed={() => {
  628. detailData.fingerPreViewAnimation = false;
  629. }}
  630. onOpen={() => {
  631. detailData.fingerPreViewAnimation = true;
  632. }}
  633. onOpened={() => {
  634. detailData.fingerPreViewGuide = true;
  635. }}
  636. >
  637. {detailData.fingerPreViewAnimation && <ViewFigner show={detailData.fingerPreViewGuide} subject={state.fingeringInfo.name} isComponent={true} onClose={handleCloseFignerView} />}
  638. </Popup>
  639. </div>
  640. );
  641. },
  642. });