Browse Source

feat: 嵌入乐教通修改

TIANYONG 6 months ago
parent
commit
3f7411e046

+ 7 - 0
src/subpages/colexiu/App.tsx

@@ -149,6 +149,13 @@ export default defineComponent({
     }
 
     onMounted(() => {
+      if (location.href.includes('isYjt')) {
+        window.document.title = '乐教通'
+        // 禁用右键菜单
+        document.addEventListener("contextmenu", function (event) {
+          event.preventDefault();
+        });
+      }
       // 进入页面设置常量
       postMessage({
         api: 'keepScreenLongLight',

+ 5 - 1
src/subpages/colexiu/buttons/index.tsx

@@ -92,6 +92,10 @@ const beforeCheck = (cb: (status: boolean) => void) => {
 }
 
 const back: () => void = () => {
+  // 如果是乐教通,点击返回按钮,需要关闭当前窗口
+  if (window.location.href.includes('isYjt')) {
+    window.close();
+  }
   submitMaxScore()
   sendBackRecordTotalTime()
   postMessage({
@@ -206,7 +210,7 @@ export default defineComponent({
           style={search.headerHeight ? { height: '1rem', paddingTop: '0.25rem' } : ''}
         >
           <div class={styles.leftButton}>
-            {search?.modelType && !search.unitId ? null : <img class={styles.backbtn} src={iconBack} onClick={back} />}
+            {(search?.modelType && !search.unitId) || search.isHideBack ? null : <img class={styles.backbtn} src={iconBack} onClick={back} />}
             <div class={styles.titleWrap}>
               <div class={styles.title}>{detailState.activeDetail?.musicSheetName}</div>
               {search.albumName && <div class={styles.album}>{search.albumName}</div>}

+ 4 - 0
src/subpages/colexiu/index.tsx

@@ -106,6 +106,10 @@ export default defineComponent({
     })
 
     onMounted(() => {
+      const search = useOriginSearch()
+      // if (search.isYjt == "1") {
+      //   window.document.title = '乐教通'
+      // }
       ;(window as any).appName = 'colexiu'
       RuntimeUtils.event.on('settingFingeringChange', settingFingeringChange)
       postMessage({