瀏覽代碼

优化提示

黄琪勇 10 月之前
父節點
當前提交
786cbb87f2
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      src/page-instrument/header-top/index.tsx
  2. 3 3
      src/state.ts

+ 1 - 1
src/page-instrument/header-top/index.tsx

@@ -543,7 +543,7 @@ export default defineComponent({
     const changePlay = (res: any) => {
       // console.log('监听上课页面message',res)
       if (res?.data?.api === "setPlayState") {
-        togglePlay("paused", "courseware");
+        togglePlay("paused", true);
       }
       // 上课页面,按钮方向
       if (res?.data?.api === "imagePos") {

+ 3 - 3
src/state.ts

@@ -779,10 +779,10 @@ export const skipNotePlay = async (itemIndex: number, isStart = false) => {
  * 切换曲谱播放状态
  * @param playState 需要切换的状态 play:播放, paused: 暂停
  */
-export const togglePlay = async (playState: "play" | "paused", sourceType?: string) => {
+export const togglePlay = async (playState: "play" | "paused", isForceCLoseToast?:boolean) => {
   // 如果mp3资源还在加载中,给出提示
   if (!state.isAppPlay && !state.audioDone) {
-    if (sourceType !== 'courseware') showToast('音频资源加载中,请稍后')
+    if (!isForceCLoseToast) showToast('音频资源加载中,请稍后')
     return
   }
   // 播放之前  当为评测模式和不为MIDI时候按  是否禁用节拍器  切换音源
@@ -1293,7 +1293,7 @@ export const handleRessetState = () => {
   if (state.modeType === "evaluating") {
     handleStartEvaluat();
   } else if (state.modeType === "practise") {
-    togglePlay("paused");
+    togglePlay("paused", true);
   } else if (state.modeType === "follow") {
     toggleFollow(false);
   }