Bläddra i källkod

Merge branch 'feature-tianyong-newVersion' into ktyq-test-new

TIANYONG 11 månader sedan
förälder
incheckning
a556580145

+ 3 - 3
instrument.html

@@ -43,14 +43,14 @@
 
 <body>
   <div id="app"></div>
-  <img id="loading" class="show" src="/loading.svg" alt="loading" />
-  <script>
+  <!-- <img id="loading" class="show" src="/loading.svg" alt="loading" /> -->
+  <!-- <script>
     // 处理课堂乐器老师端打开听音练习时去掉加载动画
     if (location.href.indexOf('view-figner') >= 0 && location.href.indexOf('platform=pc') >= 0 && location.href.indexOf('linkSource=class') < 0 && !location.href.includes("simple-detail")) {
       var _loading = document.getElementById("loading");
       _loading && document.body.removeChild(_loading);
     }
-  </script>
+  </script> -->
 
   <script type="module" src="/src/page-instrument/main.ts"></script>
   <!-- <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>

+ 1 - 3
src/page-instrument/custom-plugins/helper-model/recommendation/index.module.less

@@ -172,14 +172,12 @@
                         font-weight: 500;
                         font-size: 14px;
                         color: #131415;
+                        caret-color: #1cacf1;
                         &::placeholder {
                             font-weight: 400;
                             font-size: 14px;
                             color: #AAAAAA;
                         }
-                        &::-webkit-scrollbar {
-                            display: none;
-                        }
                     }
                 }
             }

+ 8 - 0
src/page-instrument/evaluat-model/earphone/index.module.less

@@ -2,6 +2,14 @@
     position: relative;
     width: 600px;
     height: 229px;
