liushengqiang 1 anno fa
parent
commit
f71f6e1996

+ 0 - 5
src/page-instrument/component/mode-type-mode/index.tsx

@@ -8,11 +8,6 @@ import { headTopData } from "../../header-top";
 export default defineComponent({
 	name: "modelWraper",
 	setup() {
-		onMounted(() => {
-			setTimeout(() => {
-				headTopData.modeType = 'init'
-			}, 500)
-		})
 		return () => (
 			<div class={[styles.wrap, headTopData.modeType === 'init' ? '' : styles.hidden ]}>
 				<img onClick={() => headTopData.handleChangeModeType("practise")} src={IconModel1} />

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

@@ -7,6 +7,8 @@
     padding: 8px 10px;
     background: var(--container-background);
     padding-bottom: 0;
+    transform: translateY(-100%);
+    animation: headerDown .3s .5s ease-in-out forwards;
 }
 
 @keyframes headerDown {
@@ -76,9 +78,10 @@
         height: 85%;
     }
 
-    &.disabled {
-        opacity: .8;
-    }
+}
+.disabled {
+    pointer-events: none;
+    opacity: .6;
 }
 
 .badge {

+ 342 - 173
src/page-instrument/header-top/index.tsx

@@ -1,24 +1,27 @@
-import { computed, defineComponent, onMounted, reactive, ref } from "vue";
+import { Transition, computed, defineComponent, onMounted, onUnmounted, reactive, ref } from "vue";
 import styles from "./index.module.less";
 
 import iconBack from "./image/icon-back.svg";
 import Title from "./title";
 import { headImg } from "./image";
 import { Badge, Circle, Popover, Popup } from "vant";
-import { metronomeData } from "../../helpers/metronome";
 import Speed from "./speed";
 import { evaluatingData, handleStartEvaluat } from "/src/view/evaluating";
 import Settting from "./settting";
 import state, { handleChangeSection, handleResetPlay, handleRessetState, togglePlay } from "/src/state";
 import { getAudioCurrentTime } from "/src/view/audio-list";
-import { toggleFollow } from "/src/view/follow-practice";
+import { followData, toggleFollow } from "/src/view/follow-practice";
 import { api_back } from "/src/helpers/communication";
 import MusicType from "./music-type";
+import ModeTypeMode from "../component/mode-type-mode";
+import { getQuery } from "/src/utils/queryString";
 
 /** 头部数据和方法 */
 export const headTopData = reactive({
 	/** 模式 */
 	modeType: "" as "init" | "show",
+	/** 显示返回按钮 */
+	showBack: true,
 	/** 设置弹窗 */
 	settingMode: false,
 	/** 切换模式 */
@@ -40,14 +43,100 @@ export const headData = reactive({
 export default defineComponent({
 	name: "header-top",
 	setup() {
-		const disabledList = ["evaluating"];
+		/** 设置按钮 */
+		const settingBtn = computed(() => {
+			// 音频播放中 禁用
+			if (state.playState === "play") return { display: true, disabled: true };
+			// 评测开始 禁用, 跟练开始 禁用
+			if (evaluatingData.startBegin || followData.start) return { display: true, disabled: true };
 
-		/** 按钮禁用 */
+			return {
+				display: true,
+				disabled: false,
+			};
+		});
+
+		/** 转谱按钮 */
+		const converBtn = computed(() => {
+			// 音频播放中 禁用
+			if (state.playState === "play") return { display: true, disabled: true };
+			// 评测开始 禁用
+			if (evaluatingData.startBegin || followData.start) return { display: true, disabled: true };
+
+			return {
+				disabled: false,
+				display: true,
+			};
+		});
+
+		/** 速度按钮 */
+		const speedBtn = computed(() => {
+			// 选择模式, 跟练模式  不显示
+			if (headTopData.modeType !== "show" || state.modeType === "follow")
+				return { display: false, disabled: true };
+			// 评测模式, 音频播放中 禁用
+			if (state.modeType === "evaluating" || state.playState === "play")
+				return { display: true, disabled: true };
+
+			return {
+				disabled: false,
+				display: true,
+			};
+		});
+
+		/** 指法按钮 */
+		const fingeringBtn = computed(() => {
+			// 没有指法 选择模式 评测模式 跟练模式 不显示
+			if (
+				headTopData.modeType !== "show" ||
+				!state.fingeringInfo.name ||
+				["evaluating", "follow"].includes(state.modeType)
+			)
+				return { display: false, disabled: true };
+			// 音频播放中 禁用
+			if (state.playState === "play") return { display: true, disabled: true };
+
+			return {
+				disabled: false,
+				display: true,
+			};
+		});
+
+		/** 摄像头按钮 */
+		const cameraBtn = computed(() => {
+			// 选择模式 不显示
+			if (headTopData.modeType !== "show" || state.modeType !== "evaluating")
+				return { display: false, disabled: true };
+			// 音频播放中 禁用
+			if (state.playState === "play") return { display: true, disabled: true };
+
+			return {
+				disabled: false,
+				display: true,
+			};
+		});
+
+		/** 选段按钮 */
+		const selectBtn = computed(() => {
+			// 选择模式 不显示
+			if (headTopData.modeType !== "show" || ["evaluating", "follow"].includes(state.modeType))
+				return { display: false, disabled: true };
+			// 音频播放中 禁用
+			if (state.playState === "play") return { display: true, disabled: true };
+
+			return {
+				disabled: false,
+				display: true,
+			};
+		});
 
 		/** 原声按钮 */
 		const originBtn = computed(() => {
+			// 选择模式,跟练模式 不显示
+			if (headTopData.modeType !== "show" || state.modeType === "follow")
+				return { display: false, disabled: false };
 			// 评测开始 禁用
-			if (state.modeType === "evaluating") return { display: true, disabled: true };
+			if (state.modeType === "evaluating") return { display: false, disabled: true };
 			// 原声, 伴奏 少一个,就不能切换
 			if (!state.music || !state.accompany) return { display: true, disabled: true };
 
@@ -57,21 +146,49 @@ export default defineComponent({
 			};
 		});
 
-		/** 重播按钮显示条件 */
-		const resetBtnDisplay = computed(() => {
-			const currentTime = getAudioCurrentTime();
-			const playState = state.playState;
-			const modeType = state.modeType;
-			return currentTime !== 0 && playState !== "play" && modeType === "practise";
+		/** 模式切换按钮 */
+		const toggleBtn = computed(() => {
+			// 选择模式, url设置模式 不显示
+			if (headTopData.modeType !== "show" || !headTopData.showBack)
+				return { display: false, disabled: false };
+			// 跟练开始, 评测开始 禁用
+			if (followData.start || evaluatingData.startBegin) return { display: true, disabled: true };
+
+			return {
+				display: true,
+				disabled: false,
+			};
 		});
-		/** 播放按钮显示条件 */
-		const playBtnDisplay = computed(() => {
-			const modeType = state.modeType;
-			return modeType === "practise";
+
+		/** 播放按钮 */
+		const playBtn = computed(() => {
+			// 选择模式 不显示
+			if (headTopData.modeType !== "show") return { display: false, disabled: false };
+			// 评测模式 不显示,跟练模式 不显示
+			if (["evaluating", "follow"].includes(state.modeType)) return { display: false, disabled: true };
+
+			return {
+				display: true,
+				disabled: false,
+			};
 		});
-		/** 指法显示条件 */
-		const fingeringDisplay = computed(() => {
-			return state.fingeringInfo.name;
+
+		/** 重播按钮 */
+		const resetBtn = computed(() => {
+			// 选择模式 不显示
+			if (headTopData.modeType !== "show") return { display: false, disabled: false };
+			// 评测模式 不显示,跟练模式 不显示
+			if (["evaluating", "follow"].includes(state.modeType)) return { display: false, disabled: true };
+			// 播放状态 不显示
+			if (state.playState === "play") return { display: false, disabled: true };
+			// 播放进度为0 不显示
+			const currentTime = getAudioCurrentTime();
+			if (!currentTime) return { display: false, disabled: true };
+
+			return {
+				display: true,
+				disabled: false,
+			};
 		});
 
 		/** 返回 */
@@ -79,178 +196,227 @@ export default defineComponent({
 			api_back();
 		};
 
-		return () => (
-			<div class={[styles.headerTop]}>
-				<div class={styles.back} onClick={handleBack}>
-					<img src={iconBack} />
-				</div>
-				<Title text={state.examSongName} rightView={false} />
+		/** 根据参数设置模式 */
+		const getQueryModelSetModelType = () => {
+			const query: any = getQuery();
+			if (query.modelType) {
+				if (query.modelType === "practise") {
+					headTopData.handleChangeModeType("practise");
+				} else if (query.modelType === "evaluating") {
+					headTopData.handleChangeModeType("evaluating");
+				}
+				headTopData.showBack = false;
+			} else {
+				setTimeout(() => {
+					headTopData.modeType = "init";
+				}, 500);
+			}
+		};
 
-				<div class={styles.headRight} style={{ display: headTopData.modeType === "show" ? "" : "none" }}>
-					<div
-						class={styles.btn}
-						onClick={() => {
-							handleRessetState();
-							headTopData.modeType = "init";
-						}}
-					>
-						<img class={styles.iconBtn} src={headImg(`modeType.svg`)} />
-						<span>模式</span>
-					</div>
+		/** 课件播放 */
+		const changePlay = (res: any) => {
+			if (res?.data?.api === "setPlayState") {
+				togglePlay("paused");
+			}
+		};
 
-					<div
-						class={[styles.btn, originBtn.value.disabled && styles.disable]}
-						id="tips-step-6"
-						onClick={() => {
-							state.playSource = state.playSource === "music" ? "background" : "music";
-						}}
-					>
-						<img
-							style={{ display: state.playSource === "music" ? "" : "none" }}
-							class={styles.iconBtn}
-							src={headImg(`music.svg`)}
-						/>
-						<img
-							style={{ display: state.playSource === "music" ? "none" : "" }}
-							class={styles.iconBtn}
-							src={headImg(`background.svg`)}
-						/>
-						<span>{state.playSource === "music" ? "原声" : "伴奏"}</span>
-					</div>
-					<div
-						class={[styles.btn, disabledList.includes(state.modeType) && styles.disable]}
-						id="tips-step-4"
-						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`)}
-						/>
-						<img
-							style={{ display: state.section.length === 2 ? "" : "none" }}
-							class={styles.iconBtn}
-							src={headImg(`section2.svg`)}
-						/>
-						<span>选段</span>
-					</div>
-					<div
-						style={{ display: fingeringDisplay.value ? "" : "none" }}
-						class={[styles.btn, disabledList.includes(state.modeType) && styles.disable]}
-						onClick={() => {
-							state.setting.displayFingering = !state.setting.displayFingering;
-						}}
-					>
-						<img
-							style={{ display: state.setting.displayFingering ? "" : "none" }}
-							class={styles.iconBtn}
-							src={headImg(`icon_evaluatingOn.svg`)}
-						/>
-						<img
-							style={{ display: state.setting.displayFingering ? "none" : "" }}
-							class={styles.iconBtn}
-							src={headImg(`icon_evaluatingOff.svg`)}
-						/>
-						<span>指法</span>
-					</div>
+		onMounted(() => {
+			getQueryModelSetModelType();
+			window.addEventListener("message", changePlay);
+		});
 
-					<Popover trigger="manual" v-model:show={headData.speedShow} placement="bottom" overlay={false}>
-						{{
-							reference: () => (
-								<div
-									id="tips-step-8"
-									class={[styles.btn, disabledList.includes(state.modeType) && styles.disable]}
-									onClick={(e: Event) => {
-										e.stopPropagation();
-										headData.speedShow = !headData.speedShow;
-									}}
-								>
-									<Badge class={styles.badge} content={state.speed}>
-										<img class={styles.iconBtn} src={headImg("icon_speed.svg")} />
-									</Badge>
-									<span>速度</span>
-								</div>
-							),
-							default: () => <Speed />,
-						}}
-					</Popover>
-					<Popover
-						trigger="manual"
-						v-model:show={headData.musicTypeShow}
-						placement="bottom-end"
-						overlay={false}
-					>
-						{{
-							reference: () => (
-								<div
-									class={[styles.btn, disabledList.includes(state.modeType) && styles.disable]}
-									onClick={(e: Event) => {
-										e.stopPropagation();
-										headData.musicTypeShow = !headData.musicTypeShow;
-									}}
-								>
-									<img class={styles.iconBtn} src={headImg("icon_zhuanpu.svg")} />
-									<span>{state.musicRenderType === "staff" ? "转简谱" : "转五线谱"}</span>
-								</div>
-							),
-							default: () => <MusicType />,
-						}}
-					</Popover>
+		onUnmounted(() => {
+			window.removeEventListener("message", changePlay);
+		});
 
-					<div
-						class={[styles.btn, disabledList.includes(state.modeType) && styles.disable]}
-						onClick={() => (headTopData.settingMode = true)}
-					>
-						<img class={styles.iconBtn} src={headImg("icon_menu.svg")} />
-						<span>设置</span>
-					</div>
+		return () => (
+			<>
+				<div class={[styles.headerTop]}>
+					{headTopData.showBack && (
+						<div class={styles.back} onClick={handleBack}>
+							<img src={iconBack} />
+						</div>
+					)}
+					<Title text={state.examSongName} rightView={false} />
 
 					<div
-						style={{ display: playBtnDisplay.value ? "" : "none" }}
-						class={[styles.btn, styles.playBtn, disabledList.includes(state.modeType) && styles.disable]}
-						id="tips-step-5"
-						onClick={() => togglePlay()}
+						class={styles.headRight}
 					>
-						<div class={styles.btnWrap}>
+						<div
+							style={{ display: toggleBtn.value.display ? "" : "none" }}
+							class={[styles.btn, toggleBtn.value.disabled && styles.disabled]}
+							onClick={() => {
+								handleRessetState();
+								headTopData.modeType = "init";
+							}}
+						>
+							<img class={styles.iconBtn} src={headImg(`modeType.svg`)} />
+							<span>模式</span>
+						</div>
+
+						<div
+							style={{ display: originBtn.value.display ? "" : "none" }}
+							class={[styles.btn, originBtn.value.disabled && styles.disabled]}
+							id="tips-step-6"
+							onClick={() => {
+								state.playSource = state.playSource === "music" ? "background" : "music";
+							}}
+						>
 							<img
-								style={{ display: state.playState === "play" ? "none" : "" }}
+								style={{ display: state.playSource === "music" ? "" : "none" }}
 								class={styles.iconBtn}
-								src={headImg("icon_play.svg")}
+								src={headImg(`music.svg`)}
 							/>
 							<img
-								style={{ display: state.playState === "play" ? "" : "none" }}
+								style={{ display: state.playSource === "music" ? "none" : "" }}
 								class={styles.iconBtn}
-								src={headImg("icon_pause.svg")}
+								src={headImg(`background.svg`)}
 							/>
-							<Circle
-								style={{ opacity: state.playState === "play" ? 1 : 0 }}
-								class={styles.progress}
-								stroke-width={80}
-								currentRate={state.playProgress}
-								rate={100}
-								color="#FFC830"
+							<span>{state.playSource === "music" ? "原声" : "伴奏"}</span>
+						</div>
+						<div
+							style={{ display: selectBtn.value.display ? "" : "none" }}
+							class={[styles.btn, selectBtn.value.disabled && styles.disabled]}
+							id="tips-step-4"
+							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`)}
+							/>
+							<img
+								style={{ display: state.section.length === 2 ? "" : "none" }}
+								class={styles.iconBtn}
+								src={headImg(`section2.svg`)}
 							/>
+							<span>选段</span>
+						</div>
+						<div
+							style={{ display: fingeringBtn.value.display ? "" : "none" }}
+							class={[styles.btn, fingeringBtn.value.disabled && styles.disabled]}
+							onClick={() => {
+								state.setting.displayFingering = !state.setting.displayFingering;
+							}}
+						>
+							<img
+								style={{ display: state.setting.displayFingering ? "" : "none" }}
+								class={styles.iconBtn}
+								src={headImg(`icon_evaluatingOn.svg`)}
+							/>
+							<img
+								style={{ display: state.setting.displayFingering ? "none" : "" }}
+								class={styles.iconBtn}
+								src={headImg(`icon_evaluatingOff.svg`)}
+							/>
+							<span>指法</span>
+						</div>
+
+						<Popover
+							trigger="manual"
+							v-model:show={headData.speedShow}
+							placement="bottom"
+							overlay={false}
+						>
+							{{
+								reference: () => (
+									<div
+										id="tips-step-8"
+										style={{ display: speedBtn.value.display ? "" : "none" }}
+										class={[styles.btn, speedBtn.value.disabled && styles.disabled]}
+										onClick={(e: Event) => {
+											e.stopPropagation();
+											headData.speedShow = !headData.speedShow;
+										}}
+									>
+										<Badge class={styles.badge} content={state.speed}>
+											<img class={styles.iconBtn} src={headImg("icon_speed.svg")} />
+										</Badge>
+										<span>速度</span>
+									</div>
+								),
+								default: () => <Speed />,
+							}}
+						</Popover>
+						<Popover
+							trigger="manual"
+							v-model:show={headData.musicTypeShow}
+							placement="bottom-end"
+							overlay={false}
+						>
+							{{
+								reference: () => (
+									<div
+										style={{ display: converBtn.value.display ? "" : "none" }}
+										class={[styles.btn, converBtn.value.disabled && styles.disabled]}
+										onClick={(e: Event) => {
+											e.stopPropagation();
+											headData.musicTypeShow = !headData.musicTypeShow;
+										}}
+									>
+										<img class={styles.iconBtn} src={headImg("icon_zhuanpu.svg")} />
+										<span>{state.musicRenderType === "staff" ? "转简谱" : "转五线谱"}</span>
+									</div>
+								),
+								default: () => <MusicType />,
+							}}
+						</Popover>
+
+						<div
+							style={{ display: settingBtn.value.display ? "" : "none" }}
+							class={[styles.btn, settingBtn.value.disabled && styles.disabled]}
+							onClick={() => (headTopData.settingMode = true)}
+						>
+							<img class={styles.iconBtn} src={headImg("icon_menu.svg")} />
+							<span>设置</span>
 						</div>
 					</div>
-					<div
-						style={{ display: resetBtnDisplay.value ? "" : "none" }}
-						class={[
-							styles.btn,
-							styles.resetBtn,
-							disabledList.includes(state.modeType) && styles.disable,
-						]}
-						id="tips-step-7"
-						onClick={() => handleResetPlay()}
-					>
-						<img class={styles.iconBtn} src={headImg("icon_resetbtn.svg")} />
+				</div>
+
+				{/* 播放按钮 */}
+				<div
+					style={{ display: playBtn.value.display ? "" : "none" }}
+					class={[styles.btn, styles.playBtn, playBtn.value.disabled && styles.disabled]}
+					id="tips-step-5"
+					onClick={() => togglePlay()}
+				>
+					<div class={styles.btnWrap}>
+						<img
+							style={{ display: state.playState === "play" ? "none" : "" }}
+							class={styles.iconBtn}
+							src={headImg("icon_play.svg")}
+						/>
+						<img
+							style={{ display: state.playState === "play" ? "" : "none" }}
+							class={styles.iconBtn}
+							src={headImg("icon_pause.svg")}
+						/>
+						<Circle
+							style={{ opacity: state.playState === "play" ? 1 : 0 }}
+							class={styles.progress}
+							stroke-width={80}
+							currentRate={state.playProgress}
+							rate={100}
+							color="#FFC830"
+						/>
 					</div>
 				</div>
 
+				{/* 重播按钮 */}
+				<div
+					style={{ display: resetBtn.value.display ? "" : "none" }}
+					class={[styles.btn, styles.resetBtn, resetBtn.value.disabled && styles.disabled]}
+					id="tips-step-7"
+					onClick={() => handleResetPlay()}
+				>
+					<img class={styles.iconBtn} src={headImg("icon_resetbtn.svg")} />
+				</div>
+
 				<Popup
 					v-model:show={headTopData.settingMode}
 					class="popup-custom van-scale center-closeBtn"
@@ -260,7 +426,10 @@ export default defineComponent({
 				>
 					<Settting />
 				</Popup>
-			</div>
+
+				{/* 模式切换 */}
+				<ModeTypeMode />
+			</>
 		);
 	},
 });

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

@@ -1,7 +1,7 @@
 .container {
   width: 170px;
   height: 31px;
-  background: #fff;
+  background: transparent;
   display: flex;
   align-items: center;
   border-radius: 18px;

+ 0 - 3
src/page-instrument/view-detail/index.tsx

@@ -38,7 +38,6 @@ import Tick, { handleInitTick } from "/src/view/tick";
 import FollowPractice from "/src/view/follow-practice";
 import FollowModel from "../follow-model";
 import RecordingTime from "../custom-plugins/recording-time";
-import ModeTypeMode from "../component/mode-type-mode";
 
 export default defineComponent({
 	name: "music-list",
@@ -302,8 +301,6 @@ export default defineComponent({
 						<MeasureSpeed />
 						{/* 统计训练时长 */}
 						<RecordingTime />
-						{/* 模式切换 */}
-						<ModeTypeMode />
 					</>
 				)}
 			</div>

+ 2 - 2
src/page-orchestra/custom-plugins/guide-page/index.tsx

@@ -30,8 +30,8 @@ export default defineComponent({
 		/** 触发器 */
 		const handleChange = () => {
 			const search = getQuery();
-			// 如果为课后作业 和 单元测验 不引导
-			if (search.questionId || search.lessonTrainingId) {
+			// 如果为课后作业 , 单元测验, 设置模式 不引导
+			if (search.questionId || search.lessonTrainingId || search.modelType) {
 				return;
 			}
 			if (headData.modeMode) {

+ 1 - 1
src/page-orchestra/detail/index.tsx

@@ -257,7 +257,7 @@ export default defineComponent({
 						</div>
 					)}
 					<div class={[styles.headHeight, detailData.headerHide && styles.headHide]} onClick={(e: Event) => e.stopPropagation()}>
-						<Transition name="van-slide-down">{state.musicRendered && <HeaderTop />}</Transition>
+						{state.musicRendered && <HeaderTop />}
 					</div>
 					<div
 						id="scrollContainer"

+ 115 - 21
src/page-orchestra/header-top/index.tsx

@@ -1,4 +1,16 @@
-import { Transition, computed, defineComponent, onBeforeUnmount, onMounted, onUnmounted, reactive, ref, watch } from "vue";
+import {
+	Transition,
+	computed,
+	defineComponent,
+	h,
+	onBeforeMount,
+	onBeforeUnmount,
+	onMounted,
+	onUnmounted,
+	reactive,
+	ref,
+	watch,
+} from "vue";
 import styles from "./index.module.less";
 import store from "store";
 
@@ -21,6 +33,7 @@ import Camera from "./camera";
 import iconCamera from "./image/icon-camera-off.png";
 import iconCameraOn from "./image/icon-camera-on.png";
 import iconEvaluat from "../evaluat-model/icons/evaluating.json";
+import { getQuery } from "/src/utils/queryString";
 
 export const headData = reactive({
 	speedShow: false,
@@ -28,6 +41,7 @@ export const headData = reactive({
 	modeMode: true, // 模式弹框
 	settingMode: false, // 设置弹框
 	cameraShow: false, // 摄像头
+	isShowBack: true, // 是否显示返回按钮
 });
 
 /** 关闭模式选择 */
@@ -79,7 +93,8 @@ export default defineComponent({
 			// 选择模式, 跟练模式  不显示
 			if (headData.modeMode || state.modeType === "follow") return { display: false, disabled: true };
 			// 评测模式, 音频播放中 禁用
-			if (state.modeType === "evaluating" || state.playState === "play") return { display: true, disabled: true };
+			if (state.modeType === "evaluating" || state.playState === "play")
+				return { display: true, disabled: true };
 
 			return {
 				disabled: false,
@@ -90,7 +105,12 @@ export default defineComponent({
 		/** 指法按钮 */
 		const fingeringBtn = computed(() => {
 			// 没有指法 选择模式 评测模式 跟练模式 不显示
-			if (headData.modeMode || !state.fingeringInfo.name || ["evaluating", "follow"].includes(state.modeType)) return { display: false, disabled: true };
+			if (
+				headData.modeMode ||
+				!state.fingeringInfo.name ||
+				["evaluating", "follow"].includes(state.modeType)
+			)
+				return { display: false, disabled: true };
 			// 音频播放中 禁用
 			if (state.playState === "play") return { display: true, disabled: true };
 
@@ -103,7 +123,8 @@ export default defineComponent({
 		/** 摄像头按钮 */
 		const cameraBtn = computed(() => {
 			// 选择模式 不显示
-			if (headData.modeMode || state.modeType !== "evaluating") return { display: false, disabled: true };
+			if (headData.modeMode || state.modeType !== "evaluating")
+				return { display: false, disabled: true };
 			// 音频播放中 禁用
 			if (state.playState === "play") return { display: true, disabled: true };
 
@@ -116,7 +137,8 @@ export default defineComponent({
 		/** 选段按钮 */
 		const selectBtn = computed(() => {
 			// 选择模式 不显示
-			if (headData.modeMode || ["evaluating", "follow"].includes(state.modeType)) return { display: false, disabled: true };
+			if (headData.modeMode || ["evaluating", "follow"].includes(state.modeType))
+				return { display: false, disabled: true };
 			// 音频播放中 禁用
 			if (state.playState === "play") return { display: true, disabled: true };
 
@@ -144,7 +166,7 @@ export default defineComponent({
 		/** 模式切换按钮 */
 		const toggleBtn = computed(() => {
 			// 选择模式 不显示
-			if (headData.modeMode) return { display: false, disabled: false };
+			if (headData.modeMode || !headData.isShowBack) return { display: false, disabled: false };
 			// 跟练开始, 评测开始 禁用
 			if (followData.start || evaluatingData.startBegin) return { display: true, disabled: true };
 
@@ -177,7 +199,7 @@ export default defineComponent({
 			if (state.playState === "play") return { display: false, disabled: true };
 			// 播放进度为0 不显示
 			const currentTime = getAudioCurrentTime();
-			if (currentTime === 0) return { display: false, disabled: true };
+			if (!currentTime) return { display: false, disabled: true };
 
 			return {
 				display: true,
@@ -198,6 +220,22 @@ export default defineComponent({
 			}
 		};
 
+		/** 根据参数设置模式 */
+		const getQueryModelSetModelType = () => {
+			const query: any = getQuery();
+			if (query.modelType) {
+				if (["practice", "practise"].includes(query.modelType)) {
+					handleChangeModeType("practise");
+				} else if (query.modelType === "evaluating") {
+					handleChangeModeType("evaluating");
+				}
+				headData.isShowBack = false
+			}
+		};
+		onBeforeMount(() => {
+			getQueryModelSetModelType();
+		});
+
 		onMounted(() => {
 			api_suspendPlay(() => {
 				if (state.modeType === "practise") {
@@ -223,9 +261,11 @@ export default defineComponent({
 
 		return () => (
 			<div class={styles.headerTop}>
-				<div class={styles.back} onClick={handleBack}>
-					<img src={icons["icon-back"]} />
-				</div>
+				{headData.isShowBack && (
+					<div class={styles.back} onClick={handleBack}>
+						<img src={icons["icon-back"]} />
+					</div>
+				)}
 				<Title text={state.examSongName} rightView={false} />
 
 				<div class={styles.headRight}>
@@ -241,7 +281,13 @@ export default defineComponent({
 					>
 						<img
 							class={styles.iconBtn}
-							src={state.modeType === "practise" ? icons.modelType : state.modeType === "evaluating" ? icons.modelType2 : icons.modelType1}
+							src={
+								state.modeType === "practise"
+									? icons.modelType
+									: state.modeType === "evaluating"
+									? icons.modelType2
+									: icons.modelType1
+							}
 						/>
 						<span>模式</span>
 					</div>
@@ -255,7 +301,10 @@ export default defineComponent({
 							state.playSource = state.playSource === "music" ? "background" : "music";
 						}}
 					>
-						<img class={styles.iconBtn} src={state.playSource === "music" ? icons.music : icons.accompaniment} />
+						<img
+							class={styles.iconBtn}
+							src={state.playSource === "music" ? icons.music : icons.accompaniment}
+						/>
 						<span>{state.playSource === "music" ? "原声" : "伴奏"}</span>
 					</div>
 
@@ -266,7 +315,16 @@ export default defineComponent({
 						class={[styles.btn, selectBtn.value.disabled && styles.disabled]}
 						onClick={() => handleChangeSection()}
 					>
-						<img class={styles.iconBtn} src={state.section.length === 0 ? icons.section : state.section.length === 1 ? icons.section1 : icons.section2} />
+						<img
+							class={styles.iconBtn}
+							src={
+								state.section.length === 0
+									? icons.section
+									: state.section.length === 1
+									? icons.section1
+									: icons.section2
+							}
+						/>
 						<span>选段</span>
 					</div>
 
@@ -279,7 +337,10 @@ export default defineComponent({
 							state.setting.displayFingering = !state.setting.displayFingering;
 						}}
 					>
-						<img class={styles.iconBtn} src={state.setting.displayFingering ? icons.fingeringOn : icons.fingeringOff} />
+						<img
+							class={styles.iconBtn}
+							src={state.setting.displayFingering ? icons.fingeringOn : icons.fingeringOff}
+						/>
 						<span>指法</span>
 					</div>
 
@@ -305,7 +366,12 @@ export default defineComponent({
 					</div> */}
 
 					{/* 摄像头按钮 */}
-					<Popover trigger="manual" v-model:show={headData.cameraShow} placement="bottom" overlay={false}>
+					<Popover
+						trigger="manual"
+						v-model:show={headData.cameraShow}
+						placement="bottom"
+						overlay={false}
+					>
 						{{
 							reference: () => (
 								<div
@@ -317,8 +383,16 @@ export default defineComponent({
 										headData.cameraShow = !headData.cameraShow;
 									}}
 								>
-									<img style={{ display: state.setting.camera ? "none" : "" }} class={styles.iconBtn} src={iconCamera} />
-									<img style={{ display: state.setting.camera ? "" : "none" }} class={styles.iconBtn} src={iconCameraOn} />
+									<img
+										style={{ display: state.setting.camera ? "none" : "" }}
+										class={styles.iconBtn}
+										src={iconCamera}
+									/>
+									<img
+										style={{ display: state.setting.camera ? "" : "none" }}
+										class={styles.iconBtn}
+										src={iconCameraOn}
+									/>
 									<span>摄像头</span>
 								</div>
 							),
@@ -350,7 +424,12 @@ export default defineComponent({
 					</Popover>
 
 					{/* 转简谱按钮 */}
-					<Popover trigger="manual" v-model:show={headData.musicTypeShow} placement="bottom-end" overlay={false}>
+					<Popover
+						trigger="manual"
+						v-model:show={headData.musicTypeShow}
+						placement="bottom-end"
+						overlay={false}
+					>
 						{{
 							reference: () => (
 								<div
@@ -387,7 +466,10 @@ export default defineComponent({
 						onClick={() => togglePlay()}
 					>
 						<div class={styles.btnWrap}>
-							<img class={styles.iconBtn} src={state.playState === "paused" ? icons.play : icons.pause} />
+							<img
+								class={styles.iconBtn}
+								src={state.playState === "paused" ? icons.play : icons.pause}
+							/>
 							<Circle
 								style={{ display: state.playState === "paused" ? "none" : "" }}
 								class={styles.progress}
@@ -410,10 +492,22 @@ export default defineComponent({
 					</div>
 				</div>
 
-				<Popup v-model:show={headData.settingMode} class="popup-custom van-scale" transition="van-scale" teleport="body">
+				<Popup
+					v-model:show={headData.settingMode}
+					class="popup-custom van-scale"
+					transition="van-scale"
+					teleport="body"
+				>
 					<Settting onClose={() => (headData.settingMode = false)} />
 				</Popup>
-				<Popup v-model:show={headData.modeMode} teleport="body" class="popup-custom" position="bottom" closeOnClickOverlay={false} overlay={false}>
+				<Popup
+					v-model:show={headData.modeMode}
+					teleport="body"
+					class="popup-custom"
+					position="bottom"
+					closeOnClickOverlay={false}
+					overlay={false}
+				>
 					<ModeTypeMode onClose={(value) => handleChangeModeType(value)} />
 				</Popup>