index.tsx 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128
  1. import { Transition, computed, defineComponent, onMounted, onUnmounted, reactive, ref, watch, toRef, ComputedRef, nextTick, defineAsyncComponent } from "vue";
  2. import styles from "./index.module.less";
  3. import iconBack from "./image/icon-back.png";
  4. import listImg from "./image/list.png";
  5. import iconMode from "./image/mode.png";
  6. import { headImg } from "./image";
  7. import { Badge, Circle, Popover, Popup, showConfirmDialog, showToast, NoticeBar } from "vant";
  8. import Speed from "./speed";
  9. import { evaluatingData, handleStartEvaluat } from "/src/view/evaluating";
  10. import Settting from "./settting";
  11. import state, { IPlatform, handleChangeSection, handleResetPlay, handleRessetState, togglePlay, IPlayState, refreshMusicSvg, EnumMusicRenderType } from "/src/state";
  12. import { getAudioCurrentTime } from "/src/view/audio-list";
  13. import { followData, toggleFollow } from "/src/view/follow-practice";
  14. import { api_back } from "/src/helpers/communication";
  15. import MusicType from "./music-type";
  16. import ModeTypeMode from "../component/mode-type-mode";
  17. import { getQuery } from "/src/utils/queryString";
  18. import { storeData } from "/src/store";
  19. import TeacherTop from "../custom-plugins/guide-page/teacher-top";
  20. import StudentTop from "../custom-plugins/guide-page/student-top";
  21. import { HANDLE_WORK_ADD } from "../custom-plugins/work-index";
  22. import { browser } from "/src/utils";
  23. import store from "store";
  24. import "../component/the-modal-tip/index.module.less";
  25. import { metronomeData } from "../../helpers/metronome";
  26. import { toggleMusicSheet } from "/src/view/plugins/toggleMusicSheet";
  27. import useDrag from "/src/view/plugins/useDrag/index";
  28. import Dragbom from "/src/view/plugins/useDrag/dragbom";
  29. import { getGuidance, setGuidance } from "../custom-plugins/guide-page/api";
  30. // import ModeView from "./modeView";
  31. import { smoothAnimationState } from "../view-detail/smoothAnimation";
  32. import { isMusicList, musicListShow } from "../component/the-music-list";
  33. import { EvaluatingDriver, FollowDriver, PractiseDriver } from "../custom-plugins/guide-driver";
  34. import { fingerRef } from "/src/page-instrument/view-detail/index"
  35. import WorkHomePop from "./workHomePop";
  36. import { handleLoadBeatMusic } from "/src/view/audio-list"
  37. const ModeView = defineAsyncComponent(() =>
  38. import('./modeView')
  39. )
  40. /** 头部数据和方法 */
  41. export const headTopData = reactive({
  42. /** 模式 */
  43. modeType: "" as "init" | "show",
  44. /** 显示返回按钮 */
  45. showBack: true,
  46. /** 设置弹窗 */
  47. settingMode: false,
  48. /* 节奏律动 */
  49. rhythmMode: false,
  50. // 节奏律动方向
  51. rhythmModeDirection: computed(()=> state.fingeringInfo.direction === "transverse" ? "vertical" : "transverse"),
  52. /** 切换模式 */
  53. handleChangeModeType(value: "practise" | "follow" | "evaluating") {
  54. // 后台设置为不能评测
  55. if (value === "evaluating" && !state.enableEvaluation) return;
  56. // 打击乐&节奏练习不支持跟练模式
  57. if (value === "follow" && state.isPercussion) return;
  58. // 跟练模式,光标只有音符模式,无节拍模式
  59. if (value === "follow" && metronomeData.cursorMode === 2) {
  60. metronomeData.cursorMode = 1;
  61. }
  62. if (value === "practise") {
  63. // 切回当前的时值
  64. const isModeChange = modeChangeHandleTimes("play", "music")
  65. // 没有切换的时候 不处理下面的
  66. if (isModeChange) {
  67. try {
  68. metronomeData.metro.calculation(state.times);
  69. } catch (error) {}
  70. console.log("重新之后的times", state.times, state.fixtime);
  71. }
  72. // state.playIngSpeed = state.speed
  73. }
  74. if (value === "evaluating") {
  75. // 如果延迟检测资源还在加载中,给出提示
  76. if (!evaluatingData.jsonLoadDone) {
  77. evaluatingData.jsonLoading = true;
  78. state.audioDone && showToast("资源加载中,请稍后"); //音频资源加载完之后才提示
  79. return;
  80. }
  81. // 如果是pc端, 评测模式暂不可用
  82. if (state.platform === IPlatform.PC) {
  83. showConfirmDialog({
  84. className: "modalTip",
  85. title: "温馨提示",
  86. message: "该功能暂未开放,敬请期待!",
  87. showCancelButton: false,
  88. });
  89. return;
  90. }
  91. // 评测模式,只有一行谱模式
  92. // if (!state.isSingleLine) {
  93. // state.isSingleLine = true;
  94. // refreshMusicSvg();
  95. // }
  96. /* 当前是唱名的模式 */
  97. if(state.playSource === "mingSong") {
  98. const isModeChange = modeChangeHandleTimes("play","mingSong","play","music")
  99. // 没有切换的时候 不处理下面的
  100. if (isModeChange) {
  101. try {
  102. metronomeData.metro.calculation(state.times);
  103. } catch (error) {}
  104. console.log("重新之后的times", state.times, state.fixtime);
  105. }
  106. }
  107. // 关闭节奏律动
  108. headTopData.rhythmMode = false
  109. smoothAnimationState.isShow.value = false; // 隐藏旋律线
  110. state.playIngSpeed = state.originSpeed;
  111. handleStartEvaluat();
  112. // 开发模式,把此处打开
  113. // state.modeType = "evaluating";
  114. // evaluatingData.rendered = true;
  115. // evaluatingData.soundEffectMode = true;
  116. } else if (value === "follow") {
  117. // 关闭节奏律动
  118. headTopData.rhythmMode = false
  119. // 跟练模式,只有一行谱模式
  120. if (!state.isSingleLine) {
  121. state.isSingleLine = true;
  122. refreshMusicSvg();
  123. }
  124. smoothAnimationState.isShow.value = false;
  125. toggleFollow();
  126. }
  127. headTopData.modeType = "show";
  128. },
  129. // 改变模式之前的状态
  130. oldPlayType: "play",
  131. // 记录切换模式前的状态
  132. oldModeType: "practise" as "practise" | "follow" | "evaluating",
  133. // 作业未完成弹窗
  134. workHomeNoDone: false,
  135. });
  136. export const headData = reactive({
  137. speedShow: false,
  138. musicTypeShow: false,
  139. });
  140. let resetBtn: ComputedRef<{
  141. display: boolean;
  142. disabled: boolean;
  143. }>;
  144. // 点击切换的时候才触发提醒
  145. let isClickMode = false;
  146. /**
  147. * 处理模式切换
  148. * @param oldPlayType 没改变之前的播放模式
  149. * @param oldPlaySource 没改变之前的播放类型
  150. * @param isforceReset 是否强制刷新播放状态 模式times时值改变时候也刷新
  151. */
  152. export async function handlerModeChange(oldPlayType: "play" | "sing", oldPlaySource: IPlayState, isforceReset?: boolean) {
  153. const isModeChange = modeChangeHandleTimes(oldPlayType, oldPlaySource);
  154. // 没有切换的时候 不处理下面的
  155. if (isModeChange) {
  156. try {
  157. metronomeData.metro.calculation(state.times);
  158. } catch (error) {}
  159. console.log("重新之后的times", state.times, state.fixtime);
  160. }
  161. if (isModeChange || isforceReset) {
  162. // 重置播放状态
  163. handleRessetState();
  164. // 隐藏重播按钮
  165. resetBtn && (resetBtn.value.display = false);
  166. }
  167. // 节拍器音频加载
  168. await handleLoadBeatMusic()
  169. // 当模式改变的时候 放在这里是因为需要等谱面加载完成之后再提示(点击按钮模式切换才提示)
  170. if (isClickMode) {
  171. showToast({
  172. message: state.playType === "play" ? "已切换为演奏场景" : "已切换为演唱场景",
  173. position: "top",
  174. className: "selectionToast",
  175. });
  176. isClickMode = false;
  177. }
  178. }
  179. // 模式切换之后重新给times赋值
  180. function modeChangeHandleTimes(oldPlayType: "play" | "sing", oldPlaySource: IPlayState, nowPlayType?:"play" | "sing", nowPlaySource?: IPlayState) {
  181. const playType = nowPlayType || state.playType;
  182. const playSource = nowPlaySource || state.playSource;
  183. const { notBeatFixtime, xmlMp3BeatFixTime, difftime } = state.times[0];
  184. const { isOpenMetronome, isSingOpenMetronome } = state;
  185. // 因为演奏加了唱名,所以往跟练模式切换和评测模式切换的时候,刷新谱面的时候需要更新时值,这时候调用handleRessetState 会回到练习模式,这里是
  186. if(state.modeType === "follow" || state.modeType === "evaluating") {
  187. return false
  188. }
  189. // 当相同时候也不处理
  190. if(oldPlayType === playType && oldPlaySource === playSource) {
  191. return false
  192. }
  193. // 原声向伴奏和伴奏向原声不处理 范唱向伴唱和伴唱向范唱切不处理
  194. if((oldPlaySource==="music"&&playSource==="background")||(oldPlaySource==="background"&&playSource==="music")){
  195. return false
  196. }
  197. // 唱名到唱名时候不处理
  198. if(oldPlaySource === "mingSong" && playSource === "mingSong"){
  199. return false
  200. }
  201. // 原生伴奏向范唱伴唱,范唱伴唱向原生伴奏时候,isSingOpenMetronome和isOpenMetronome相等时候不处理
  202. if(["music","background"].includes(oldPlaySource)&&["music","background"].includes(playSource)&&isOpenMetronome===isSingOpenMetronome){
  203. return false
  204. }
  205. // 当切为 原生伴奏,或者范唱伴唱 时候
  206. if(playSource==="music" || playSource ==="background"){
  207. if(playType === "play"){
  208. // 有节拍器
  209. if (isOpenMetronome) {
  210. state.fixtime = notBeatFixtime + xmlMp3BeatFixTime;
  211. state.times.map((item) => {
  212. item.time = item.notBeatTime + xmlMp3BeatFixTime;
  213. item.endtime = item.notBeatEndTime + xmlMp3BeatFixTime;
  214. item.fixtime = notBeatFixtime + xmlMp3BeatFixTime;
  215. });
  216. return true;
  217. } else {
  218. state.fixtime = notBeatFixtime;
  219. state.times.map((item) => {
  220. item.time = item.notBeatTime;
  221. item.endtime = item.notBeatEndTime;
  222. item.fixtime = notBeatFixtime;
  223. });
  224. return true;
  225. }
  226. }
  227. if(playType==="sing"){
  228. // 有节拍器
  229. if (isSingOpenMetronome) {
  230. state.fixtime = notBeatFixtime + xmlMp3BeatFixTime;
  231. state.times.map((item) => {
  232. item.time = item.notBeatTime + xmlMp3BeatFixTime;
  233. item.endtime = item.notBeatEndTime + xmlMp3BeatFixTime;
  234. item.fixtime = notBeatFixtime + xmlMp3BeatFixTime;
  235. });
  236. return true;
  237. } else {
  238. state.fixtime = notBeatFixtime;
  239. state.times.map((item) => {
  240. item.time = item.notBeatTime;
  241. item.endtime = item.notBeatEndTime;
  242. item.fixtime = notBeatFixtime;
  243. });
  244. return true;
  245. }
  246. }
  247. }
  248. // 当切为唱名时候
  249. if(playSource==="mingSong"){
  250. // 唱名文件也要加上弱起时间 他们制作曲子加了弱起时间 注意这修改了之后给总控平台的时值也需要改
  251. state.fixtime = difftime;
  252. state.times.map((item) => {
  253. item.time = item.xmlNoteTime + difftime;
  254. item.endtime = item.xmlNoteEndTime + difftime;
  255. item.fixtime = difftime;
  256. });
  257. return true;
  258. }
  259. return false;
  260. }
  261. export default defineComponent({
  262. name: "header-top",
  263. emits: ["close"],
  264. setup(props, { emit }) {
  265. const query = getQuery();
  266. // 是否显示引导
  267. const showGuide = ref(false);
  268. const showStudentGuide = ref(false);
  269. const showWebGuide = ref(true);
  270. let displayFingeringCache = false; // 指法缓存
  271. /** 设置按钮 */
  272. const settingBtn = computed(() => {
  273. // 音频播放中 禁用
  274. if (state.playState === "play") return { display: true, disabled: true };
  275. // 评测开始 禁用, 跟练开始 禁用
  276. if (evaluatingData.startBegin || followData.start) return { display: true, disabled: true };
  277. return {
  278. display: true,
  279. disabled: false,
  280. };
  281. });
  282. /** 转谱按钮 */
  283. const converBtn = computed(() => {
  284. // 音频播放中 禁用
  285. if (state.playState === "play") return { display: true, disabled: true };
  286. // 评测开始 禁用
  287. if (evaluatingData.startBegin || followData.start) return { display: true, disabled: true };
  288. return {
  289. disabled: false,
  290. display: true,
  291. };
  292. });
  293. /** 速度按钮 */
  294. const speedBtn = computed(() => {
  295. // 选择模式, 跟练模式 不显示
  296. //if (headTopData.modeType !== "show" || state.modeType === "follow") return { display: false, disabled: true };
  297. if (state.modeType === "follow") return { display: false, disabled: true };
  298. // 评测模式, 音频播放中 禁用
  299. if (state.modeType === "evaluating" || state.playState === "play") return { display: true, disabled: true };
  300. return {
  301. disabled: false,
  302. display: true,
  303. };
  304. });
  305. /** 节拍器按钮 */
  306. const metronomeBtn = computed(() => {
  307. // 选择模式 不显示
  308. //if (headTopData.modeType !== "show") return { display: false, disabled: true };
  309. // 音频播放中 禁用
  310. if (state.playState === "play") return { display: true, disabled: true };
  311. return {
  312. disabled: false,
  313. display: true,
  314. };
  315. });
  316. /** 指法按钮 */
  317. const fingeringBtn = computed(() => {
  318. // 后台设置不显示指法
  319. if (!state.isShowFingering) return { display: true, disabled: true };
  320. // 没有指法 选择模式 评测模式 跟练模式 不显示
  321. //if (headTopData.modeType !== "show" || !state.fingeringInfo.name || ["evaluating", "follow"].includes(state.modeType)) return { display: false, disabled: true };
  322. if (!state.fingeringInfo.name || ["evaluating", "follow"].includes(state.modeType)) return { display: false, disabled: true };
  323. // 音频播放中 禁用
  324. if (state.playState === "play") return { display: true, disabled: true };
  325. return {
  326. disabled: false,
  327. display: true,
  328. };
  329. });
  330. /** 摄像头按钮 */
  331. const cameraBtn = computed(() => {
  332. // 选择模式 不显示
  333. if (headTopData.modeType !== "show" || state.modeType !== "evaluating") return { display: false, disabled: true };
  334. // 音频播放中 禁用
  335. if (state.playState === "play") return { display: true, disabled: true };
  336. return {
  337. disabled: false,
  338. display: true,
  339. };
  340. });
  341. /** 选段按钮 */
  342. const selectBtn = computed(() => {
  343. // 选择模式 不显示
  344. //if (headTopData.modeType !== "show" || ["follow"].includes(state.modeType)) return { display: false, disabled: true };
  345. if (["follow"].includes(state.modeType)) return { display: false, disabled: true };
  346. // 音频播放中 禁用
  347. if (state.playState === "play" || query.workRecord) return { display: true, disabled: true };
  348. return {
  349. disabled: false,
  350. display: true,
  351. };
  352. });
  353. /** 原声按钮 */
  354. const originBtn = computed(() => {
  355. // 没有音源不显示
  356. if (state.noMusicSource) return { display: false, disabled: false };
  357. // 选择模式,跟练模式 不显示
  358. //if (headTopData.modeType !== "show" || state.modeType === "follow") return { display: false, disabled: false };
  359. if (state.modeType === "follow") return { display: false, disabled: false };
  360. // 评测开始 禁用
  361. if (state.modeType === "evaluating") return { display: false, disabled: true };
  362. if (!state.isAppPlay) {
  363. // 播放过程中不能切换
  364. if (state.playState === "play") {
  365. return { display: true, disabled: true };
  366. }
  367. if (state.playType === "play") {
  368. let index = 0;
  369. state.music && index++;
  370. state.accompany && index++;
  371. state.mingSong && index++;
  372. if (index > 1) {
  373. return { display: true, disabled: false };
  374. }
  375. } else {
  376. // 范唱
  377. let index = 0;
  378. state.fanSong && index++;
  379. state.banSong && index++;
  380. state.mingSong && index++;
  381. if (index > 1) {
  382. return { display: true, disabled: false };
  383. }
  384. }
  385. }
  386. return {
  387. disabled: true,
  388. display: true,
  389. };
  390. });
  391. /** 播放类型按钮 */
  392. const playTypeBtn = computed(() => {
  393. // 选择模式,跟练模式,评测模式 不显示
  394. //if (headTopData.modeType !== "show" || state.modeType === "follow" || state.modeType === "evaluating" || query.workRecord) return { display: false, disabled: false };
  395. if (state.modeType === "follow" || state.modeType === "evaluating" || query.workRecord) return { display: false, disabled: false };
  396. if (!state.isAppPlay) {
  397. let index = 0;
  398. state.music && index++;
  399. state.accompany && index++;
  400. let songIndex = 0;
  401. state.fanSong && songIndex++;
  402. state.banSong && songIndex++;
  403. state.mingSong && songIndex++;
  404. // 演唱和演奏 都有数据的时间不禁用
  405. if (songIndex > 0 && index > 0) {
  406. // 音频播放中 禁用
  407. if (state.playState === "play") {
  408. return { display: true, disabled: true };
  409. }
  410. return { display: true, disabled: false };
  411. }
  412. }
  413. return {
  414. disabled: false,
  415. display: false,
  416. };
  417. });
  418. /** 模式切换按钮 */
  419. const toggleBtn = computed(() => {
  420. // 上课页面不显示
  421. if(state.isAttendClass) return { display: false, disabled: false };
  422. // 老师端,打击乐&节奏练习不显示
  423. if (state.isPercussion && state.platform === IPlatform.PC) return { display: false, disabled: false };
  424. if(state.isCombineRender) return { display: false, disabled: false };
  425. // 没有音源不显示
  426. if (state.noMusicSource) return { display: false, disabled: false };
  427. // 不是演奏模式 影藏
  428. if (state.playType !== "play") return { display: false, disabled: false };
  429. // 选择模式, url设置模式 不显示
  430. if (headTopData.modeType !== "show" || !headTopData.showBack) return { display: false, disabled: false };
  431. // 跟练开始, 评测开始 播放开始 隐藏
  432. if (state.playState == "play" || followData.start || evaluatingData.startBegin) return { display: false, disabled: false };
  433. return {
  434. display: true,
  435. disabled: false,
  436. };
  437. });
  438. /** 播放按钮 */
  439. const playBtn = computed(() => {
  440. // 没有音源不显示
  441. if (state.noMusicSource) return { display: false, disabled: false };
  442. // 选择模式 不显示
  443. if (headTopData.modeType !== "show") return { display: false, disabled: false };
  444. // 评测模式 不显示,跟练模式 不显示
  445. if (["evaluating", "follow"].includes(state.modeType)) return { display: false, disabled: true };
  446. // midi音频未初始化完成不可点击
  447. if (state.isAppPlay && state.midiPlayIniting) return { display: true, disabled: true };
  448. return {
  449. display: true,
  450. disabled: false,
  451. };
  452. });
  453. /** 节奏律动 */
  454. const rhythmBtn = computed(() => {
  455. if(state.isCombineRender) return { display: false, disabled: false };
  456. // 跟练和评测显示
  457. if (["evaluating", "follow"].includes(state.modeType)) return { display: false, disabled: false, playIng: false };
  458. // 播放过程中不让切换
  459. if (state.playState == "play") {
  460. if(headTopData.rhythmMode) {
  461. return {
  462. display: true,
  463. disabled: true,
  464. playIng: true
  465. }
  466. }else{
  467. return {
  468. display: true,
  469. disabled: true,
  470. playIng: false
  471. }
  472. }
  473. };
  474. return {
  475. display: true,
  476. disabled: false,
  477. playIng: false
  478. };
  479. });
  480. /** 重播按钮 */
  481. resetBtn = computed(() => {
  482. // 没有音源不显示
  483. if (state.noMusicSource) return { display: false, disabled: false };
  484. // 选择模式 不显示
  485. if (headTopData.modeType !== "show") return { display: false, disabled: false };
  486. // 评测模式 不显示,跟练模式 不显示
  487. if (["evaluating", "follow"].includes(state.modeType)) return { display: false, disabled: true };
  488. // 播放状态 不显示
  489. if (state.playState === "play") return { display: false, disabled: true };
  490. // 播放进度为0 不显示
  491. const currentTime = getAudioCurrentTime();
  492. // midi音频未初始化完成不可点击
  493. if (state.isAppPlay && state.midiPlayIniting) return { display: false, disabled: true };
  494. if (!currentTime) return { display: false, disabled: true };
  495. return {
  496. display: true,
  497. disabled: false,
  498. };
  499. });
  500. const isAllBtns = computed(() => {
  501. const flag = converBtn.value.display && speedBtn.value.display && selectBtn.value.display && originBtn.value.display && toggleBtn.value.display && showGuide.value;
  502. return flag;
  503. });
  504. const isAllBtnsStudent = computed(() => {
  505. const flag = converBtn.value.display && speedBtn.value.display && selectBtn.value.display && originBtn.value.display && toggleBtn.value.display && showStudentGuide.value;
  506. return flag;
  507. });
  508. const showGuideIndex = computed(() => {
  509. // 从课堂乐器学生端课件预览默认不显示会员
  510. if (storeData.user.vipMember || state.paymentType === "FREE" || query.showCourseMember === "true") {
  511. // 学生端
  512. return true;
  513. } else {
  514. // vip
  515. return false;
  516. }
  517. });
  518. const browInfo = browser();
  519. // 返回校验, 如果是作业模式,并且作业没有达标需要给出弹窗提示
  520. const checkBack = () => {
  521. if (query.workRecord) {
  522. console.log('作业是否达标',state.isWorkDone)
  523. }
  524. if (query.workRecord && !state.isWorkDone) {
  525. headTopData.workHomeNoDone = true
  526. } else {
  527. handleBack()
  528. }
  529. }
  530. /** 返回 */
  531. const handleBack = () => {
  532. HANDLE_WORK_ADD();
  533. // 不在APP中,
  534. if (!storeData.isApp) {
  535. window.parent.postMessage(
  536. {
  537. api: "back",
  538. },
  539. "*"
  540. );
  541. window.close();
  542. return;
  543. }
  544. if ((browInfo.iPhone || browInfo.ios) && query.workRecord) {
  545. setTimeout(() => {
  546. api_back();
  547. }, 550);
  548. return;
  549. }
  550. api_back();
  551. };
  552. const handleResult = (type: any) => {
  553. if (type) {
  554. headTopData.workHomeNoDone = false
  555. } else {
  556. headTopData.workHomeNoDone = false
  557. handleBack()
  558. }
  559. }
  560. /** 根据参数设置模式 */
  561. const getQueryModelSetModelType = () => {
  562. /** 作业模式 start, 如果为作业模式不处理,让作业模块处理 */
  563. if (query.workRecord) {
  564. return;
  565. }
  566. /** 作业模式 end */
  567. if (state.defaultModeType == 1) {
  568. headTopData.handleChangeModeType("practise");
  569. // if (state.platform === IPlatform.PC || state.isPreView) {
  570. // headTopData.showBack = false;
  571. // }
  572. if (state.isPreView) {
  573. headTopData.showBack = false;
  574. }
  575. } else {
  576. if (query.modelType) {
  577. if (query.modelType === "practise") {
  578. headTopData.handleChangeModeType("practise");
  579. } else if (query.modelType === "evaluating") {
  580. headTopData.handleChangeModeType("evaluating");
  581. }
  582. headTopData.showBack = false;
  583. } else {
  584. setTimeout(() => {
  585. headTopData.modeType = "init";
  586. }, 500);
  587. }
  588. }
  589. };
  590. /** 课件播放 */
  591. const changePlay = (res: any) => {
  592. // console.log('监听上课页面message',res)
  593. if (res?.data?.api === "setPlayState") {
  594. togglePlay("paused", true);
  595. }
  596. if(res?.data?.api === 'togglePlayState') {
  597. // if(state.playState === "play") {
  598. // togglePlay("paused");
  599. // }
  600. // if(state.playState === 'paused') {
  601. // togglePlay("play");
  602. // }
  603. console.log('togglePlayState', state.playState)
  604. togglePlay(state.playState === "play" ? "paused" : "play");
  605. }
  606. // 上课页面,按钮方向
  607. if (res?.data?.api === "imagePos") {
  608. if (res?.data.data) {
  609. state.playBtnDirection = res.data.data === "right" ? "right" : "left";
  610. // if (state.fingeringInfo.direction === "vertical" && state.setting.displayFingering) {
  611. // state.musicScoreBtnDirection = state.playBtnDirection === 'right' ? 'left' : 'right';
  612. // } else {
  613. // state.musicScoreBtnDirection = state.playBtnDirection;
  614. // }
  615. state.musicScoreBtnDirection = state.playBtnDirection;
  616. }
  617. }
  618. };
  619. const parentClassName = "settingBoxClass_drag";
  620. const userId = storeData.user?.id ? String(storeData.user?.id) : "";
  621. const positionInfo =
  622. state.platform !== IPlatform.PC
  623. ? {
  624. styleDrag: { value: null },
  625. }
  626. : useDrag([`${parentClassName} .top_draging`, `${parentClassName} .bom_drag`], parentClassName, toRef(headTopData, "settingMode"), userId);
  627. const speedClassName = "speedBoxClass_drag";
  628. const speedInfo =
  629. state.platform !== IPlatform.PC
  630. ? {
  631. styleDrag: { value: null },
  632. }
  633. : useDrag([`${speedClassName} .top_draging`, `${speedClassName} .bom_drag`], speedClassName, toRef(headData, "speedShow"), userId);
  634. onMounted(() => {
  635. getQueryModelSetModelType();
  636. window.addEventListener("message", changePlay);
  637. if (state.platform === IPlatform.PC) {
  638. showGuide.value = true;
  639. } else {
  640. showStudentGuide.value = true;
  641. }
  642. if (query.showWebGuide === "false") {
  643. showWebGuide.value = false;
  644. }
  645. document.addEventListener("keydown", (e: KeyboardEvent) => {
  646. if (e.code === "Tab") {
  647. e.stopPropagation();
  648. e.preventDefault();
  649. // onStartPlayState();
  650. togglePlay(state.playState === "play" ? "paused" : "play");
  651. }
  652. });
  653. });
  654. onUnmounted(() => {
  655. window.removeEventListener("message", changePlay);
  656. });
  657. const noticeBarWidth = ref<number>();
  658. watch(
  659. () => smoothAnimationState.isShow.value,
  660. () => {
  661. // NoticeBar能不能滚动
  662. if ((smoothAnimationState.isShow.value || state.isCombineRender) && isMusicList.value) {
  663. nextTick(() => {
  664. const widthCon = (document.querySelector("#noticeBarRollDom .van-notice-bar__content") as any)?.offsetWidth || undefined;
  665. noticeBarWidth.value = widthCon;
  666. });
  667. }
  668. },
  669. { immediate: true }
  670. );
  671. // 设置改变触发
  672. watch(state.setting, () => {
  673. console.log(state.setting, "state.setting");
  674. store.set("musicscoresetting", state.setting);
  675. });
  676. // 获取引导页信息
  677. const getAllGuidance = async () => {
  678. let guideInfo: any = null;
  679. try {
  680. const res = await getGuidance({ guideTag: "guideInfo" });
  681. if (res.data) {
  682. guideInfo = JSON.parse(res.data?.guideValue) || null;
  683. } else {
  684. guideInfo = {};
  685. }
  686. state.guideInfo = guideInfo;
  687. } catch (e) {
  688. console.log(e);
  689. }
  690. };
  691. getAllGuidance();
  692. // 完成拖动弹窗引导页
  693. const handleGuide = async () => {
  694. state.guideInfo.teacherDrag = true;
  695. try {
  696. const res = await setGuidance({ guideTag: "guideInfo", guideValue: JSON.stringify(state.guideInfo) });
  697. } catch (e) {
  698. console.log(e);
  699. }
  700. };
  701. return () => (
  702. <>
  703. <div
  704. class={[styles.headerTop, styles[state.modeType] ,state.platform === IPlatform.PC && state.musicScoreBtnDirection === "left" ? styles.headerTopRight : ""]}
  705. onClick={(e: Event) => {
  706. e.stopPropagation();
  707. if (state.platform === IPlatform.PC) {
  708. // 显示隐藏菜单
  709. window.parent.postMessage(
  710. {
  711. api: "onAttendToggleMenu",
  712. },
  713. "*"
  714. );
  715. }
  716. }}
  717. >
  718. {/* 返回和标题 */}
  719. {!(state.playState == "play" || followData.start || evaluatingData.startBegin) && (
  720. <div id="noticeBarRollDom" class={styles.headTopLeftBox}>
  721. {
  722. !query.isMove && !state.isAttendClass && <img src={iconBack} class={["headTopBackBtn", styles.img, !headTopData.showBack && styles.hidenBack]} onClick={checkBack} />
  723. }
  724. {smoothAnimationState.isShow.value || state.isCombineRender ? (
  725. <div
  726. style={
  727. noticeBarWidth.value
  728. ? {
  729. "--noticeBarWidth": noticeBarWidth.value + "px",
  730. }
  731. : {}
  732. }
  733. class={[styles.title, state.isCbsView && styles.blackTitle, "headeTopTitleBtn"]}
  734. onClick={() => {
  735. isMusicList.value && !state.isAttendClass && (musicListShow.value = true);
  736. }}
  737. >
  738. {isMusicList.value && !state.isAttendClass && <div class={[styles.symbolNote, "driver-8"]}></div>}
  739. <NoticeBar text={state.examSongName} background="none" />
  740. </div>
  741. ) : (
  742. isMusicList.value && !state.isAttendClass && (
  743. <img
  744. src={listImg}
  745. class={[styles.img, styles.listImg, "driver-8"]}
  746. onClick={() => {
  747. musicListShow.value = true;
  748. }}
  749. />
  750. )
  751. )}
  752. </div>
  753. )}
  754. {/* 模式切换 */}
  755. {
  756. <div
  757. id={state.platform === IPlatform.PC ? "teacherTop-0" : "studnetT-0"}
  758. style={{ display: toggleBtn.value.display ? "" : "none" }}
  759. class={["driver-9", styles.modeChangeBox, toggleBtn.value.disabled && styles.disabled]}
  760. onClick={() => {
  761. headTopData.oldModeType = state.modeType;
  762. handleRessetState();
  763. headTopData.modeType = "init";
  764. }}
  765. >
  766. <img class={styles.img} src={iconMode} />
  767. <div class={styles.title}>{state.modeType === "practise" ? "练习模式" : state.modeType === "follow" ? "跟练模式" : state.modeType === "evaluating" ? "评测模式" : ""}</div>
  768. </div>
  769. }
  770. {/* 模式提醒 */}
  771. {state.modeType === "practise" && !rhythmBtn.value.playIng && (
  772. <div class={[styles.modeWarn, "practiseModeWarn", state.platform === IPlatform.PC && state.musicScoreBtnDirection === "left" ? styles.modeWarnRight : ""]}>
  773. <img src={state.playType === "play" ? headImg("perform1.png") : headImg("sing1.png")} />
  774. <div>{state.playType === "play" ? "演奏场景" : "演唱场景"}</div>
  775. </div>
  776. )}
  777. {/* 功能按钮 */}
  778. <div
  779. class={[styles.headRight]}
  780. onClick={(e: Event) => {
  781. e.stopPropagation();
  782. }}
  783. >
  784. {/* 一行谱模式,暂不支持节拍指针 */}
  785. {/* {!state.isSingleLine ? (
  786. <div
  787. class={[styles.btn, state.platform === IPlatform.PC ? styles.pcBtn : ""]}
  788. onClick={() => {
  789. // 切换光标模式
  790. let mode = metronomeData.cursorMode;
  791. if (["follow"].includes(state.modeType)) {
  792. mode = metronomeData.cursorMode === 1 ? 3 : 1;
  793. } else {
  794. mode = metronomeData.cursorMode === 3 ? 1 : metronomeData.cursorMode + 1;
  795. }
  796. metronomeData.cursorMode = mode;
  797. }}
  798. >
  799. <img class={styles.iconBtn} src={headImg(metronomeData.cursorMode === 1 ? "cursor-icon-1.svg" : metronomeData.cursorMode === 2 ? "cursor-icon-2.svg" : metronomeData.cursorMode === 3 ? "cursor-icon-3.svg" : "")} />
  800. <span class={styles.iconContent}>
  801. {metronomeData.cursorMode === 1 ? "音符指针" : metronomeData.cursorMode === 2 ? "节拍指针" : metronomeData.cursorMode === 3 ? "关闭指针" : ""}
  802. {metronomeData.cursorTips && (
  803. <>
  804. <i class={styles.arrowIcon}></i>
  805. <div class={[styles["botton-tips"], metronomeData.cursorMode === 3 ? styles.tipSpec : ""]}>{metronomeData.cursorTips}</div>
  806. </>
  807. )}
  808. </span>
  809. </div>
  810. ) : null} */}
  811. <div
  812. style={{ display: playTypeBtn.value.display ? "" : "none" }}
  813. class={["driver-2", styles.btn, playTypeBtn.value.disabled && styles.disabled, styles.playType]}
  814. onClick={() => {
  815. const oldPlayType = state.playType;
  816. headTopData.oldPlayType = oldPlayType;
  817. const oldPlaySource = state.playSource;
  818. if (state.playType === "play") {
  819. state.playType = "sing";
  820. state.playSource = state.fanSong ? "music" : state.banSong ? "background" : "mingSong";
  821. } else {
  822. state.playType = "play";
  823. state.playSource = state.music ? "music" : state.accompany ? "background" : "mingSong";
  824. }
  825. isClickMode = true;
  826. // 有指法并且显示指法的时候 切换到演唱模式 需要影藏指法
  827. let isRefresh = false;
  828. if (state.isShowFingering && state.fingeringInfo.name && (state.setting.displayFingering || displayFingeringCache)) {
  829. if (state.playType === "sing") {
  830. state.setting.displayFingering = false;
  831. displayFingeringCache = true;
  832. } else {
  833. state.setting.displayFingering = displayFingeringCache;
  834. displayFingeringCache = false;
  835. }
  836. // 如果是竖屏指法和一行谱的时候 改变指法值的时候state 会调用刷新 refreshMusicSvg 所以下面不调用
  837. if (state.fingeringInfo.direction === "vertical" && !state.isSingleLine) {
  838. isRefresh = true;
  839. }
  840. }
  841. // 有歌词的时候,切换播放模式,需要重新渲染谱面 指法不刷新谱面的时候
  842. if (state.xmlHasLyric && !isRefresh) {
  843. refreshMusicSvg();
  844. } else if (!isRefresh) {
  845. handlerModeChange(oldPlayType, oldPlaySource, true);
  846. }
  847. }}
  848. >
  849. <img style={{ display: state.playType === "play" ? "" : "none" }} class={styles.iconBtn} src={headImg(`perform.png`)} />
  850. <img style={{ display: state.playType === "play" ? "none" : "" }} class={styles.iconBtn} src={headImg(`sing.png`)} />
  851. <span>{state.playType === "play" ? "演奏" : "演唱"}</span>
  852. </div>
  853. <div
  854. id={state.platform === IPlatform.PC ? "teacherTop-1" : "studnetT-1"}
  855. style={{ display: originBtn.value.display ? "" : "none" }}
  856. class={["driver-3", styles.btn, originBtn.value.disabled && styles.disabled, state.playType === "play" ? styles.playSource : styles.songSource]}
  857. onClick={async () => {
  858. const oldPlayType = state.playType;
  859. const oldPlaySource = state.playSource;
  860. if (state.playType === "play") {
  861. if (state.playSource === "music") {
  862. state.playSource = state.accompany ? "background" : "mingSong";
  863. } else if (state.playSource === "background") {
  864. state.playSource = state.mingSong ? "mingSong" : "music";
  865. } else {
  866. state.playSource = state.music ? "music" : "background";
  867. }
  868. } else {
  869. if (state.playSource === "music") {
  870. state.playSource = state.banSong ? "background" : "mingSong";
  871. } else if (state.playSource === "background") {
  872. state.playSource = state.mingSong ? "mingSong" : "music";
  873. } else {
  874. state.playSource = state.fanSong ? "music" : "background";
  875. }
  876. }
  877. await handlerModeChange(oldPlayType, oldPlaySource);
  878. showToast({
  879. message: state.playType === "play" ? (state.playSource === "music" ? "已切换为原声" : state.playSource === "background" ? "已切换为伴奏" : "已切换为唱名") : state.playSource === "music" ? "已切换为范唱" : state.playSource === "background" ? "已切换为伴唱" : "已切换为唱名",
  880. position: "top",
  881. className: "selectionToast",
  882. });
  883. }}
  884. >
  885. <img style={{ display: state.playSource === "music" ? "" : "none" }} class={styles.iconBtn} src={state.playType === "play" ? headImg(`music.png`) : headImg(`music1.png`)} />
  886. <img style={{ display: state.playSource === "background" ? "" : "none" }} class={styles.iconBtn} src={state.playType === "play" ? headImg(`background.png`) : headImg(`background1.png`)} />
  887. <img style={{ display: state.playSource === "mingSong" ? "" : "none" }} class={styles.iconBtn} src={headImg(`mingsong.png`)} />
  888. <span>{state.playSource === "music" ? (state.playType === "play" ? "原声" : "范唱") : state.playSource === "background" ? (state.playType === "play" ? "伴奏" : "伴唱") : "唱名"}</span>
  889. </div>
  890. <div
  891. style={{ display: rhythmBtn.value.display ? "" : "none" }}
  892. class={["driver-777", styles.btn, styles.rhythmMode, headTopData.rhythmMode && styles.isrhythmMode, rhythmBtn.value.disabled && styles.disabled]}
  893. onClick={() => {
  894. headTopData.rhythmMode = !headTopData.rhythmMode
  895. }}
  896. >
  897. <img class={styles.iconBtn} src={headImg(`rhythm.png`)} />
  898. <span>律动</span>
  899. </div>
  900. <div
  901. id={state.platform === IPlatform.PC ? "teacherTop-2" : "studnetT-2"}
  902. style={{ display: selectBtn.value.display ? "" : "none" }}
  903. class={["driver-4", styles.btn, selectBtn.value.disabled && styles.disabled, styles.section, state.sectionStatus && styles.isSection]}
  904. onClick={() => handleChangeSection()}
  905. >
  906. <img style={{ display: state.section.length === 0 ? "" : "none" }} class={styles.iconBtn} src={headImg(`section0.png`)} />
  907. <img style={{ display: state.section.length === 1 ? "" : "none" }} class={styles.iconBtn} src={headImg(`section1.png`)} />
  908. <img style={{ display: state.section.length === 2 ? "" : "none" }} class={styles.iconBtn} src={headImg(`section2.png`)} />
  909. <span>选段</span>
  910. </div>
  911. {
  912. <>
  913. <div
  914. style={{ display: metronomeBtn.value.display ? "" : "none" }}
  915. class={["driver-5", styles.btn, styles.metronomeBtn, metronomeBtn.value.disabled && styles.disabled, headData.speedShow && styles.isSpeed, styles.speed]}
  916. onClick={async () => {
  917. headData.speedShow = !headData.speedShow;
  918. }}
  919. >
  920. <img style={{ display: metronomeData.disable ? "block" : "none" }} class={styles.iconBtn} src={headImg("tickon.png")} />
  921. <img style={{ display: !metronomeData.disable ? "block" : "none" }} class={styles.iconBtn} src={headImg("tickoff.png")} />
  922. <span style={{ whiteSpace: "nowrap" }}>节拍</span>
  923. <div class={styles.speedCon}>
  924. <img src={headImg(`${state.speedIcon}.png`)} />
  925. <div>{Math.floor(state.speed)}</div>
  926. </div>
  927. </div>
  928. {
  929. <Popup v-model:show={headData.speedShow} class="popup-custom van-scale center-closeBtn speedBoxClass_drag" transition="van-scale" teleport="body" style={speedInfo.styleDrag.value} overlay-style={{ background: "rgba(0, 0, 0, 0.7)" }}>
  930. <Speed />
  931. {state.platform === IPlatform.PC && <Dragbom showGuide={!state.guideInfo?.teacherDrag} onGuideDone={handleGuide} />}
  932. </Popup>
  933. }
  934. </>
  935. }
  936. {/* {state.enableNotation ? (
  937. <Popover trigger="manual" v-model:show={headData.musicTypeShow} class={state.platform === IPlatform.PC && styles.pcTransPop} placement={state.platform === IPlatform.PC ? "top-end" : "bottom-end"} overlay={false} offset={state.platform === IPlatform.PC ? [0, 40] : [0, 8]}>
  938. {{
  939. reference: () => (
  940. <div
  941. id={state.platform === IPlatform.PC ? "teacherTop-5" : "studnetT-5"}
  942. style={{ display: converBtn.value.display ? "" : "none" }}
  943. class={[styles.btn, converBtn.value.disabled && styles.disabled]}
  944. onClick={(e: Event) => {
  945. e.stopPropagation();
  946. headData.musicTypeShow = !headData.musicTypeShow;
  947. }}
  948. >
  949. <img class={styles.iconBtn} src={headImg("icon_zhuanpu.svg")} />
  950. <span>{state.musicRenderType === "staff" ? "转简谱" : "转五线谱"}</span>
  951. </div>
  952. ),
  953. default: () => <MusicType />,
  954. }}
  955. </Popover>
  956. ) : null} */}
  957. {state.musicRendered && !query.lessonTrainingId && !query.questionId && state.isConcert && (
  958. <div
  959. class={[styles.btn, state.playState === "play" && fingeringBtn.value.disabled && styles.disabled, toggleMusicSheet.show && styles.isMusicSheet, styles.musicSheet, "driver-10"]}
  960. onClick={() => {
  961. toggleMusicSheet.toggle(true);
  962. }}
  963. >
  964. <img class={styles.iconBtn} src={headImg(`shenggui.png`)} />
  965. <span>声部</span>
  966. </div>
  967. )}
  968. <div
  969. id={state.platform === IPlatform.PC ? "teacherTop-6" : "studnetT-6"}
  970. style={{ display: settingBtn.value.display ? "" : "none" }}
  971. class={["driver-6", styles.btn, settingBtn.value.disabled && styles.disabled, headTopData.settingMode && styles.isSettingMode, styles.settingMode]}
  972. onClick={() => (headTopData.settingMode = true)}
  973. >
  974. <img class={styles.iconBtn} src={headImg("icon_menu.png")} />
  975. <span>设置</span>
  976. </div>
  977. </div>
  978. </div>
  979. {/** 指法点击区域 */}
  980. {
  981. state.fingeringInfo.direction === "transverse" && state.setting.displayFingering ?
  982. <div class={styles.headerMid} onClick={() => {
  983. fingerRef.value?.doubeClick()
  984. }}></div> : null
  985. }
  986. {/* 播放按钮 */}
  987. <div
  988. id="studnetT-7"
  989. style={{
  990. display: playBtn.value.display ? "" : "none" ,
  991. opacity: rhythmBtn.value.playIng? "0.4" : "1"
  992. }}
  993. class={[
  994. // 引导使用的类
  995. "driver-1",
  996. styles.playBtn,
  997. playBtn.value.disabled && styles.disabled,
  998. state.platform === IPlatform.PC && state.musicScoreBtnDirection === "left" ? styles.playLeftButton : state.platform === IPlatform.PC && state.musicScoreBtnDirection === "right" ? styles.playRightButton : "",
  999. ]}
  1000. onClick={() => {
  1001. // C调能播放唱名,非C调时,只有谱面类型是首调时,才能播放唱名
  1002. if (!state.isCTone && state.playSource === 'mingSong') {
  1003. const notPlayDesc = state.musicRenderType === EnumMusicRenderType.staff ? '该曲目的五线谱目前还不支持播放唱名' : state.musicRenderType === EnumMusicRenderType.fixedTone ? '该曲目的固定调目前还不支持播放唱名' : '';
  1004. if (notPlayDesc) {
  1005. showToast({
  1006. message: notPlayDesc,
  1007. position: "top",
  1008. className: "selectionToast",
  1009. });
  1010. return
  1011. }
  1012. }
  1013. togglePlay(state.playState === "play" ? "paused" : "play")
  1014. }}
  1015. >
  1016. <div class={styles.btnWrap}>
  1017. <img style={{ display: state.playState === "play" ? "none" : "" }} class={styles.iconBtn} src={headImg("icon_play.png")} />
  1018. <img style={{ display: state.playState === "play" ? "" : "none" }} class={styles.iconBtn} src={headImg("icon_pause.png")} />
  1019. <Circle style={{ opacity: state.playState === "play" ? 1 : 0 }} class={styles.progress} stroke-width={60} stroke-linecap={"square"} currentRate={state.playProgress} rate={100} color="#FFE36A" layer-color="rgba(255,255,255,0.5)" />
  1020. </div>
  1021. </div>
  1022. {/* 重播按钮 */}
  1023. <div
  1024. id="tips-step-9"
  1025. style={{ display: resetBtn.value.display ? "" : "none" }}
  1026. class={[styles.resetBtn, resetBtn.value.disabled && styles.disabled, state.platform === IPlatform.PC && state.musicScoreBtnDirection === "left" ? styles.pauseLeftButton : state.platform === IPlatform.PC && state.musicScoreBtnDirection === "right" ? styles.pauseRightButton : ""]}
  1027. onClick={() => handleResetPlay()}
  1028. >
  1029. <img class={styles.iconBtn} src={headImg("icon_reset.png")} />
  1030. </div>
  1031. <Popup v-model:show={headTopData.settingMode} class="popup-custom van-scale center-closeBtn settingBoxClass_drag" transition="van-scale" teleport="body" style={positionInfo.styleDrag.value} overlay-style={{ background: "rgba(0, 0, 0, 0.7)" }}>
  1032. <Settting />
  1033. {state.platform === IPlatform.PC && <Dragbom showGuide={!state.guideInfo?.teacherDrag} onGuideDone={handleGuide} />}
  1034. </Popup>
  1035. {/* 模式切换 */}
  1036. {/* <ModeTypeMode /> */}
  1037. <ModeView></ModeView>
  1038. {/* isAllBtns */}
  1039. {/* {isAllBtns.value && !query.isCbs && showGuideIndex.value && <TeacherTop></TeacherTop>}
  1040. {isAllBtnsStudent.value && !query.isCbs && showGuideIndex.value && <StudentTop></StudentTop>} */}
  1041. {/* 练习模式功能引导 加载音频完成 不是会员 */}
  1042. {state.modeType === "practise" && headTopData.modeType !== "init" && !query.isCbs && state.audioDone && !state.isLoading && !state.isVip && showWebGuide.value && (
  1043. <PractiseDriver
  1044. statusAll={{
  1045. playBtnStatus: playBtn.value.display,
  1046. subjectStatus: state.musicRendered && !query.lessonTrainingId && !query.questionId && state.isConcert,
  1047. modelTypeStatus: toggleBtn.value.display,
  1048. playType: playTypeBtn.value.display,
  1049. originPlayType: state.playType === "play" ? true : false,
  1050. originBtnStatus: originBtn.value.display,
  1051. backTitle: !(state.playState == "play" || followData.start || evaluatingData.startBegin) && isMusicList.value,
  1052. titleType: smoothAnimationState.isShow.value ? "TEXT" : isMusicList.value ? "IMG" : "NONE",
  1053. }}
  1054. />
  1055. )}
  1056. {/* 跟练模式功能引导 加载音频完成 不是会员 */}
  1057. {state.modeType === "follow" && headTopData.modeType !== "init" && !query.isCbs && state.audioDone && !state.isLoading && !state.isVip && showWebGuide.value && (
  1058. <FollowDriver
  1059. statusAll={{
  1060. subjectStatus: state.musicRendered && !query.lessonTrainingId && !query.questionId && state.isConcert,
  1061. }}
  1062. />
  1063. )}
  1064. {/* 评测模式功能引导 加载音频完成 不是会员 */}
  1065. {state.modeType === "evaluating" && headTopData.modeType !== "init" && !evaluatingData.earphoneMode && !query.isCbs && state.audioDone && !state.isLoading && !state.isVip && evaluatingData.websocketState && !evaluatingData.startBegin && evaluatingData.checkEnd && showWebGuide.value && (
  1066. <EvaluatingDriver
  1067. statusAll={{
  1068. subjectStatus: state.musicRendered && !query.lessonTrainingId && !query.questionId && state.isConcert,
  1069. }}
  1070. />
  1071. )}
  1072. {/** 评测作业,没有完成时,提示弹窗 */}
  1073. <Popup v-model:show={headTopData.workHomeNoDone} class="popup-custom van-scale center-closeBtn" transition="van-scale" teleport="body" style={positionInfo.styleDrag.value} overlay-style={{ background: "rgba(0, 0, 0, 0.7)" }}>
  1074. <WorkHomePop onClose={handleResult} />
  1075. </Popup>
  1076. </>
  1077. );
  1078. },
  1079. });