+    &.ipadEarphoneBox{
+        width: 540px;
+        height: 206px;
+        .earphoneBtn{
+            width: 120px;
+            height: 35px;
+        }
+    }
     .earphoneBg {
         position: absolute;
         left: 50%;

+ 5 - 1
src/page-instrument/evaluat-model/earphone/index.tsx

@@ -4,6 +4,7 @@ import noEarphone from "../icons/no_erji.png";
 import youxianEarphone from "../icons/youxian_erji.png";
 import lanyaEarphone from "../icons/lanya_erji.png";
 import earphoneBtn from "../icons/confirm.png"
+import { browser } from "/src/utils";
 
 export default defineComponent({
 	name: "earphone",
@@ -15,8 +16,11 @@ export default defineComponent({
 		},
 	},	
 	setup(props, { emit }) {
+		// 资源类型
+		const browserInfo = browser();
+		const isPad =  navigator?.userAgent?.includes("UAWEIVRD-W09") || browserInfo?.iPad || browserInfo.isTablet;
 		return () => (
-			<div class={styles.earphoneBox}>
+			<div class={[styles.earphoneBox, isPad && styles.ipadEarphoneBox]}>
 				<img class={styles.earphoneBg} src={props.earphoneType === "有线耳机" ? youxianEarphone : props.earphoneType === "蓝牙耳机" ? lanyaEarphone : noEarphone} />
 				<img class={styles.earphoneBtn} src={earphoneBtn} onClick={() => emit("close")} />
 			</div>

+ 5 - 0
src/page-instrument/evaluat-model/evaluat-result/index.module.less

@@ -134,6 +134,9 @@
                 &>span {
                     margin: -2px 4px 0;
                 }
+                &.huaWeiLevel{
+                    padding-top: 3px;
+                }
             }
         }
 
@@ -142,6 +145,7 @@
             margin-bottom: -2px;
             font-size: 38px;
             font-family: DIN-Bold, DIN;
+            margin-bottom: -4px;
         }
 
         .rightBadge {
@@ -314,6 +318,7 @@
         }
         .scoresNum{
             font-family: DIN-Bold, DIN;
+            margin-bottom: -2px;
         }
     }
 

+ 2 - 1
src/page-instrument/evaluat-model/evaluat-result/index.tsx

@@ -93,6 +93,7 @@ export default defineComponent({
       return tipContent
     })
 
+    const isHuaWeiPad = navigator?.userAgent?.includes("UAWEIVRD-W09") ? true : false
     onMounted(() => {
       if (!evaluatingData.isErrorState) {
         handleAddRecord();
@@ -128,7 +129,7 @@ export default defineComponent({
                   <div class={[styles.scoreSection, "evaluting-result-1"]}>
                     <div class={styles.num}>{evaluatingData.resultData.score}</div>
                     <div class={styles.score}>分</div>
-                    <div class={styles.level}>
+                    <div class={[styles.level, isHuaWeiPad && styles.huaWeiLevel]}>
                       <div>{level[evaluatingData.resultData.heardLevel]}</div>
                       <span>|</span>
                       <div>速度{evaluatingData.resultData.speed || state.speed}</div>

+ 8 - 0
src/page-instrument/evaluat-model/index.module.less

@@ -133,6 +133,14 @@
     position: relative;
     width: 600px;
     height: 229px;
+    &.ipadEarphoneBox{
+        width: 540px;
+        height: 206px;
+        .earphoneBtn{
+            width: 120px;
+            height: 35px;
+        }
+    }
     .earphoneBg {
         position: absolute;
         left: 50%;

+ 3 - 2
src/page-instrument/evaluat-model/index.tsx

@@ -532,7 +532,8 @@ export default defineComponent({
 			clearTimeout(checkErjiTimer);
       checkErjiTimer = null;
 		});
-
+    // 资源类型
+    const isPad =  navigator?.userAgent?.includes("UAWEIVRD-W09") || browserInfo?.iPad || browserInfo.isTablet;
     return () => (
       <div>
         <div class={styles.operatingBtn}>
@@ -586,7 +587,7 @@ export default defineComponent({
           evaluatingData.isBeginMask && <div class={styles.beginMask}></div>
         }
         <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={tipErjiPopShow.value}>
-          <div class={styles.earphoneBox}>
+          <div class={[styles.earphoneBox, isPad && styles.ipadEarphoneBox]}>
             <img class={styles.earphoneBg} src={tipErjiBg} />
             <img class={styles.earphoneBtn} src={tipErjiBtn} onClick={() => {
               evaluatingData.tipErjiShow = false;

+ 2 - 2
src/page-instrument/header-top/index.module.less

@@ -296,7 +296,7 @@
                 font-weight: 600;
                 font-size: 12px;
                 color: #673207;
-                line-height: 1;
+                line-height: 16px;
             }
         }
     }
@@ -395,7 +395,7 @@
     width: 100vw;
     height: 100vh;
     background: url(./image/bg.png) no-repeat;
-    background-size: 100% 100%;
+    background-size: cover;
     transition: all .3s;
 
     &.hidden {

+ 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"]}

BIN
src/page-instrument/view-detail/images/bg2_left_zs.png


+ 2 - 4
src/page-instrument/view-detail/index.module.less

@@ -286,16 +286,14 @@
 
 .bg2Left {
     width: 52px;
-    height: 125px;
     position: absolute;
-    left: -1px;
+    left: 0px;
     top: 0;
 }
 
 .bg2Right {
     width: 52px;
-    height: 125px;
     position: absolute;
-    right: -1px;
+    right: 0;
     top: 0;
 }

+ 6 - 16
src/page-instrument/view-detail/index.tsx

@@ -301,22 +301,12 @@ export default defineComponent({
               paddingBottom: headerColumnHide.value ? state.fingeringInfo.height : state.fingeringInfo.scaleData?.offset,
             },
             // 横向指法,跟练&评测模式,默认展示贴底展示
-            fingerBox:
-              state.modeType === "follow" || state.modeType === "evaluating"
-                ? {
-                    height: state.fingeringInfo.height,
-                    position: "absolute",
-                    bottom: 0,
-                    width: "100%",
-                  }
-                : 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})`
+              }
           };
         } else {
           console.log("指法", state.playBtnDirection, state.platform);

+ 7 - 0
src/page-instrument/view-detail/smoothAnimation/index.less

@@ -1,3 +1,10 @@
+
+// 有时候 singleLineMusicBox 还没有赋值所以导致 旋律线和小鸟显示,所以这里默认隐藏
+#musicAndSelection{
+    .smoothAnimationBox{
+        display: none;
+    }
+}
 #musicAndSelection.singleLineMusicBox{
     .smoothAnimationBox{
         display: flex;

+ 12 - 0
src/page-instrument/view-evaluat-report/component/share-top/index.module.less

@@ -334,6 +334,18 @@
     &.padPlayerBox{
         width: 418px;
         height: 248px;
+        .audioBox{
+            .audioBga1{
+                width: 112px;
+            }
+            .audioBga2{
+                width: 206px;
+            }
+            .audioVisualizer{
+                width: 288px;
+                height: 50px;
+            }
+        }
     }
     .videoBox {
         width: 100%;

+ 2 - 5
src/page-instrument/view-evaluat-report/component/share-top/index.tsx

@@ -82,10 +82,7 @@ export default defineComponent({
     });
 
     // 资源类型
-    const isPad = computed(() => {
-      return navigator?.userAgent?.includes("UAWEIVRD-W09") || browserInfo?.iPad || browserInfo?.isTablet;
-    });
-
+    const isPad =  navigator?.userAgent?.includes("UAWEIVRD-W09") || browserInfo?.iPad || browserInfo.isTablet;
 		const openAudioAndVideo = () => {
 			shareData.show = true;
 			if (shareData.isInitPlyr) return;
@@ -107,7 +104,7 @@ export default defineComponent({
 						shareData._plrl.on('pause', () => {
 							pauseVisualDraw()
 						});
-					}, 300); // 弹窗动画是0.25秒 这里用定时器 确保canvas 能获取到宽高
+					}, 500); // 弹窗动画是0.25秒 这里用定时器 确保canvas 能获取到宽高
 				}
 				shareData.isInitPlyr = true;
 			});

+ 2 - 4
src/page-instrument/view-evaluat-report/index.module.less

@@ -190,15 +190,13 @@
 
 .bg2Left {
   width: 52px;
-  height: 125px;
   position: absolute;
-  left: -1px;
+  left: 0;
   top: 0;
 }
 .bg2Right {
   width: 52px;
-  height: 125px;
   position: absolute;
-  right: -1px;
+  right: 0;
   top: 0;
 }

+ 1 - 1
src/style.css

@@ -197,6 +197,6 @@ html {
 }
 
 @font-face {
-  font-family: "DIN-1Bold";
+  font-family: "DIN-Bold";
   src: url("./assets/DIN_Alternate_Bold.ttf");
 }

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

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