TIANYONG 9 months ago
parent
commit
465cf1123e

+ 8 - 8
dist/colexiu.html

@@ -2,7 +2,7 @@
 <html lang="en">
 
 <head>
-  <script type="module" crossorigin src="./js/polyfills-64fa2641.js"></script>
+  <script type="module" crossorigin src="./js/polyfills-97cd8107.js"></script>
 
   <meta charset="UTF-8" />
   <link rel="icon" type="image/svg+xml" href="./vite.svg" />
@@ -40,12 +40,12 @@
       },
     })
   </script>
-  <script type="module" crossorigin src="./js/colexiu-b47f07da.js"></script>
-  <link rel="modulepreload" crossorigin href="./js/index-b9496a10.js">
-  <link rel="modulepreload" crossorigin href="./js/index-535c94c7.js">
-  <link rel="modulepreload" crossorigin href="./js/index-d78bd6a8.js">
-  <link rel="modulepreload" crossorigin href="./js/index-ede87311.js">
-  <link rel="stylesheet" href="./css/index-14f2d759.css">
+  <script type="module" crossorigin src="./js/colexiu-755ffde2.js"></script>
+  <link rel="modulepreload" crossorigin href="./js/index-1c3b512b.js">
+  <link rel="modulepreload" crossorigin href="./js/index-7a726de5.js">
+  <link rel="modulepreload" crossorigin href="./js/index-d4a466e8.js">
+  <link rel="modulepreload" crossorigin href="./js/index-bfe42266.js">
+  <link rel="stylesheet" href="./css/index-ff88379e.css">
   <link rel="stylesheet" href="./css/index-d42b0794.css">
   <link rel="stylesheet" href="./css/colexiu-62f31c4f.css">
   <script type="module">import.meta.url;import("_").catch(()=>1);async function* g(){};window.__vite_is_modern_browser=true;</script>
@@ -58,7 +58,7 @@
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
   <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-8891b9b0.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/colexiu-legacy-8f01f3f4.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/colexiu-legacy-94da7ee2.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 20 - 13
dist/flexible.js

@@ -1,18 +1,25 @@
 ! function (a, b) {
   function c() {
-    var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
-    var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
-    var b = width > height ? height : width;
-    b / i > 640 && (b = 640 * i);
-    b / i < 375 && (b = 375 * i);
-    var c = b / 10;
-    // 老师端,fontsize计算
-    // if (window.location.search.includes('platform=pc') || window.location.search.includes('platform=PC')) {
-    //   c = width / 21.7;
-    // }
-    // console.log('fontSize:',c,'屏幕宽度:',width,'老师端:',window.location.search.includes('platform=pc'))
-    f.style.fontSize = c + "px", k.rem = a.rem = c
-    window.fontSize = c
+    try {
+      var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
+      var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
+      var b = width > height ? height : width;
+      b / i > 640 && (b = 640 * i);
+      b / i < 375 && (b = 375 * i);
+      var c = b / 10;
+      // 老师端,fontsize计算
+      // if (window.location.search.includes('platform=pc') || window.location.search.includes('platform=PC')) {
+      //   c = width / 21.7;
+      // }
+      // console.log('fontSize:',c,'屏幕宽度:',width,'老师端:',window.location.search.includes('platform=pc'))
+      c = c || 64;
+      f.style.fontSize = c + "px", k.rem = a.rem = c
+      window.fontSize = c
+    } catch (error) {
+      f.style.fontSize = 64 + "px"
+      window.fontSize = 64
+    }
+
   }
   var d, e = a.document,
     f = e.documentElement,

+ 9 - 9
dist/index.html

@@ -2,7 +2,7 @@
 <html lang="ZH-cn">
 
 <head>
-  <script type="module" crossorigin src="./js/polyfills-64fa2641.js"></script>
+  <script type="module" crossorigin src="./js/polyfills-97cd8107.js"></script>
 
   <meta charset="UTF-8">
   <link rel="icon" href="./favicon.ico" />
@@ -75,14 +75,14 @@
       }
     })
   </script>
-  <script type="module" crossorigin src="./js/gym-39fac7c6.js"></script>
-  <link rel="modulepreload" crossorigin href="./js/index-b9496a10.js">
-  <link rel="modulepreload" crossorigin href="./js/index-535c94c7.js">
-  <link rel="modulepreload" crossorigin href="./js/instruments-666369f1.js">
-  <link rel="modulepreload" crossorigin href="./js/index-69c6f782.js">
-  <link rel="modulepreload" crossorigin href="./js/index-ede87311.js">
+  <script type="module" crossorigin src="./js/gym-afce9f9e.js"></script>
+  <link rel="modulepreload" crossorigin href="./js/index-1c3b512b.js">
+  <link rel="modulepreload" crossorigin href="./js/index-7a726de5.js">
+  <link rel="modulepreload" crossorigin href="./js/instruments-4a8f25c3.js">
+  <link rel="modulepreload" crossorigin href="./js/index-c763f5cb.js">
+  <link rel="modulepreload" crossorigin href="./js/index-bfe42266.js">
   <link rel="modulepreload" crossorigin href="./js/plyr.min-c8c2777b.js">
-  <link rel="stylesheet" href="./css/index-14f2d759.css">
+  <link rel="stylesheet" href="./css/index-ff88379e.css">
   <link rel="stylesheet" href="./css/index-d42b0794.css">
   <link rel="stylesheet" href="./css/index-85f95688.css">
   <link rel="stylesheet" href="./css/plyr-ad8ef5ae.css">
@@ -101,7 +101,7 @@
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
   <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-8891b9b0.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/gym-legacy-b9668423.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/gym-legacy-fabee3dd.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 10 - 10
dist/instrument.html

@@ -2,7 +2,7 @@
 <html lang="en">
 
 <head>
-  <script type="module" crossorigin src="./js/polyfills-64fa2641.js"></script>
+  <script type="module" crossorigin src="./js/polyfills-97cd8107.js"></script>
 
   <meta charset="UTF-8" />
   <meta name="viewport"
@@ -40,15 +40,15 @@
       })
     }
   </script>
