Преглед изворни кода

乐教通 返回逻辑修改

黄琪勇 пре 10 месеци
родитељ
комит
a9e92295de
1 измењених фајлова са 15 додато и 9 уклоњено
  1. 15 9
      src/subpages/colexiu/buttons/index.tsx

+ 15 - 9
src/subpages/colexiu/buttons/index.tsx

@@ -94,7 +94,13 @@ const beforeCheck = (cb: (status: boolean) => void) => {
 const back: () => void = () => {
   // 如果是乐教通,点击返回按钮,需要关闭当前窗口
   if (window.location.href.includes('isYjt')) {
-    window.close();
+    window.parent.postMessage(
+      {
+        api: "api_YjtClose"
+      },
+      "*"
+    );
+    return
   }
   submitMaxScore()
   sendBackRecordTotalTime()
@@ -246,7 +252,7 @@ export default defineComponent({
               )}
             </Transition>
           </div>
-          <div class={[styles.moreButton]} style={{ opacity: detailState.initRendered ? 1 : 0 }}>           
+          <div class={[styles.moreButton]} style={{ opacity: detailState.initRendered ? 1 : 0 }}>
             {!search?.modelType && modelType.value !== 'init' && !detailState.frozenMode && !detailState.isLessonTrain && (
               <Button
                 data-step="m0"
@@ -306,8 +312,8 @@ export default defineComponent({
                     <div class={classNames(styles['botton-tips'],metronomeData.cursorMode === 3 ? styles.tipSpec : '')}>{metronomeData.cursorTips}</div>
                   </>}
                 </span>
-              </Button>            
-            </>             
+              </Button>
+            </>
             {detailState.initRendered && !search.lessonTrainingId && !search.questionId &&  detailState.activeDetail?.musicSheetType == 'CONCERT' && (
               <Button
                 class={[styles.button, styles.hasText]}
@@ -328,7 +334,7 @@ export default defineComponent({
             {['practice', 'evaluation'].includes(modelType.value) && (
               <>
                 {
-                  modelType.value === 'practice' ? 
+                  modelType.value === 'practice' ?
                   <Button
                     data-step="m1"
                     class={[styles.button, styles.hasText]}
@@ -360,7 +366,7 @@ export default defineComponent({
                   </Button>
                 )}
                 {
-                  modelType.value === 'practice' ? 
+                  modelType.value === 'practice' ?
                   <Button
                     data-step="m3"
                     class={[styles.button, styles.hasText]}
@@ -372,7 +378,7 @@ export default defineComponent({
                   >
                     <ButtonIcon key="music" name={SettingState.sett.fingering ? 'fingeringOn' : 'fingeringOff'} />
                     <span>指法</span>
-                  </Button> : null               
+                  </Button> : null
                 }
               </>
             )}
@@ -428,8 +434,8 @@ export default defineComponent({
 
                 <Evaluating ref={evaluatingRef} />
               </>
-            )}    
-                    
+            )}
+
             {['practice', 'evaluation'].includes(modelType.value) && !search.lessonTrainingId && (
               <Popover
                 trigger="manual"