lex 1 vuosi sitten
vanhempi
commit
80362e492b
2 muutettua tiedostoa jossa 26 lisäystä ja 12 poistoa
  1. 25 12
      src/page-instrument/view-figner/index.tsx
  2. 1 0
      src/view/fingering/fingering-config.ts

+ 25 - 12
src/page-instrument/view-figner/index.tsx

@@ -302,11 +302,15 @@ export default defineComponent({
     };
 
     onBeforeMount(async () => {
+      if (browser().isApp) {
+        state.platform = "APP" as IPlatform;
+      } else {
+        state.platform = query.platform?.toLocaleUpperCase() || "";
+      }
+
       if (state.platform === IPlatform.PC) {
         document.title = "听音练习";
       }
-
-      state.platform = query.platform?.toLocaleUpperCase() || "";
       await getSubjects();
       __init();
     });
@@ -352,14 +356,21 @@ export default defineComponent({
         emit("close");
         return;
       } else if (state.platform === IPlatform.PC) {
-        // 老师端,首页
-        window.parent.postMessage(
-          {
-            api: "iframe_exit",
-          },
-          "*"
-        );
-        return;
+        console.log(1, query);
+        if (query.matchMedia == 1) {
+          // 老师端,首页
+          window.parent.postMessage(
+            {
+              api: "iframe_exit",
+            },
+            "*"
+          );
+          return;
+        } else {
+          window.close();
+          return;
+        }
+
         // if (fingerData.fingeringInfo.orientation === 0) {
         // 	api_setRequestedOrientation(1);
         // }
@@ -887,6 +898,8 @@ export default defineComponent({
                   api_setRequestedOrientation(orientationDirection.value);
                   // 设置屏幕方向
                   setTimeout(() => {
+                    data.paddingTop = "";
+                    data.paddingLeft = "";
                     __init();
                   }, 100);
                 }}
@@ -994,7 +1007,7 @@ export default defineComponent({
                 {playAction.userAnswerStatus === 1 && <div class={[styles.tipsT, styles.playSuccess]}></div>}
                 {playAction.userAnswerStatus === 2 && <div class={[styles.tipsT, styles.playError]}></div>}
 
-                {((data.noteType !== "#c" && orientationDirection.value === 0) || orientationDirection.value === 1) && (
+                {((data.noteType !== "#c" && (orientationDirection.value === 0 || (orientationDirection.value === 1 && state.platform === IPlatform.PC))) || (orientationDirection.value === 1 && state.platform === IPlatform.APP)) && (
                   <Button class={styles.noteBtn} onClick={() => scrollNoteBox("left")}>
                     <Icon name="arrow-left" />
                   </Button>
@@ -1078,7 +1091,7 @@ export default defineComponent({
                     </div>
                   </div>
                 </div>
-                {((data.noteType !== "#c" && orientationDirection.value === 0) || orientationDirection.value === 1) && (
+                {((data.noteType !== "#c" && (orientationDirection.value === 0 || (orientationDirection.value === 1 && state.platform === IPlatform.PC))) || (orientationDirection.value === 1 && state.platform === IPlatform.APP)) && (
                   <Button class={styles.noteBtn} onClick={() => scrollNoteBox("right")}>
                     <Icon name="arrow" />
                   </Button>

+ 1 - 0
src/view/fingering/fingering-config.ts

@@ -101,6 +101,7 @@ export const mappingVoicePart = (id: number | string, soruce: "GYM" | "COLEXIU"
     if (typeof code === "string") {
       code = code.toLocaleLowerCase().replace(/ /g, "");
     }
+    console.log(code, "1212");
     const subject: { [_key: string | number]: any } = {
       flute: 2,
       clarinet: 4,