瀏覽代碼

Merge branch 'feature-tianyong-newVersion' of http://git.dayaedu.com/liushengqiang/music-score into hqyDevNewVersion

黄琪勇 11 月之前
父節點
當前提交
a2b76657e8

+ 27 - 2
src/page-instrument/header-top/settting/index.tsx

@@ -1,9 +1,9 @@
-import { defineComponent, reactive, computed } from "vue";
+import { defineComponent, reactive, computed, toRef } from "vue";
 import styles from "./index.module.less"
 import { headImg } from "../image";
 import { headTopData } from "../index"
 import { Switch, showToast, Field, Popup, Slider } from "vant";
-import state, { refreshMusicSvg } from "/src/state"
+import state, { refreshMusicSvg, IPlatform } from "/src/state"
 import { api_closeCamera, api_openCamera, api_savePicture } from "/src/helpers/communication";
 import { smoothAnimationState} from "/src/page-instrument/view-detail/smoothAnimation"
 import Recommendation from "../../custom-plugins/helper-model/recommendation";
@@ -12,6 +12,10 @@ import ScreenModel from "../../custom-plugins/helper-model/screen-model";
 import { getQuery } from "/src/utils/queryString";
 import { reCheckDelay } from "/src/page-instrument/evaluat-model"
 import { audioData, changeMingSongType } from "/src/view/audio-list"
+import useDrag from "/src/view/plugins/useDrag/index";
+import Dragbom from "/src/view/plugins/useDrag/dragbom";
+import { storeData } from "/src/store";
+import { getGuidance, setGuidance } from "../../custom-plugins/guide-page/api";
 
 export default defineComponent({
 	name: "settting",
@@ -21,6 +25,25 @@ export default defineComponent({
 			screenModelShow: false, // 投屏帮助
 			recommendationShow: false, // 建议
 		});
+		const parentClassName = "recommenBoxClass_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(helperData, "recommendationShow"), userId);
+
+		// 完成拖动弹窗引导页
+		const handleGuide = async () => {
+			state.guideInfo.teacherDrag = true;
+			try {
+			const res = await setGuidance({ guideTag: "guideInfo", guideValue: JSON.stringify(state.guideInfo) });
+			} catch (e) {
+			console.log(e);
+			}
+		};
+
         // 加减评测频率
 		const operateHz = (type: number) => {
 			const minFrequency = state.baseFrequency - 10, maxFrequency = state.baseFrequency + 10
@@ -236,12 +259,14 @@ export default defineComponent({
 					transition="van-scale"
 					teleport="body"
                     overlay-style={{background:'rgba(0, 0, 0, 0.3)'}}
+                    style={positionInfo.styleDrag.value}
 				>
                     <Recommendation
                         onClose={() => {
                             helperData.recommendationShow = false;
                         }}
                     />
+                    {state.platform === IPlatform.PC && <Dragbom showGuide={!state.guideInfo?.teacherDrag} onGuideDone={handleGuide} />}
 				</Popup>
                 <Popup
 					class={["popup-custom"]}

+ 19 - 8
src/page-instrument/view-detail/index.tsx

@@ -298,15 +298,19 @@ export default defineComponent({
         if (state.fingeringInfo.direction === "transverse") {
           return {
             container: {
-              paddingBottom: headerColumnHide.value ? state.fingeringInfo.height : state.fingeringInfo.scaleData?.offset
+              //paddingBottom: headerColumnHide.value ? state.fingeringInfo.height : state.fingeringInfo.scaleData?.offset
+              paddingBottom: state.fingeringInfo.height
             },
             // 横向指法,跟练&评测模式,默认展示贴底展示
-            fingerBox: headerColumnHide.value ? {
-                height: state.fingeringInfo.height
-              } : {
-                height: state.fingeringInfo.height,
-                transform: `scale(${state.fingeringInfo.scaleData?.scale})`
-              }
+            // fingerBox: headerColumnHide.value ? {
+            //     height: state.fingeringInfo.height
+            //   } : {
+            //     height: state.fingeringInfo.height,
+            //     transform: `scale(${state.fingeringInfo.scaleData?.scale})`
+            //   }
+            fingerBox: {
+              height: state.fingeringInfo.height
+            }
           };
         } else {
           console.log('指法',state.playBtnDirection,state.platform)
@@ -397,6 +401,13 @@ export default defineComponent({
         headerColumnHide.value = followData.start;
       }
     );
+    // 监听开始评测状态
+    watch(
+      () => evaluatingData.startBegin,
+      () => {
+        headerColumnHide.value = evaluatingData.startBegin;
+      }
+    );    
     /** 指法预览切换 */
     watch(
       () => detailData.fingerPreView,
@@ -501,7 +512,7 @@ export default defineComponent({
             //   headerColumnHide.value = !headerColumnHide.value;
             // }
             // 点击谱面跟练也需要切换显示按钮栏
-            if (state.playState === "play" || followData.start) {
+            if (state.playState === "play" || followData.start || evaluatingData.startBegin) {
               headerColumnHide.value = !headerColumnHide.value;
             }
           }}

+ 1 - 0
src/view/plugins/useDrag/dragbom.tsx

@@ -33,6 +33,7 @@ export default defineComponent({
       }
     }
     onMounted(() => {
+      console.log('拖动11')
       nextTick(() => {
         setTimeout(() => {
           initGuidePos();