-  <script type="module" crossorigin src="./js/instrument-33da370f.js"></script>
-  <link rel="modulepreload" crossorigin href="./js/index-b9496a10.js">
-  <link rel="modulepreload" crossorigin href="./js/index-535c94c7.js">
-  <link rel="modulepreload" crossorigin href="./js/index-d78bd6a8.js">
-  <link rel="modulepreload" crossorigin href="./js/instruments-666369f1.js">
-  <link rel="modulepreload" crossorigin href="./js/index-fb46b694.js">
-  <link rel="stylesheet" href="./css/index-14f2d759.css">
+  <script type="module" crossorigin src="./js/instrument-ffe2bb74.js"></script>
+  <link rel="modulepreload" crossorigin href="./js/index-1c3b512b.js">
+  <link rel="modulepreload" crossorigin href="./js/index-7a726de5.js">
+  <link rel="modulepreload" crossorigin href="./js/index-d4a466e8.js">
+  <link rel="modulepreload" crossorigin href="./js/instruments-4a8f25c3.js">
+  <link rel="modulepreload" crossorigin href="./js/index-5bbc96b4.js">
+  <link rel="stylesheet" href="./css/index-ff88379e.css">
   <link rel="stylesheet" href="./css/index-d42b0794.css">
-  <link rel="stylesheet" href="./css/instrument-032354cf.css">
+  <link rel="stylesheet" href="./css/instrument-4e48c51c.css">
   <script type="module">import.meta.url;import("_").catch(()=>1);async function* g(){};window.__vite_is_modern_browser=true;</script>
   <script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
 </head>
@@ -67,7 +67,7 @@
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
   <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-8891b9b0.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/instrument-legacy-bc18295b.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/instrument-legacy-43651769.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 10 - 10
dist/orchestra.html

@@ -2,7 +2,7 @@
 <html lang="en">
 
 <head>
-  <script type="module" crossorigin src="./js/polyfills-64fa2641.js"></script>
+  <script type="module" crossorigin src="./js/polyfills-97cd8107.js"></script>
 
   <meta charset="UTF-8" />
   <!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" /> -->
@@ -41,14 +41,14 @@
       transition: opacity .3s;
     }
   </style>
-  <script type="module" crossorigin src="./js/orchestra-3d9f8e98.js"></script>
-  <link rel="modulepreload" crossorigin href="./js/index-b9496a10.js">
-  <link rel="modulepreload" crossorigin href="./js/index-535c94c7.js">
-  <link rel="modulepreload" crossorigin href="./js/index-d78bd6a8.js">
-  <link rel="modulepreload" crossorigin href="./js/index-69c6f782.js">
-  <link rel="modulepreload" crossorigin href="./js/index-ede87311.js">
-  <link rel="modulepreload" crossorigin href="./js/index-fb46b694.js">
-  <link rel="stylesheet" href="./css/index-14f2d759.css">
+  <script type="module" crossorigin src="./js/orchestra-77b2cbb9.js"></script>
+  <link rel="modulepreload" crossorigin href="./js/index-1c3b512b.js">
+  <link rel="modulepreload" crossorigin href="./js/index-7a726de5.js">
+  <link rel="modulepreload" crossorigin href="./js/index-d4a466e8.js">
+  <link rel="modulepreload" crossorigin href="./js/index-c763f5cb.js">
+  <link rel="modulepreload" crossorigin href="./js/index-bfe42266.js">
+  <link rel="modulepreload" crossorigin href="./js/index-5bbc96b4.js">
+  <link rel="stylesheet" href="./css/index-ff88379e.css">
   <link rel="stylesheet" href="./css/index-d42b0794.css">
   <link rel="stylesheet" href="./css/index-85f95688.css">
   <link rel="stylesheet" href="./css/orchestra-8bc1a9c0.css">
@@ -73,7 +73,7 @@
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
   <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-8891b9b0.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/orchestra-legacy-f6d4af6c.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/orchestra-legacy-093b5b74.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 5 - 5
dist/report-share.html

@@ -2,7 +2,7 @@
 <html lang="en">
 
 <head>
-  <script type="module" crossorigin src="./js/polyfills-64fa2641.js"></script>
+  <script type="module" crossorigin src="./js/polyfills-97cd8107.js"></script>
 
   <meta charset="UTF-8" />
   <!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" /> -->
@@ -25,10 +25,10 @@
       transition: opacity .3s;
     }
   </style>
-  <script type="module" crossorigin src="./js/report-share-8f1e46a6.js"></script>
-  <link rel="modulepreload" crossorigin href="./js/index-b9496a10.js">
+  <script type="module" crossorigin src="./js/report-share-7571c083.js"></script>
+  <link rel="modulepreload" crossorigin href="./js/index-1c3b512b.js">
   <link rel="modulepreload" crossorigin href="./js/plyr.min-c8c2777b.js">
-  <link rel="stylesheet" href="./css/index-14f2d759.css">
+  <link rel="stylesheet" href="./css/index-ff88379e.css">
   <link rel="stylesheet" href="./css/plyr-ad8ef5ae.css">
   <link rel="stylesheet" href="./css/report-share-0f4c3151.css">
   <script type="module">import.meta.url;import("_").catch(()=>1);async function* g(){};window.__vite_is_modern_browser=true;</script>
@@ -52,7 +52,7 @@
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
   <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-8891b9b0.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/report-share-legacy-204faf1f.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/report-share-legacy-e68dde79.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 2 - 4
src/page-instrument/component/mode-type-mode/index.tsx

