|
@@ -23,7 +23,7 @@ import { browser } from "/src/utils";
|
|
|
import store from "store";
|
|
|
import "../component/the-modal-tip/index.module.less";
|
|
|
import { metronomeData } from "../../helpers/metronome";
|
|
|
-import { toggleMusicSheet } from "/src/view/plugins/toggleMusicSheet"
|
|
|
+import { toggleMusicSheet } from "/src/view/plugins/toggleMusicSheet";
|
|
|
import useDrag from "/src/view/plugins/useDrag/index";
|
|
|
import Dragbom from "/src/view/plugins/useDrag/dragbom";
|
|
|
import { getGuidance, setGuidance } from "../custom-plugins/guide-page/api";
|
|
@@ -39,22 +39,22 @@ export const headTopData = reactive({
|
|
|
/** 切换模式 */
|
|
|
handleChangeModeType(value: "practise" | "follow" | "evaluating") {
|
|
|
// 后台设置为不能评测
|
|
|
- if (value === 'evaluating' && !state.enableEvaluation) return
|
|
|
+ if (value === "evaluating" && !state.enableEvaluation) return;
|
|
|
// 打击乐&节奏练习不支持跟练模式
|
|
|
- if (value === 'follow' && state.isPercussion) return
|
|
|
+ if (value === "follow" && state.isPercussion) return;
|
|
|
// 跟练模式,光标只有音符模式,无节拍模式
|
|
|
- if (value === 'follow' && metronomeData.cursorMode === 2) {
|
|
|
- metronomeData.cursorMode = 1
|
|
|
+ if (value === "follow" && metronomeData.cursorMode === 2) {
|
|
|
+ metronomeData.cursorMode = 1;
|
|
|
}
|
|
|
- if (value === 'practise') {
|
|
|
+ if (value === "practise") {
|
|
|
// state.playIngSpeed = state.speed
|
|
|
}
|
|
|
if (value === "evaluating") {
|
|
|
// 如果延迟检测资源还在加载中,给出提示
|
|
|
if (!evaluatingData.jsonLoadDone) {
|
|
|
- evaluatingData.jsonLoading = true
|
|
|
- showToast('资源加载中,请稍后')
|
|
|
- return
|
|
|
+ evaluatingData.jsonLoading = true;
|
|
|
+ showToast("资源加载中,请稍后");
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
// 如果是pc端, 评测模式暂不可用
|
|
@@ -67,13 +67,12 @@ export const headTopData = reactive({
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- state.playIngSpeed = state.originSpeed
|
|
|
+ state.playIngSpeed = state.originSpeed;
|
|
|
handleStartEvaluat();
|
|
|
// 开发模式,把此处打开
|
|
|
// state.modeType = "evaluating"
|
|
|
// evaluatingData.rendered = true;
|
|
|
// evaluatingData.soundEffectMode = true;
|
|
|
-
|
|
|
} else if (value === "follow") {
|
|
|
toggleFollow();
|
|
|
}
|
|
@@ -248,6 +247,18 @@ export default defineComponent({
|
|
|
|
|
|
return flag;
|
|
|
});
|
|
|
+
|
|
|
+ const showGuideIndex = computed(() => {
|
|
|
+ // 从课堂乐器学生端课件预览默认不显示会员
|
|
|
+ if (storeData.user.vipMember || state.paymentType === "FREE" || query.showCourseMember === "true") {
|
|
|
+ // 学生端
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ // vip
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
const browInfo = browser();
|
|
|
/** 返回 */
|
|
|
const handleBack = () => {
|
|
@@ -298,7 +309,7 @@ export default defineComponent({
|
|
|
const changePlay = (res: any) => {
|
|
|
// console.log('监听上课页面message',res)
|
|
|
if (res?.data?.api === "setPlayState") {
|
|
|
- togglePlay("paused","courseware");
|
|
|
+ togglePlay("paused", "courseware");
|
|
|
}
|
|
|
|
|
|
// 菜单状态
|
|
@@ -309,7 +320,7 @@ export default defineComponent({
|
|
|
// 上课页面,按钮方向
|
|
|
if (res?.data?.api === "imagePos") {
|
|
|
if (res?.data.data) {
|
|
|
- state.playBtnDirection = res.data.data === 'right' ? 'right' : 'left';
|
|
|
+ state.playBtnDirection = res.data.data === "right" ? "right" : "left";
|
|
|
// if (state.fingeringInfo.direction === "vertical" && state.setting.displayFingering) {
|
|
|
// state.musicScoreBtnDirection = state.playBtnDirection === 'right' ? 'left' : 'right';
|
|
|
// } else {
|
|
@@ -321,18 +332,13 @@ export default defineComponent({
|
|
|
};
|
|
|
|
|
|
const parentClassName = "settingBoxClass_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(headTopData, 'settingMode'),
|
|
|
- userId
|
|
|
- )
|
|
|
+ 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(headTopData, "settingMode"), userId);
|
|
|
|
|
|
onMounted(() => {
|
|
|
getQueryModelSetModelType();
|
|
@@ -355,32 +361,31 @@ export default defineComponent({
|
|
|
});
|
|
|
|
|
|
// 获取引导页信息
|
|
|
- const getAllGuidance = async()=>{
|
|
|
+ const getAllGuidance = async () => {
|
|
|
let guideInfo: any = null;
|
|
|
- try{
|
|
|
- const res = await getGuidance({guideTag:'guideInfo'})
|
|
|
- if(res.data){
|
|
|
- guideInfo = JSON.parse(res.data?.guideValue) || null
|
|
|
- }else{
|
|
|
- guideInfo = {}
|
|
|
+ try {
|
|
|
+ const res = await getGuidance({ guideTag: "guideInfo" });
|
|
|
+ if (res.data) {
|
|
|
+ guideInfo = JSON.parse(res.data?.guideValue) || null;
|
|
|
+ } else {
|
|
|
+ guideInfo = {};
|
|
|
}
|
|
|
state.guideInfo = guideInfo;
|
|
|
- }catch(e){
|
|
|
- console.log(e)
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- getAllGuidance()
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ getAllGuidance();
|
|
|
|
|
|
// 完成拖动弹窗引导页
|
|
|
const handleGuide = async () => {
|
|
|
state.guideInfo.teacherDrag = true;
|
|
|
- try{
|
|
|
- const res = await setGuidance({guideTag:'guideInfo',guideValue:JSON.stringify(state.guideInfo)})
|
|
|
- }catch(e){
|
|
|
- console.log(e)
|
|
|
- }
|
|
|
- }
|
|
|
+ try {
|
|
|
+ const res = await setGuidance({ guideTag: "guideInfo", guideValue: JSON.stringify(state.guideInfo) });
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
+ };
|
|
|
|
|
|
return () => (
|
|
|
<>
|
|
@@ -402,7 +407,7 @@ export default defineComponent({
|
|
|
<div class={[styles.back, "headTopBackBtn", !headTopData.showBack && styles.hidenBack]} onClick={handleBack}>
|
|
|
<img src={iconBack} />
|
|
|
</div>
|
|
|
- {(query.iscurseplay === "play" || state.platform === IPlatform.PC) ? null : <Title class="pcTitle" text={state.examSongName} rightView={false} />}
|
|
|
+ {query.iscurseplay === "play" || state.platform === IPlatform.PC ? null : <Title class="pcTitle" text={state.examSongName} rightView={false} />}
|
|
|
|
|
|
<div
|
|
|
class={[styles.headRight, state.platform === IPlatform.PC && styles.pcHeadRight]}
|
|
@@ -410,7 +415,6 @@ export default defineComponent({
|
|
|
e.stopPropagation();
|
|
|
}}
|
|
|
>
|
|
|
-
|
|
|
<div
|
|
|
id={state.platform === IPlatform.PC ? "teacherTop-0" : "studnetT-0"}
|
|
|
style={{ display: toggleBtn.value.display ? "" : "none" }}
|
|
@@ -425,34 +429,40 @@ export default defineComponent({
|
|
|
</div>
|
|
|
|
|
|
{/* 一行谱模式,暂不支持节拍指针 */}
|
|
|
- {
|
|
|
- !state.isSingleLine ?
|
|
|
- <div class={[styles.btn, state.platform === IPlatform.PC ? styles.pcBtn : ""]} onClick={() => {
|
|
|
- // 切换光标模式
|
|
|
- let mode = metronomeData.cursorMode
|
|
|
- if (['follow'].includes(state.modeType)) {
|
|
|
- mode = metronomeData.cursorMode === 1 ? 3 : 1
|
|
|
- } else {
|
|
|
- mode = metronomeData.cursorMode === 3 ? 1 : metronomeData.cursorMode + 1
|
|
|
- }
|
|
|
- metronomeData.cursorMode = mode
|
|
|
- }}>
|
|
|
- <img class={styles.iconBtn} src={headImg(metronomeData.cursorMode === 1 ? 'cursor-icon-1.svg' : metronomeData.cursorMode === 2 ? 'cursor-icon-2.svg' : metronomeData.cursorMode === 3 ? 'cursor-icon-3.svg' : '')} />
|
|
|
+ {!state.isSingleLine ? (
|
|
|
+ <div
|
|
|
+ class={[styles.btn, state.platform === IPlatform.PC ? styles.pcBtn : ""]}
|
|
|
+ onClick={() => {
|
|
|
+ // 切换光标模式
|
|
|
+ let mode = metronomeData.cursorMode;
|
|
|
+ if (["follow"].includes(state.modeType)) {
|
|
|
+ mode = metronomeData.cursorMode === 1 ? 3 : 1;
|
|
|
+ } else {
|
|
|
+ mode = metronomeData.cursorMode === 3 ? 1 : metronomeData.cursorMode + 1;
|
|
|
+ }
|
|
|
+ metronomeData.cursorMode = mode;
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <img class={styles.iconBtn} src={headImg(metronomeData.cursorMode === 1 ? "cursor-icon-1.svg" : metronomeData.cursorMode === 2 ? "cursor-icon-2.svg" : metronomeData.cursorMode === 3 ? "cursor-icon-3.svg" : "")} />
|
|
|
<span class={styles.iconContent}>
|
|
|
- {metronomeData.cursorMode === 1 ? '音符指针' : metronomeData.cursorMode === 2 ? '节拍指针' : metronomeData.cursorMode === 3 ? '关闭指针' : ''}
|
|
|
- {metronomeData.cursorTips && <>
|
|
|
+ {metronomeData.cursorMode === 1 ? "音符指针" : metronomeData.cursorMode === 2 ? "节拍指针" : metronomeData.cursorMode === 3 ? "关闭指针" : ""}
|
|
|
+ {metronomeData.cursorTips && (
|
|
|
+ <>
|
|
|
<i class={styles.arrowIcon}></i>
|
|
|
- <div class={[styles['botton-tips'],metronomeData.cursorMode === 3 ? styles.tipSpec : '']}>{metronomeData.cursorTips}</div>
|
|
|
- </>}
|
|
|
+ <div class={[styles["botton-tips"], metronomeData.cursorMode === 3 ? styles.tipSpec : ""]}>{metronomeData.cursorTips}</div>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
</span>
|
|
|
- </div> : null
|
|
|
- }
|
|
|
+ </div>
|
|
|
+ ) : null}
|
|
|
|
|
|
{state.musicRendered && !query.lessonTrainingId && !query.questionId && state.isConcert && (
|
|
|
- <div class={[styles.btn, (state.playState === "play" && fingeringBtn.value.disabled) && styles.disabled]}
|
|
|
+ <div
|
|
|
+ class={[styles.btn, state.playState === "play" && fingeringBtn.value.disabled && styles.disabled]}
|
|
|
onClick={() => {
|
|
|
- toggleMusicSheet.toggle(true)
|
|
|
- }}>
|
|
|
+ toggleMusicSheet.toggle(true);
|
|
|
+ }}
|
|
|
+ >
|
|
|
<img class={styles.iconBtn} src={headImg(`shenggui.svg`)} />
|
|
|
<span>声轨</span>
|
|
|
</div>
|
|
@@ -469,20 +479,19 @@ export default defineComponent({
|
|
|
<img style={{ display: state.playSource === "music" ? "none" : "" }} class={styles.iconBtn} src={headImg(`background.svg`)} />
|
|
|
<span>{state.playSource === "music" ? "原声" : "伴奏"}</span>
|
|
|
</div>
|
|
|
- {
|
|
|
- state.modeType !== "evaluating" &&
|
|
|
- <div
|
|
|
- class={[styles.btn]}
|
|
|
- onClick={async () => {
|
|
|
- metronomeData.disable = !metronomeData.disable;
|
|
|
- metronomeData.metro?.initPlayer();
|
|
|
- }}
|
|
|
- >
|
|
|
- <img style={{ display: metronomeData.disable ? "block" : "none" }} class={styles.iconBtn} src={headImg("tickoff.svg")} />
|
|
|
- <img style={{ display: !metronomeData.disable ? "block" : "none" }} class={styles.iconBtn} src={headImg("tickon.svg")} />
|
|
|
- <span style={{ whiteSpace: "nowrap" }}>节拍器</span>
|
|
|
- </div>
|
|
|
- }
|
|
|
+ {state.modeType !== "evaluating" && (
|
|
|
+ <div
|
|
|
+ class={[styles.btn]}
|
|
|
+ onClick={async () => {
|
|
|
+ metronomeData.disable = !metronomeData.disable;
|
|
|
+ metronomeData.metro?.initPlayer();
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <img style={{ display: metronomeData.disable ? "block" : "none" }} class={styles.iconBtn} src={headImg("tickoff.svg")} />
|
|
|
+ <img style={{ display: !metronomeData.disable ? "block" : "none" }} class={styles.iconBtn} src={headImg("tickon.svg")} />
|
|
|
+ <span style={{ whiteSpace: "nowrap" }}>节拍器</span>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
<div id={state.platform === IPlatform.PC ? "teacherTop-2" : "studnetT-2"} style={{ display: selectBtn.value.display ? "" : "none" }} class={[styles.btn, selectBtn.value.disabled && styles.disabled]} 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`)} />
|
|
@@ -502,7 +511,7 @@ export default defineComponent({
|
|
|
<span>指法</span>
|
|
|
</div>
|
|
|
|
|
|
- <Popover trigger="manual" v-model:show={headData.speedShow} placement={state.platform === IPlatform.PC ? "top" : "bottom"} overlay={false} offset={state.platform === IPlatform.PC ? [8,40] : [0,8]}>
|
|
|
+ <Popover trigger="manual" v-model:show={headData.speedShow} placement={state.platform === IPlatform.PC ? "top" : "bottom"} overlay={false} offset={state.platform === IPlatform.PC ? [8, 40] : [0, 8]}>
|
|
|
{{
|
|
|
reference: () => (
|
|
|
<div
|
|
@@ -523,9 +532,8 @@ export default defineComponent({
|
|
|
default: () => <Speed />,
|
|
|
}}
|
|
|
</Popover>
|
|
|
- {
|
|
|
- state.enableNotation ?
|
|
|
- <Popover trigger="manual" v-model:show={headData.musicTypeShow} class={state.platform === IPlatform.PC && styles.pcTransPop} placement={state.platform === IPlatform.PC ? "top-end" : "bottom-end"} overlay={false} offset={state.platform === IPlatform.PC ? [0,40] : [0,8]}>
|
|
|
+ {state.enableNotation ? (
|
|
|
+ <Popover trigger="manual" v-model:show={headData.musicTypeShow} class={state.platform === IPlatform.PC && styles.pcTransPop} placement={state.platform === IPlatform.PC ? "top-end" : "bottom-end"} overlay={false} offset={state.platform === IPlatform.PC ? [0, 40] : [0, 8]}>
|
|
|
{{
|
|
|
reference: () => (
|
|
|
<div
|
|
@@ -543,8 +551,8 @@ export default defineComponent({
|
|
|
),
|
|
|
default: () => <MusicType />,
|
|
|
}}
|
|
|
- </Popover> : null
|
|
|
- }
|
|
|
+ </Popover>
|
|
|
+ ) : null}
|
|
|
<div id={state.platform === IPlatform.PC ? "teacherTop-6" : "studnetT-6"} style={{ display: settingBtn.value.display ? "" : "none" }} class={[styles.btn, styles.setBtn, settingBtn.value.disabled && styles.disabled]} onClick={() => (headTopData.settingMode = true)}>
|
|
|
<img class={styles.iconBtn} src={headImg("icon_menu.svg")} />
|
|
|
<span>设置</span>
|
|
@@ -556,7 +564,13 @@ export default defineComponent({
|
|
|
<div
|
|
|
id="studnetT-7"
|
|
|
style={{ display: playBtn.value.display ? "" : "none" }}
|
|
|
- class={[styles.btn, styles.playBtn, playBtn.value.disabled && styles.disabled, state.platform === IPlatform.PC && state.musicScoreBtnDirection === 'left' ? styles.playLeftButton : state.platform === IPlatform.PC && state.musicScoreBtnDirection === 'right' ? styles.playRightButton : '', state.platform === IPlatform.PC && !state.attendHideMenu && styles.playButtonHide]}
|
|
|
+ class={[
|
|
|
+ styles.btn,
|
|
|
+ styles.playBtn,
|
|
|
+ playBtn.value.disabled && styles.disabled,
|
|
|
+ state.platform === IPlatform.PC && state.musicScoreBtnDirection === "left" ? styles.playLeftButton : state.platform === IPlatform.PC && state.musicScoreBtnDirection === "right" ? styles.playRightButton : "",
|
|
|
+ state.platform === IPlatform.PC && !state.attendHideMenu && styles.playButtonHide,
|
|
|
+ ]}
|
|
|
onClick={() => togglePlay()}
|
|
|
>
|
|
|
<div class={styles.btnWrap}>
|
|
@@ -570,8 +584,13 @@ export default defineComponent({
|
|
|
<div
|
|
|
id="tips-step-9"
|
|
|
style={{ display: resetBtn.value.display ? "" : "none" }}
|
|
|
- class={[styles.btn, styles.resetBtn, resetBtn.value.disabled && styles.disabled,
|
|
|
- state.platform === IPlatform.PC && state.musicScoreBtnDirection === 'left' ? styles.pauseLeftButton : state.platform === IPlatform.PC && state.musicScoreBtnDirection === 'right' ? styles.pauseRightButton : '', state.platform === IPlatform.PC && !state.attendHideMenu && styles.playButtonHide]}
|
|
|
+ class={[
|
|
|
+ styles.btn,
|
|
|
+ styles.resetBtn,
|
|
|
+ resetBtn.value.disabled && styles.disabled,
|
|
|
+ state.platform === IPlatform.PC && state.musicScoreBtnDirection === "left" ? styles.pauseLeftButton : state.platform === IPlatform.PC && state.musicScoreBtnDirection === "right" ? styles.pauseRightButton : "",
|
|
|
+ state.platform === IPlatform.PC && !state.attendHideMenu && styles.playButtonHide,
|
|
|
+ ]}
|
|
|
onClick={() => handleResetPlay()}
|
|
|
>
|
|
|
<img class={styles.iconBtn} src={headImg(state.platform === IPlatform.PC ? "pc_icon_resetbtn.png" : "icon_resetbtn.svg")} />
|
|
@@ -579,14 +598,23 @@ export default defineComponent({
|
|
|
|
|
|
<Popup v-model:show={headTopData.settingMode} class="popup-custom van-scale center-closeBtn settingBoxClass_drag" transition="van-scale" teleport="body" closeable style={positionInfo.styleDrag.value}>
|
|
|
<Settting />
|
|
|
- { state.platform === IPlatform.PC && <Dragbom showGuide={!state.guideInfo?.teacherDrag} onGuideDone={handleGuide} /> }
|
|
|
+ {state.platform === IPlatform.PC && <Dragbom showGuide={!state.guideInfo?.teacherDrag} onGuideDone={handleGuide} />}
|
|
|
</Popup>
|
|
|
|
|
|
{/* 模式切换 */}
|
|
|
<ModeTypeMode />
|
|
|
+
|
|
|
+ {/* // 从课堂乐器学生端课件预览默认不显示会员
|
|
|
+ if (storeData.user.vipMember || state.paymentType === "FREE" || query.showCourseMember === "true") {
|
|
|
+ // 学生端
|
|
|
+ data.showStudent = true;
|
|
|
+ } else {
|
|
|
+ // vip
|
|
|
+ data.showVip = true;
|
|
|
+ } */}
|
|
|
{/* isAllBtns */}
|
|
|
- {isAllBtns.value && !query.isCbs && <TeacherTop></TeacherTop>}
|
|
|
- {isAllBtnsStudent.value && !query.isCbs && <StudentTop></StudentTop>}
|
|
|
+ {isAllBtns.value && !query.isCbs && showGuideIndex.value && <TeacherTop></TeacherTop>}
|
|
|
+ {isAllBtnsStudent.value && !query.isCbs && showGuideIndex.value && <StudentTop></StudentTop>}
|
|
|
</>
|
|
|
);
|
|
|
},
|