Parcourir la source

fix: 跟练模式bug修复

TIANYONG il y a 7 mois
Parent
commit
7ddce7072e

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

@@ -84,4 +84,12 @@
           margin-left: 20px;
       }
   }
+}
+.beginMask{
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100vw;
+  height: 100vh;
+  z-index: 10000;
 }

+ 4 - 0
src/page-instrument/follow-model/index.tsx

@@ -37,6 +37,10 @@ export default defineComponent({
 						</div>
 					)}
 				</Transition> */}
+        {/* 遮罩 */}
+        {
+          followData.isBeginMask && <div class={styles.beginMask}></div>
+        }        
         <div class={styles.operatingBtn}>
           {!followData.start && (
             <img

+ 4 - 1
src/view/follow-practice/index.tsx

@@ -21,6 +21,7 @@ export const followData = reactive({
 	rendered: false,
 	/** 麦克风权限 */
 	earphone: false,
+	isBeginMask: false // 倒计时和系统节拍器时候的遮罩,防止用户点击
 });
 
 // 记录跟练时长
@@ -97,6 +98,7 @@ const onClear = () => {
 
 /** 开始跟练 */
 export const handleFollowStart = async () => {
+	followData.isBeginMask = true
 	checking = false;
 	const res = await api_cloudToggleFollow("start");
 	// 用户没有授权,需要重置状态
@@ -104,15 +106,16 @@ export const handleFollowStart = async () => {
 		// 
 	} else {
 		// 跟练模式开始前,增加播放系统节拍器
-		followData.start = true;
 		const tickend = await handleStartTick();
 		// console.log("🚀 ~ tickend:", tickend)
 		// 节拍器返回false, 取消播放
 		if (!tickend) {
+			followData.isBeginMask = false
 			followData.start = false;
 			return false;
 		}
 		onClear();
+		followData.isBeginMask = false
 		followData.start = true;
 		followData.index = 0;
 		followData.list = [];

+ 2 - 2
vite.config.ts

@@ -76,8 +76,8 @@ export default defineConfig({
         // target: "https://kt.colexiu.com",
         // target: "https://test.lexiaoya.cn",
         // target: "https://kt.colexiu.com",
-        target: "https://dev.resource.colexiu.com", // 内容平台开发环境,内容平台开发,需在url链接上加上isCbs=true
-        // target: "https://dev.kt.colexiu.com",
+        // target: "https://dev.resource.colexiu.com", // 内容平台开发环境,内容平台开发,需在url链接上加上isCbs=true
+        target: "https://dev.kt.colexiu.com",
         //target: "https://mec.colexiu.com",
         changeOrigin: true,
         rewrite: (path) => path.replace(/^\/instrument/, ""),