liushengqiang 2 år sedan
förälder
incheckning
a88e21388a

+ 37 - 14
src/page-gym/evaluat-model/index.tsx

@@ -1,4 +1,3 @@
-import { Popup, Snackbar } from "@varlet/ui";
 import { defineComponent, onMounted, reactive, watch } from "vue";
 import {
 	connectWebsocket,
@@ -17,7 +16,7 @@ import state from "/src/state";
 import { storeData } from "/src/store";
 import { browser } from "/src/utils";
 import { getNoteByMeasuresSlursStart } from "/src/helpers/formateMusic";
-import { Icon, NoticeBar, showToast, Swipe, SwipeItem } from "vant";
+import { Icon, NoticeBar, Popup, showToast, Swipe, SwipeItem } from "vant";
 import iconStudent from "./icons/student.png";
 import EvaluatResult from "./evaluat-result";
 import EvaluatAudio from "./evaluat-audio";
@@ -165,7 +164,7 @@ export default defineComponent({
 				return;
 			} else if (type === "look") {
 				// 跳转
-				handleViewReport('recordId', 'gym');
+				handleViewReport("recordId", "gym");
 				return;
 			} else if (type === "practise") {
 				// 去练习
@@ -183,11 +182,11 @@ export default defineComponent({
 			}
 			let res = null;
 			if (state.setting.camera && state.setting.saveToAlbum) {
-				console.log(1)
+				console.log(1);
 				res = await api_videoUpdate();
-				console.log(2)
+				console.log(2);
 			}
-			console.log(3)
+			console.log(3);
 			api_proxyServiceMessage({
 				header: {
 					commond: "videoUpload",
@@ -200,9 +199,9 @@ export default defineComponent({
 				},
 			});
 			showToast({
-				position: 'top',
-				message: "上传成功"
-			})
+				position: "top",
+				message: "上传成功",
+			});
 			evaluatModel.evaluatUpdateAudio = false;
 		};
 
@@ -266,7 +265,13 @@ export default defineComponent({
 						<div style={{ height: "40px" }}></div>
 					</>
 				)}
-				<Popup teleport="body" closeOnClickOverlay={false} defaultStyle={false} v-model:show={evaluatingData.earphoneMode}>
+				<Popup
+					teleport="body"
+					closeOnClickOverlay={false}
+					v-model:show={evaluatingData.earphoneMode}
+					class={["popup-custom", "van-scale"]}
+					transition="van-scale"
+				>
 					<Earphone
 						onClose={() => {
 							evaluatingData.earphoneMode = false;
@@ -274,7 +279,13 @@ export default defineComponent({
 						}}
 					/>
 				</Popup>
-				<Popup teleport="body" closeOnClickOverlay={false} defaultStyle={false} v-model:show={evaluatingData.soundEffectMode}>
+				<Popup
+					teleport="body"
+					closeOnClickOverlay={false}
+					v-model:show={evaluatingData.soundEffectMode}
+					class={["popup-custom", "van-scale"]}
+					transition="van-scale"
+				>
 					<SoundEffect
 						onClose={(value: any) => {
 							evaluatingData.soundEffectMode = false;
@@ -287,13 +298,25 @@ export default defineComponent({
 					/>
 				</Popup>
 
-				<Popup teleport="body" closeOnClickOverlay={false} defaultStyle={false} v-model:show={evaluatingData.resulstMode}>
+				<Popup
+					teleport="body"
+					closeOnClickOverlay={false}
+					v-model:show={evaluatingData.resulstMode}
+					class={["popup-custom", "van-scale"]}
+					transition="van-scale"
+				>
 					<EvaluatResult onClose={handleEvaluatResult} />
 				</Popup>
-				<Popup teleport="body" closeOnClickOverlay={false} defaultStyle={false} v-model:show={evaluatModel.evaluatUpdateAudio}>
+				<Popup
+					teleport="body"
+					closeOnClickOverlay={false}
+					v-model:show={evaluatModel.evaluatUpdateAudio}
+					class={["popup-custom", "van-scale"]}
+					transition="van-scale"
+				>
 					<EvaluatAudio onClose={hanldeUpdateVideoAndAudio} />
 				</Popup>
-				<Popup teleport="body" closeOnClickOverlay={false} defaultStyle={false} v-model:show={evaluatModel.shareMode}>
+				<Popup teleport="body" closeOnClickOverlay={false} v-model:show={evaluatModel.shareMode} class={["popup-custom", "van-scale"]} transition="van-scale">
 					<EvaluatShare onClose={() => (evaluatModel.shareMode = false)} />
 				</Popup>
 			</div>

+ 15 - 5
src/page-gym/header-top/settting/index.module.less

@@ -34,23 +34,31 @@
     max-height: 310px;
     --van-tabs-line-height: 50px;
     --van-tab-active-text-color: var(--van-primary-color);
-    :global{
-        .van-tab__panel{
+
+    :global {
+        .van-swipe-item {
             height: calc(86vh - 50px);
             overflow-y: auto;
             padding: 0 10px 10px 10px;
+
             &::-webkit-scrollbar {
                 width: 0;
                 display: none;
             }
         }
-        .van-tabs__nav--line{
+
+        .van-tabs__nav--line {
             padding-bottom: 0;
         }
-        .van-tabs__line{
+
+        .van-tabs__line {
             bottom: 0;
         }
-        .van-cell__value{
+
+        .van-cell__value {
+            display: flex;
+            justify-content: flex-end;
+            align-items: center;
             overflow: visible;
         }
     }
@@ -61,6 +69,7 @@
     justify-content: space-between;
     text-align: center;
     padding: 0 var(--cell-padding);
+
     &.tagsbig {
         >span {
             width: 47.5%;
@@ -77,6 +86,7 @@
         background-color: #F8F8F8;
         color: #999999;
         border: 1PX solid #F8F8F8;
+
         &.active {
             color: var(--van-primary-color);
             border-color: var(--van-primary-color);

+ 10 - 9
src/page-gym/header-top/settting/index.tsx

@@ -1,11 +1,10 @@
 import { defineComponent, onBeforeMount, watch } from "vue";
 import styles from "./index.module.less";
 import iconClose from "../image/close2.svg";
-import { Cell, Tab, Tabs } from "vant";
+import { Cell, Switch, Tab, Tabs } from "vant";
 import state from "/src/state";
 import { api_closeCamera, api_openCamera } from "/src/helpers/communication";
 import store from "store";
-import { Switch } from "@varlet/ui";
 
 export default defineComponent({
 	name: "header-settting",
@@ -25,12 +24,12 @@ export default defineComponent({
 						<Tab title="设置">
 							<Cell title="护眼模式" center border={false}>
 								{{
-									value: () => <Switch v-model={state.setting.eyeProtection}></Switch>,
+									value: () => <Switch v-model={state.setting.eyeProtection} size={24} inactiveColor="rgb(204, 204, 204)"></Switch>,
 								}}
 							</Cell>
 							<Cell title="校音提醒" center border={false}>
 								{{
-									value: () => <Switch v-model={state.setting.soundEffect}></Switch>,
+									value: () => <Switch v-model={state.setting.soundEffect} size={24} inactiveColor="rgb(204, 204, 204)"></Switch>,
 								}}
 							</Cell>
 							<Cell title="摄像头" center border={false}>
@@ -38,6 +37,8 @@ export default defineComponent({
 									value: () => (
 										<Switch
 											v-model={state.setting.camera}
+											size={24}
+											inactiveColor="rgb(204, 204, 204)"
 											onChange={(value) => {
 												if (value) {
 													api_openCamera();
@@ -51,17 +52,17 @@ export default defineComponent({
 							</Cell>
 							<Cell title="循环播放" center border={false}>
 								{{
-									value: () => <Switch v-model={state.setting.repeatAutoPlay}></Switch>,
+									value: () => <Switch v-model={state.setting.repeatAutoPlay} size={24} inactiveColor="rgb(204, 204, 204)"></Switch>,
 								}}
 							</Cell>
 							<Cell title="显示指法" center border={false}>
 								{{
-									value: () => <Switch v-model={state.setting.displayFingering}></Switch>,
+									value: () => <Switch v-model={state.setting.displayFingering} size={24} inactiveColor="rgb(204, 204, 204)"></Switch>,
 								}}
 							</Cell>
 							<Cell title="显示光标" center border={false}>
 								{{
-									value: () => <Switch v-model={state.setting.displayCursor}></Switch>,
+									value: () => <Switch v-model={state.setting.displayCursor} size={24} inactiveColor="rgb(204, 204, 204)"></Switch>,
 								}}
 							</Cell>
 							<Cell title="选择调率"></Cell>
@@ -98,12 +99,12 @@ export default defineComponent({
 							</div>
 							<Cell title="保存到相册" center border={false}>
 								{{
-									value: () => <Switch v-model={state.setting.saveToAlbum}></Switch>,
+									value: () => <Switch v-model={state.setting.saveToAlbum} size={24} inactiveColor="rgb(204, 204, 204)"></Switch>,
 								}}
 							</Cell>
 							<Cell title="开启伴奏" center border={false}>
 								{{
-									value: () => <Switch v-model={state.setting.enableAccompaniment}></Switch>,
+									value: () => <Switch v-model={state.setting.enableAccompaniment} size={24} inactiveColor="rgb(204, 204, 204)"></Switch>,
 								}}
 							</Cell>
 						</Tab>

+ 3 - 1
src/state.ts

@@ -391,6 +391,7 @@ export const handleChangeSection = () => {
 	// 如果开启了选段,再次点击取消选段
 	if (state.sectionStatus) {
 		togglePlay('paused')
+		skipNotePlay(0, true);
 		clearSelection();
 		return;
 	}
@@ -401,7 +402,8 @@ export const handleChangeSection = () => {
 	}
 	if (state.sectionToast) {
 		state.sectionToast.message = "请选择开始小节"
-		state.sectionToast?.open()
+		state.sectionToast.duration = 0
+		state.sectionToast.toggle(true)
 	} else {
 		state.sectionToast = showToast({
 			message: "请选择开始小节",

+ 1 - 0
src/style.css

@@ -48,6 +48,7 @@
   transition: all 0.25s;
   background: transparent;
   overflow  : initial;
+  max-width: 100%;
 }
 
 .popup-custom.van-scale {