@@ -29,10 +29,8 @@ export default defineComponent({
         // PC
         data.showPC = true;
       } else {
-        // 添加学校上设置【课件解锁】,判断逻辑
-        const schoolInfos = storeData.user.schoolInfos;
-        const schoolLock = schoolInfos && schoolInfos.length > 0 ? schoolInfos[0].needVipLock : true;
-        if (storeData.user.vipMember || !schoolLock) {
+        // 从课堂乐器学生端课件预览默认不显示会员
+        if (storeData.user.vipMember || state.paymentType === "FREE" || query.showCourseMember === "true") {
           // 学生端
           data.showStudent = true;
         } else {

BIN
src/page-instrument/custom-plugins/the-vip/icon_bg.png


BIN
src/page-instrument/custom-plugins/the-vip/icon_btn.png


BIN
src/page-instrument/custom-plugins/the-vip/icon_btn_cancel.png


+ 17 - 8
src/page-instrument/custom-plugins/the-vip/index.module.less

@@ -1,12 +1,12 @@
 .container {
     position: relative;
     width: 278px;
-    height: 250px;
+    height: 252px;
     background: url('./icon_bg.png') no-repeat;
-    background-size: 100%;
+    background-size: contain;
     display: flex;
     flex-direction: column;
-    padding-top: 50px;
+    padding-top: 126px;
 }
 
 .close {
@@ -25,7 +25,7 @@
 
 .content {
     position: relative;
-    padding: 35px 13px 25px 13px;
+    padding: 0 13px 25px 13px;
     font-size: 14px;
     font-weight: 400;
     color: #333333;
@@ -34,18 +34,27 @@
 }
 
 .btns {
-    width: 159px;
-    margin: 0 auto;
+    // width: 159px;
+    margin: 0 auto 23px;
     display: flex;
-    flex-direction: column;
     justify-content: center;
     font-size: 16px;
     color: #777;
     line-height: 22px;
     text-align: center;
 
+    .btn {
+        width: 101px;
+        height: 37px;
+        cursor: pointer;
+    }
+
+    .btnCancel {
+        margin-right: 10px;
+    }
+
     img {
         width: 100%;
-        margin-bottom: 9px;
+        // margin-bottom: 9px;
     }
 }

+ 4 - 2
src/page-instrument/custom-plugins/the-vip/index.tsx

@@ -1,6 +1,7 @@
 import { defineComponent } from "vue";
 import icon_title from "./icon_title.png";
 import icon_btn from "./icon_btn.png";
+import icon_btn_cancel from "./icon_btn_cancel.png";
 import icon_close from "./icon_close.png";
 import styles from "./index.module.less";
 import { Popup } from "vant";
@@ -29,12 +30,13 @@ export default defineComponent({
     return () => (
       <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom"]} show={true}>
         <div class={styles.container}>
-          <img class={styles.close} src={icon_close} onClick={close} />
-          <img class={styles.title} src={icon_title} />
+          {/* <img class={styles.close} src={icon_close} onClick={close} /> */}
+          {/* <img class={styles.title} src={icon_title} /> */}
           <div class={styles.content}>
             立即开通<span style={{ color: "#FF5A56" }}>"乐器AI学练工具"</span>服务,解锁更多专属权益,享受全新学习体验!
           </div>
           <div class={styles.btns}>
+            <img class={[styles.btn, styles.btnCancel]} src={icon_btn_cancel} onClick={close} />
             <img
               class={styles.btn}
               src={icon_btn}

+ 123 - 95
src/page-instrument/header-top/index.tsx

@@ -23,7 +23,7 @@ import { browser } from "/src/utils";
 import store from "store";
 import "../component/the-modal-tip/index.module.less";
 import { metronomeData } from "../../helpers/metronome";
-import { toggleMusicSheet } from "/src/view/plugins/toggleMusicSheet"
+import { toggleMusicSheet } from "/src/view/plugins/toggleMusicSheet";
 import useDrag from "/src/view/plugins/useDrag/index";
 import Dragbom from "/src/view/plugins/useDrag/dragbom";
 import { getGuidance, setGuidance } from "../custom-plugins/guide-page/api";
@@ -39,22 +39,22 @@ export const headTopData = reactive({
   /** 切换模式 */
   handleChangeModeType(value: "practise" | "follow" | "evaluating") {
     // 后台设置为不能评测
-    if (value === 'evaluating' && !state.enableEvaluation) return
+    if (value === "evaluating" && !state.enableEvaluation) return;
     // 打击乐&节奏练习不支持跟练模式
-    if (value === 'follow' && state.isPercussion) return
+    if (value === "follow" && state.isPercussion) return;
     // 跟练模式,光标只有音符模式,无节拍模式
-    if (value === 'follow' && metronomeData.cursorMode === 2) {
-      metronomeData.cursorMode = 1
+    if (value === "follow" && metronomeData.cursorMode === 2) {
+      metronomeData.cursorMode = 1;
     }
-    if (value === 'practise') {
+    if (value === "practise") {
       // state.playIngSpeed = state.speed
     }
     if (value === "evaluating") {
       // 如果延迟检测资源还在加载中,给出提示
       if (!evaluatingData.jsonLoadDone) {
-        evaluatingData.jsonLoading = true
-        showToast('资源加载中,请稍后')
-        return
+        evaluatingData.jsonLoading = true;
+        showToast("资源加载中,请稍后");
+        return;
       }
 
       // 如果是pc端, 评测模式暂不可用
@@ -67,13 +67,12 @@ export const headTopData = reactive({
         });
         return;
       }
-      state.playIngSpeed = state.originSpeed
+      state.playIngSpeed = state.originSpeed;
       handleStartEvaluat();
       // 开发模式,把此处打开
       // state.modeType = "evaluating"
       // evaluatingData.rendered = true;
       // evaluatingData.soundEffectMode = true;
-      
     } else if (value === "follow") {
       toggleFollow();
     }
@@ -248,6 +247,18 @@ export default defineComponent({
 
       return flag;
     });
+
+    const showGuideIndex = computed(() => {
+      // 从课堂乐器学生端课件预览默认不显示会员
+      if (storeData.user.vipMember || state.paymentType === "FREE" || query.showCourseMember === "true") {
+        // 学生端
+        return true;
+      } else {
+        // vip
+        return false;
+      }
+    });
+
     const browInfo = browser();
     /** 返回 */
     const handleBack = () => {
@@ -275,7 +286,7 @@ export default defineComponent({
       /** 作业模式 end */
       if (state.defaultModeType == 1) {
         headTopData.handleChangeModeType("practise");
-        if (query.modelType) {
+        if (state.platform === IPlatform.PC || state.isPreView) {
           headTopData.showBack = false;
         }
       } else {
@@ -298,7 +309,7 @@ export default defineComponent({
     const changePlay = (res: any) => {
       // console.log('监听上课页面message',res)
       if (res?.data?.api === "setPlayState") {
-        togglePlay("paused","courseware");
+        togglePlay("paused", "courseware");
       }
 
       // 菜单状态
@@ -309,7 +320,7 @@ export default defineComponent({
       // 上课页面,按钮方向
       if (res?.data?.api === "imagePos") {
         if (res?.data.data) {
-          state.playBtnDirection = res.data.data === 'right' ? 'right' : 'left';
+          state.playBtnDirection = res.data.data === "right" ? "right" : "left";
           // if (state.fingeringInfo.direction === "vertical" && state.setting.displayFingering) {
           //   state.musicScoreBtnDirection = state.playBtnDirection === 'right' ? 'left' : 'right';
           // } else {
@@ -321,18 +332,13 @@ export default defineComponent({
     };
 
     const parentClassName = "settingBoxClass_drag";
-    const userId = storeData.user?.id ? String(storeData.user?.id) : '';
-    const positionInfo = state.platform !== IPlatform.PC ? {
-      styleDrag: { value: null }
-    } : useDrag(
-      [
-        `${parentClassName} .top_drag`,
-        `${parentClassName} .bom_drag`
-      ],
-      parentClassName,
-      toRef(headTopData, 'settingMode'),
-      userId
-    )
+    const userId = storeData.user?.id ? String(storeData.user?.id) : "";
+    const positionInfo =
+      state.platform !== IPlatform.PC
+        ? {
+            styleDrag: { value: null },
+          }
+        : useDrag([`${parentClassName} .top_drag`, `${parentClassName} .bom_drag`], parentClassName, toRef(headTopData, "settingMode"), userId);
 
     onMounted(() => {
       getQueryModelSetModelType();
@@ -355,32 +361,31 @@ export default defineComponent({
     });
 
     // 获取引导页信息
-		const getAllGuidance = async()=>{
+    const getAllGuidance = async () => {
       let guideInfo: any = null;
-		  try{
-        const res = await getGuidance({guideTag:'guideInfo'})
-        if(res.data){
-          guideInfo = JSON.parse(res.data?.guideValue) || null
-        }else{
-          guideInfo = {}
+      try {
+        const res = await getGuidance({ guideTag: "guideInfo" });
+        if (res.data) {
+          guideInfo = JSON.parse(res.data?.guideValue) || null;
+        } else {
+          guideInfo = {};
         }
         state.guideInfo = guideInfo;
-		  }catch(e){
-		    console.log(e)
-		  }
-	  
-		}
-		getAllGuidance()    
+      } catch (e) {
+        console.log(e);
+      }
+    };
+    getAllGuidance();
 
     // 完成拖动弹窗引导页
     const handleGuide = async () => {
       state.guideInfo.teacherDrag = true;
-			try{
-				const res = await setGuidance({guideTag:'guideInfo',guideValue:JSON.stringify(state.guideInfo)})
-      }catch(e){
-        console.log(e)
-      }   
-    }
+      try {
+        const res = await setGuidance({ guideTag: "guideInfo", guideValue: JSON.stringify(state.guideInfo) });
+      } catch (e) {
+        console.log(e);
+      }
+    };
 
     return () => (
       <>
@@ -402,7 +407,7 @@ export default defineComponent({
           <div class={[styles.back, "headTopBackBtn", !headTopData.showBack && styles.hidenBack]} onClick={handleBack}>
             <img src={iconBack} />
           </div>
-          {(query.iscurseplay === "play" || state.platform === IPlatform.PC) ? null : <Title class="pcTitle" text={state.examSongName} rightView={false} />}
+          {query.iscurseplay === "play" || state.platform === IPlatform.PC ? null : <Title class="pcTitle" text={state.examSongName} rightView={false} />}
 
           <div
             class={[styles.headRight, state.platform === IPlatform.PC && styles.pcHeadRight]}
@@ -410,7 +415,6 @@ export default defineComponent({
               e.stopPropagation();
             }}
           >
-                        
             <div
               id={state.platform === IPlatform.PC ? "teacherTop-0" : "studnetT-0"}
               style={{ display: toggleBtn.value.display ? "" : "none" }}
@@ -425,34 +429,40 @@ export default defineComponent({
             </div>
 
             {/* 一行谱模式,暂不支持节拍指针 */}
-            {
-              !state.isSingleLine ? 
-              <div class={[styles.btn, state.platform === IPlatform.PC ? styles.pcBtn : ""]} onClick={() => {
-                // 切换光标模式
-                let mode = metronomeData.cursorMode
-                if (['follow'].includes(state.modeType)) {
-                  mode = metronomeData.cursorMode === 1 ? 3 : 1
-                } else {
-                  mode = metronomeData.cursorMode === 3 ? 1 : metronomeData.cursorMode + 1
-                }              
-                metronomeData.cursorMode = mode
-              }}>
-                <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' : '')} />
+            {!state.isSingleLine ? (
+              <div
+                class={[styles.btn, state.platform === IPlatform.PC ? styles.pcBtn : ""]}
+                onClick={() => {
+                  // 切换光标模式
+                  let mode = metronomeData.cursorMode;
+                  if (["follow"].includes(state.modeType)) {
+                    mode = metronomeData.cursorMode === 1 ? 3 : 1;
+                  } else {
+                    mode = metronomeData.cursorMode === 3 ? 1 : metronomeData.cursorMode + 1;
+                  }
+                  metronomeData.cursorMode = mode;
+                }}
+              >
+                <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" : "")} />
                 <span class={styles.iconContent}>
-                  {metronomeData.cursorMode === 1 ? '音符指针' : metronomeData.cursorMode === 2 ? '节拍指针' : metronomeData.cursorMode === 3 ? '关闭指针' : ''}
-                  {metronomeData.cursorTips && <>
+                  {metronomeData.cursorMode === 1 ? "音符指针" : metronomeData.cursorMode === 2 ? "节拍指针" : metronomeData.cursorMode === 3 ? "关闭指针" : ""}
+                  {metronomeData.cursorTips && (
+                    <>
                       <i class={styles.arrowIcon}></i>
-                      <div class={[styles['botton-tips'],metronomeData.cursorMode === 3 ? styles.tipSpec : '']}>{metronomeData.cursorTips}</div>
-                  </>}
+                      <div class={[styles["botton-tips"], metronomeData.cursorMode === 3 ? styles.tipSpec : ""]}>{metronomeData.cursorTips}</div>
+                    </>
+                  )}
                 </span>
-              </div> : null         
-            }  
+              </div>
+            ) : null}
 
             {state.musicRendered && !query.lessonTrainingId && !query.questionId && state.isConcert && (
-              <div class={[styles.btn, (state.playState === "play" && fingeringBtn.value.disabled) && styles.disabled]} 
+              <div
+                class={[styles.btn, state.playState === "play" && fingeringBtn.value.disabled && styles.disabled]}
                 onClick={() => {
-                  toggleMusicSheet.toggle(true)
-                }}>
+                  toggleMusicSheet.toggle(true);
+                }}
+              >
                 <img class={styles.iconBtn} src={headImg(`shenggui.svg`)} />
                 <span>声轨</span>
               </div>
@@ -469,20 +479,19 @@ export default defineComponent({
               <img style={{ display: state.playSource === "music" ? "none" : "" }} class={styles.iconBtn} src={headImg(`background.svg`)} />
               <span>{state.playSource === "music" ? "原声" : "伴奏"}</span>
             </div>
-            {
-              state.modeType !== "evaluating" && 
-                <div
-                  class={[styles.btn]}
-                  onClick={async () => {
-                    metronomeData.disable = !metronomeData.disable;
-                    metronomeData.metro?.initPlayer();
-                  }}
-                >
-                  <img style={{ display: metronomeData.disable ? "block" : "none" }} class={styles.iconBtn} src={headImg("tickoff.svg")} />
-                  <img style={{ display: !metronomeData.disable ? "block" : "none" }} class={styles.iconBtn} src={headImg("tickon.svg")} />
-                  <span style={{ whiteSpace: "nowrap" }}>节拍器</span>
-                </div>               
-            }
+            {state.modeType !== "evaluating" && (
+              <div
+                class={[styles.btn]}
+                onClick={async () => {
+                  metronomeData.disable = !metronomeData.disable;
+                  metronomeData.metro?.initPlayer();
+                }}
+              >
+                <img style={{ display: metronomeData.disable ? "block" : "none" }} class={styles.iconBtn} src={headImg("tickoff.svg")} />
+                <img style={{ display: !metronomeData.disable ? "block" : "none" }} class={styles.iconBtn} src={headImg("tickon.svg")} />
+                <span style={{ whiteSpace: "nowrap" }}>节拍器</span>
+              </div>
+            )}
             <div id={state.platform === IPlatform.PC ? "teacherTop-2" : "studnetT-2"} style={{ display: selectBtn.value.display ? "" : "none" }} class={[styles.btn, selectBtn.value.disabled && styles.disabled]} onClick={() => handleChangeSection()}>
               <img style={{ display: state.section.length === 0 ? "" : "none" }} class={styles.iconBtn} src={headImg(`section0.svg`)} />
               <img style={{ display: state.section.length === 1 ? "" : "none" }} class={styles.iconBtn} src={headImg(`section1.svg`)} />
@@ -502,7 +511,7 @@ export default defineComponent({
               <span>指法</span>
             </div>
 
-            <Popover trigger="manual" v-model:show={headData.speedShow} placement={state.platform === IPlatform.PC ? "top" : "bottom"} overlay={false} offset={state.platform === IPlatform.PC ? [8,40] : [0,8]}>
+            <Popover trigger="manual" v-model:show={headData.speedShow} placement={state.platform === IPlatform.PC ? "top" : "bottom"} overlay={false} offset={state.platform === IPlatform.PC ? [8, 40] : [0, 8]}>
               {{
                 reference: () => (
                   <div
@@ -523,9 +532,8 @@ export default defineComponent({
                 default: () => <Speed />,
               }}
             </Popover>
-            {
-              state.enableNotation ? 
-              <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]}>
+            {state.enableNotation ? (
+              <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]}>
                 {{
                   reference: () => (
                     <div
@@ -543,8 +551,8 @@ export default defineComponent({
                   ),
                   default: () => <MusicType />,
                 }}
-              </Popover> : null            
-            }
+              </Popover>
+            ) : null}
             <div id={state.platform === IPlatform.PC ? "teacherTop-6" : "studnetT-6"} style={{ display: settingBtn.value.display ? "" : "none" }} class={[styles.btn, styles.setBtn, settingBtn.value.disabled && styles.disabled]} onClick={() => (headTopData.settingMode = true)}>
               <img class={styles.iconBtn} src={headImg("icon_menu.svg")} />
               <span>设置</span>
@@ -556,7 +564,13 @@ export default defineComponent({
         <div
           id="studnetT-7"
           style={{ display: playBtn.value.display ? "" : "none" }}
-          class={[styles.btn, styles.playBtn, playBtn.value.disabled && styles.disabled, state.platform === IPlatform.PC && state.musicScoreBtnDirection === 'left' ? styles.playLeftButton : state.platform === IPlatform.PC && state.musicScoreBtnDirection === 'right' ? styles.playRightButton : '', state.platform === IPlatform.PC && !state.attendHideMenu && styles.playButtonHide]}
+          class={[
+            styles.btn,
+            styles.playBtn,
+            playBtn.value.disabled && styles.disabled,
+            state.platform === IPlatform.PC && state.musicScoreBtnDirection === "left" ? styles.playLeftButton : state.platform === IPlatform.PC && state.musicScoreBtnDirection === "right" ? styles.playRightButton : "",
+            state.platform === IPlatform.PC && !state.attendHideMenu && styles.playButtonHide,
+          ]}
           onClick={() => togglePlay()}
         >
           <div class={styles.btnWrap}>
@@ -570,8 +584,13 @@ export default defineComponent({
         <div
           id="tips-step-9"
           style={{ display: resetBtn.value.display ? "" : "none" }}
-          class={[styles.btn, 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 : '', state.platform === IPlatform.PC && !state.attendHideMenu && styles.playButtonHide]}
+          class={[
+            styles.btn,
+            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 : "",
+            state.platform === IPlatform.PC && !state.attendHideMenu && styles.playButtonHide,
+          ]}
           onClick={() => handleResetPlay()}
         >
           <img class={styles.iconBtn} src={headImg(state.platform === IPlatform.PC ? "pc_icon_resetbtn.png" : "icon_resetbtn.svg")} />
@@ -579,14 +598,23 @@ export default defineComponent({
 
         <Popup v-model:show={headTopData.settingMode} class="popup-custom van-scale center-closeBtn settingBoxClass_drag" transition="van-scale" teleport="body" closeable style={positionInfo.styleDrag.value}>
           <Settting />
-          { state.platform === IPlatform.PC && <Dragbom showGuide={!state.guideInfo?.teacherDrag} onGuideDone={handleGuide}  /> }
+          {state.platform === IPlatform.PC && <Dragbom showGuide={!state.guideInfo?.teacherDrag} onGuideDone={handleGuide} />}
         </Popup>
 
         {/* 模式切换 */}
         <ModeTypeMode />
+
+        {/* // 从课堂乐器学生端课件预览默认不显示会员
+        if (storeData.user.vipMember || state.paymentType === "FREE" || query.showCourseMember === "true") {
+          // 学生端
+          data.showStudent = true;
+        } else {
+          // vip
+          data.showVip = true;
+        } */}
         {/* isAllBtns */}
-        {isAllBtns.value && !query.isCbs && <TeacherTop></TeacherTop>}
-        {isAllBtnsStudent.value && !query.isCbs && <StudentTop></StudentTop>}
+        {isAllBtns.value && !query.isCbs && showGuideIndex.value && <TeacherTop></TeacherTop>}
+        {isAllBtnsStudent.value && !query.isCbs && showGuideIndex.value && <StudentTop></StudentTop>}
       </>
     );
   },

+ 62 - 59
src/state.ts

@@ -48,7 +48,7 @@ export type ISonges = {
 /**
  * 特殊教材分类id
  */
-const classids = [1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,30,31,35,36,38,108,150,151,152,153,154,155,156,157,158,178,179,180,181,182]; // 大雅金唐, 竖笛教程, 声部训练展开的分类ID
+const classids = [1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 30, 31, 35, 36, 38, 108, 150, 151, 152, 153, 154, 155, 156, 157, 158, 178, 179, 180, 181, 182]; // 大雅金唐, 竖笛教程, 声部训练展开的分类ID
 
 // 乐器code码
 export const musicalInstrumentCodeInfo = [
@@ -298,7 +298,7 @@ const state = reactive({
   /** 分类ID */
   musicSheetCategoriesId: 0,
   /** 各产品端的分类ID,(管乐迷、管乐团、酷乐秀、课堂乐器) */
-  bizMusicCategoryId: 0,  
+  bizMusicCategoryId: 0,
   /** 资源类型: mp3 | midi */
   playMode: "MP3" as "MP3" | "MIDI",
   /** 设置的速度 */
@@ -413,7 +413,7 @@ const state = reactive({
   /** 用户选择的结束小节数 */
   userChooseEndIndex: 0,
   /** 重播小节集合信息 */
-  repeatInfo: [] as any,  
+  repeatInfo: [] as any,
   /** 多分轨的曲子,可支持筛选的分轨 */
   canSelectTracks: [] as any,
   /** 声部codeId */
@@ -432,10 +432,10 @@ const state = reactive({
   isPreView: false,
   /** 是否为评测报告模式 */
   isEvaluatReport: false,
-  /** midi播放器是否初始化中 */  
+  /** midi播放器是否初始化中 */
   midiPlayIniting: false,
   /** 曲目信息 */
-  songs: {} as ISonges,  
+  songs: {} as ISonges,
   isAppPlay: false, // 是否midi音频,midi是app播放
   /** 音频播放器实例 */
   audiosInstance: null as any,
@@ -471,6 +471,8 @@ const state = reactive({
   guideInfo: null as any,
   noteCoords: [] as any,
   specialPosInit: false,
+  /** 资源类型 */
+  paymentType: null,
   /** 播放模式,默认练习模式 */
   defaultModeType: 1,
 });
@@ -592,10 +594,10 @@ const handlePlaying = () => {
       }
 
       // if (Math.abs(selectEndItem.endtime - currentTime) < offset_duration) {
-        // if (currentTime - selectEndItem.endtime > offset_duration) {
-          //console.log(currentTime,selectEndItem.endtime)
-        if (currentTime - selectEndItem.endtime >= 0) {
-        console.log("选段播放结束",state.setting.repeatAutoPlay);
+      // if (currentTime - selectEndItem.endtime > offset_duration) {
+      //console.log(currentTime,selectEndItem.endtime)
+      if (currentTime - selectEndItem.endtime >= 0) {
+        console.log("选段播放结束", state.setting.repeatAutoPlay);
         // 如果为选段评测模式
         if (state.modeType === "evaluating" && state.isSelectMeasureMode) {
           onEnded();
@@ -627,7 +629,7 @@ const handlePlaying = () => {
       uniformMoveSvgDom();
     }
   }
-  
+
 };
 /** 跳转到指定音符开始播放 */
 export const skipNotePlay = async (itemIndex: number, isStart = false) => {
@@ -664,7 +666,7 @@ export const togglePlay = async (playState?: "play" | "paused", sourceType?: str
   }
   // midi播放
   if (state.isAppPlay) {
-    if( playState === "paused" ) {
+    if (playState === "paused") {
       await api_cloudSuspend({
         songID: state.examSongId,
       })
@@ -728,7 +730,7 @@ export const resetPlaybackToStart = () => {
 export const gotoCustomNote = (index: number) => {
   try {
     state.osmd.cursor.reset();
-  } catch (error) {}
+  } catch (error) { }
   for (let i = 0; i < index; i++) {
     state.osmd.cursor.next();
   }
@@ -749,13 +751,13 @@ const computedDistance = (x: number, y: number) => {
       //min为元素中离目标元素最近元素的距离
       minDistance = c
       minidx = idx
-    }		
+    }
   })
   return minidx
 };
 
 const customNotePosition = (note: any, cursor: any) => {
-  const specialIds = ['1788850864767643649','1788502467554750466','1788501975122489346'];
+  const specialIds = ['1788850864767643649', '1788502467554750466', '1788501975122489346'];
   if (specialIds.includes(state.cbsExamSongId) && note.multipleRestMeasures === 0) {
     const pageLeft = document.getElementById('scrollContainer')?.getBoundingClientRect()?.x || 0;
     // 元素的位置
@@ -764,17 +766,17 @@ const customNotePosition = (note: any, cursor: any) => {
     if (element.x && element.y) {
       const noteIdx = computedDistance(element.x, element.y);
       const targetX = state.noteCoords[noteIdx]?.x - pageLeft;
-      console.log('音符索引',noteIdx)
+      console.log('音符索引', noteIdx)
       cursor.cursorElement.style.left = targetX + "px";
       cursor.cursorElement.style.transform = `translateX(0px)`;
     }
-    
+
   }
 }
 
 const setCursorPosition = (note: any, cursor: any, flag?: string) => {
   // console.log('音符',note?.i,state.osmd.Cursor.noteGraphicalId,note.svgElement?.attrs?.id)
-  
+
   if (state.musicRenderType === EnumMusicRenderType.firstTone || state.musicRenderType === EnumMusicRenderType.fixedTone) {
     /**
      * bug:#9920、#9940
@@ -784,31 +786,31 @@ const setCursorPosition = (note: any, cursor: any, flag?: string) => {
       return
 
     }
-    const specialIds = ['1788850864767643649','1788502467554750466','1788501975122489346'];
+    const specialIds = ['1788850864767643649', '1788502467554750466', '1788501975122489346'];
     if (specialIds.includes(state.cbsExamSongId) && note.multipleRestMeasures === 0) {
-        // console.log('音符idx',note?.i,cursor.cursorElement.style.left)
-        const cursorLeft = cursor?.cursorElement?.style?.left ? parseFloat(cursor.cursorElement.style.left) : 0;
-        let patchX = 0;
-        if (state.cbsExamSongId == '1788502467554750466') {
-          if (state.musicRenderType === EnumMusicRenderType.firstTone) {
-            patchX = (note.i == 0 || note.i == 60) ? 21 : (note.i == 1 || note.i == 7 || note.i == 23 || note.i == 38 || note.i == 44 || note.i == 52 || note.i == 58) ? -6 : (note.i >= 2 || note.i <= 6) || (note.i >= 8 || note.i <= 22) || (note.i >= 24 || note.i <= 37) || (note.i >= 39 || note.i <= 43) || (note.i >= 45 || note.i <= 51) || (note.i >= 53 || note.i <= 57) || (note.i == 59) ? 6 : 0;
-          }
-          if (state.musicRenderType === EnumMusicRenderType.fixedTone) {
-            patchX = note.i == 0 ? 31 : (note.i == 8 || note.i == 14 || note.i == 30 || note.i == 45 || note.i == 51 || note.i == 59 || note.i == 65) ? -10 : note.i == 67 ? 31 : 0;
-          }
-        } else if (state.cbsExamSongId == '1788501975122489346') {
-          if (state.musicRenderType === EnumMusicRenderType.firstTone) {
-            patchX = (note.i == 0) ? 21 : (note.i == 1 || note.i == 7 || note.i == 23 || note.i == 38 || note.i == 44 || note.i == 52 || note.i == 58) ? -6 : (note.i == 9 || note.i == 10 || note.i == 12 || note.i == 13) ? 3 : (note.i == 14 || note.i == 30 || note.i == 45 || note.i == 51 || note.i == 59) ? 6 : (note.i == 45) ? -8 : (note.i >= 15 || note.i <= 29) || (note.i >= 31 || note.i <= 36) || (note.i >= 38 || note.i <= 44) || (note.i >= 46 || note.i <= 50) || (note.i >= 52 || note.i <= 58) || (note.i >= 60 || note.i <= 64) || (note.i == 66) ? 4 : 0;
-          }
-          if (state.musicRenderType === EnumMusicRenderType.fixedTone) {
-            patchX = note.i == 0 ? 31 : (note.i == 8 || note.i == 14 || note.i == 30 || note.i == 45 || note.i == 51 || note.i == 59 || note.i == 65) ? -10 : note.i == 67 ? 31 : 0;
-          }
+      // console.log('音符idx',note?.i,cursor.cursorElement.style.left)
+      const cursorLeft = cursor?.cursorElement?.style?.left ? parseFloat(cursor.cursorElement.style.left) : 0;
+      let patchX = 0;
+      if (state.cbsExamSongId == '1788502467554750466') {
+        if (state.musicRenderType === EnumMusicRenderType.firstTone) {
+          patchX = (note.i == 0 || note.i == 60) ? 21 : (note.i == 1 || note.i == 7 || note.i == 23 || note.i == 38 || note.i == 44 || note.i == 52 || note.i == 58) ? -6 : (note.i >= 2 || note.i <= 6) || (note.i >= 8 || note.i <= 22) || (note.i >= 24 || note.i <= 37) || (note.i >= 39 || note.i <= 43) || (note.i >= 45 || note.i <= 51) || (note.i >= 53 || note.i <= 57) || (note.i == 59) ? 6 : 0;
+        }
+        if (state.musicRenderType === EnumMusicRenderType.fixedTone) {
+          patchX = note.i == 0 ? 31 : (note.i == 8 || note.i == 14 || note.i == 30 || note.i == 45 || note.i == 51 || note.i == 59 || note.i == 65) ? -10 : note.i == 67 ? 31 : 0;
         }
-        if (flag === 'refresh' || (flag === 'init' && !state.specialPosInit)) {
-          // console.log('音符idx',note?.i,cursor.cursorElement.style.left)
-          cursor.cursorElement.style.left = cursorLeft + patchX + "px";
-          state.specialPosInit = true;
+      } else if (state.cbsExamSongId == '1788501975122489346') {
+        if (state.musicRenderType === EnumMusicRenderType.firstTone) {
+          patchX = (note.i == 0) ? 21 : (note.i == 1 || note.i == 7 || note.i == 23 || note.i == 38 || note.i == 44 || note.i == 52 || note.i == 58) ? -6 : (note.i == 9 || note.i == 10 || note.i == 12 || note.i == 13) ? 3 : (note.i == 14 || note.i == 30 || note.i == 45 || note.i == 51 || note.i == 59) ? 6 : (note.i == 45) ? -8 : (note.i >= 15 || note.i <= 29) || (note.i >= 31 || note.i <= 36) || (note.i >= 38 || note.i <= 44) || (note.i >= 46 || note.i <= 50) || (note.i >= 52 || note.i <= 58) || (note.i >= 60 || note.i <= 64) || (note.i == 66) ? 4 : 0;
         }
+        if (state.musicRenderType === EnumMusicRenderType.fixedTone) {
+          patchX = note.i == 0 ? 31 : (note.i == 8 || note.i == 14 || note.i == 30 || note.i == 45 || note.i == 51 || note.i == 59 || note.i == 65) ? -10 : note.i == 67 ? 31 : 0;
+        }
+      }
+      if (flag === 'refresh' || (flag === 'init' && !state.specialPosInit)) {
+        // console.log('音符idx',note?.i,cursor.cursorElement.style.left)
+        cursor.cursorElement.style.left = cursorLeft + patchX + "px";
+        state.specialPosInit = true;
+      }
     } else {
       nextTick(() => {
         let bbox = note.bbox;
@@ -872,7 +874,7 @@ export const gotoNext = (note: any, skipNote?: boolean) => {
     //   osmd.cursor.next();
     // }
     osmd.cursor.next();
-    
+
   } else if (prev && num - prev > 0) {
     while (num - prev > 0) {
       prev++;
@@ -995,7 +997,7 @@ export const handleSelection = (item: any) => {
   if (state.section.length !== 2 && item) {
     state.section.push(item);
     if (state.section.length === 2) {
-      setSection(state.section[0].MeasureNumberXML,state.section[1].MeasureNumberXML)
+      setSection(state.section[0].MeasureNumberXML, state.section[1].MeasureNumberXML)
       //state.section = formateSelectMearure(state.section);
       closeToast();
     }
@@ -1023,7 +1025,7 @@ export const setSection = (start: number, end: number, userSpeed?: number) => {
   let lastEndNotes = endNotes.filter((n: any) => n.noteId === lastEndId)
   // 是否符合重播规则
   const canRepeatInfo = verifyCanRepeat(start, end)
-  console.log('能否重播',canRepeatInfo)
+  console.log('能否重播', canRepeatInfo)
   const isCanRepeat = canRepeatInfo.canRepeat
   // 如果符合重播规则,但是lastEndNotes长度为1,则需要向前找,直到找到lastEndNotes长度为2
   /**
@@ -1049,8 +1051,8 @@ export const setSection = (start: number, end: number, userSpeed?: number) => {
   const endIdx: any = (isCanRepeat && canRepeatInfo.repeatIdx == state.repeatInfo.length - 1) ? lastEndNotes.length - 1 : 0
   const startNote = startNotes[0]
   // const endNote = endNotes[endNotes.length - 1]
-  const endNote = lastEndNotes[endIdx]			
-  
+  const endNote = lastEndNotes[endIdx]
+
   if (startNote && endNote) {
     state.isSelectMeasureMode = true;
     // 设置小节
@@ -1061,7 +1063,7 @@ export const setSection = (start: number, end: number, userSpeed?: number) => {
       handleSetSpeed(userSpeed);
     }
   }
-}	
+}
 
 
 /** 直接设置选段 */
@@ -1070,7 +1072,7 @@ export const hanldeDirectSelection = (list: any[]) => {
   state.sectionStatus = true;
   setTimeout(() => {
     state.section = formateSelectMearure(list);
-    console.log('选段小节',state.section)
+    console.log('选段小节', state.section)
   }, 500);
 };
 let offsetTop = 0;
@@ -1161,6 +1163,7 @@ const setState = (data: any, index: number) => {
   state.appName = "COLEXIU";
   state.detailId = data.bizId;
   state.xmlUrl = data.xmlFileUrl;
+  state.paymentType = data.paymentType
   state.partIndex = index;
   state.trackId = data.track;
   state.subjectId = data.subjectIds ? data.subjectIds.split(',')?.[0] : 0;
@@ -1248,11 +1251,11 @@ const setState = (data: any, index: number) => {
   console.log("🚀 ~ state.fingeringInfo:", code, state.fingeringInfo, state.trackId, state.track);
   state.musicalCodeId = state.fingeringInfo?.id || 0
   state.musicalCode = musicalInstrumentCodeInfo.find(item => item.id === state.musicalCodeId)?.code || state.trackId
-  ;(window as any).DYSubjectId = state.musicalCodeId
-  // 开启自定义每行显示的小节数
-  ;(window as any).customSectionAmount = true
-  // 标识是课堂乐器,用于移调时进行区分处理
-  ;(window as any).DYProjectName = 'musicScore';
+    ; (window as any).DYSubjectId = state.musicalCodeId
+    // 开启自定义每行显示的小节数
+    ; (window as any).customSectionAmount = true
+    // 标识是课堂乐器,用于移调时进行区分处理
+    ; (window as any).DYProjectName = 'musicScore';
   // 如果切换的声轨没有指法,择指法开关置灰并且不可点击
   if (!state.fingeringInfo.name && state.setting.displayFingering) {
     state.setting.displayFingering = false
@@ -1290,7 +1293,7 @@ const setState = (data: any, index: number) => {
   /**
    * TODO:摇篮曲特殊处理
    */
-  if (['1788501975122489346','1788502467554750466','1789839575249596417'].includes(state.cbsExamSongId)) {
+  if (['1788501975122489346', '1788502467554750466', '1789839575249596417'].includes(state.cbsExamSongId)) {
     if (state.musicRenderType === 'fixedTone') {
       state.musicRenderType = EnumMusicRenderType.firstTone;
     }
@@ -1324,7 +1327,7 @@ export const followBeatPaly = () => {
     metroTimer = null
     return;
   }
-  const time = state.measureTime*1000 / metronomeData.totalNumerator
+  const time = state.measureTime * 1000 / metronomeData.totalNumerator
   requestAnimationFrame(() => {
     const endTime = Date.now();
     if (endTime - state.beatStartTime < time) {
@@ -1409,7 +1412,7 @@ export const createFixedCursor = () => {
   state.cursorDom = cursorDom;
   let copyCursor: any = cursorDom?.cloneNode(true);
   if (copyCursor) {
-    copyCursor.setAttribute('id','cursor-copy');
+    copyCursor.setAttribute('id', 'cursor-copy');
     copyCursor.style.position = 'sticky';
     copyCursor.style.zIndex = '2';
     // if (!state.times[0]?.id) {
@@ -1482,13 +1485,13 @@ export const moveSvgDom = (skipNote?: boolean) => {
 /** 平滑移动svgdom */
 export const smoothMoveSvgDom = () => {
   const currentTime = getAudioCurrentTime();
-  const matchNoteIdx = state.times.findIndex((item: any) => Math.abs(item.time - currentTime) * 1000 < 100 )
+  const matchNoteIdx = state.times.findIndex((item: any) => Math.abs(item.time - currentTime) * 1000 < 100)
   // if (matchNoteIdx >= 0) {
   //   console.log('匹配',matchNoteIdx,currentTime)
   // }
-  
+
   if (currentTime <= state.fixtime) return;
-  if (currentTime > state.times.last()?.time) return; 
+  if (currentTime > state.times.last()?.time) return;
   // console.log('跳转音符',currentTime)
   const currentBBox = state.times[state.activeNoteIndex]?.bbox;
   let nextIndex = state.activeNoteIndex + 1;
@@ -1509,7 +1512,7 @@ export const smoothMoveSvgDom = () => {
     //   noteDistance = noteDistance - state.times[state.activeNoteIndex]?.bbox?.svgBodyLeft;
     // }
     const distance = noteDistance * playProgress;
-    
+
     // 上一个音符和第一个音符的间距
     let preDistance = state.times[state.activeNoteIndex].bbox?.x - state.times[0].bbox?.x + state.times[state.activeNoteIndex].bbox?.width / 4;
 
@@ -1528,7 +1531,7 @@ export const smoothMoveSvgDom = () => {
 export const uniformMoveSvgDom = () => {
   const currentTime = getAudioCurrentTime();
   if (currentTime <= state.fixtime) return;
-  if (currentTime > state.times.last()?.time) return; 
+  if (currentTime > state.times.last()?.time) return;
   const playProgress = (currentTime - state.fixtime) / state.times.last()?.time;
   const distance = playProgress * state.noteDistance || 0;
   state.osdmScrollDom.scrollLeft = distance;

+ 4 - 0
src/style.css

@@ -180,4 +180,8 @@ body{
   100%{
       opacity: 1;
   }
+}
+
+html {
+  font-size: 64PX;
 }

File diff suppressed because it is too large
+ 0 - 0
stats.html


Some files were not shown because too many files changed in this diff