|
@@ -1,4 +1,4 @@
|
|
-import { Transition, computed, defineComponent, onMounted, onUnmounted, reactive, ref, watch } from "vue";
|
|
|
|
|
|
+import { Transition, computed, defineComponent, onMounted, onUnmounted, reactive, ref, watch, toRef } from "vue";
|
|
import styles from "./index.module.less";
|
|
import styles from "./index.module.less";
|
|
|
|
|
|
import iconBack from "./image/icon-back.svg";
|
|
import iconBack from "./image/icon-back.svg";
|
|
@@ -24,6 +24,9 @@ import store from "store";
|
|
import "../component/the-modal-tip/index.module.less";
|
|
import "../component/the-modal-tip/index.module.less";
|
|
import { metronomeData } from "../../helpers/metronome";
|
|
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";
|
|
|
|
|
|
/** 头部数据和方法 */
|
|
/** 头部数据和方法 */
|
|
export const headTopData = reactive({
|
|
export const headTopData = reactive({
|
|
@@ -81,6 +84,7 @@ export const headTopData = reactive({
|
|
export const headData = reactive({
|
|
export const headData = reactive({
|
|
speedShow: false,
|
|
speedShow: false,
|
|
musicTypeShow: false,
|
|
musicTypeShow: false,
|
|
|
|
+ showGragGuide: false, // 是否显示可拖动弹窗的引导页(老师端需要显示)
|
|
});
|
|
});
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
@@ -296,6 +300,20 @@ 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} .van-tabs__wrap`,
|
|
|
|
+ `${parentClassName} .bom_drag`
|
|
|
|
+ ],
|
|
|
|
+ parentClassName,
|
|
|
|
+ toRef(headTopData, 'settingMode'),
|
|
|
|
+ userId
|
|
|
|
+ )
|
|
|
|
+
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
getQueryModelSetModelType();
|
|
getQueryModelSetModelType();
|
|
window.addEventListener("message", changePlay);
|
|
window.addEventListener("message", changePlay);
|
|
@@ -316,6 +334,40 @@ export default defineComponent({
|
|
store.set("musicscoresetting", state.setting);
|
|
store.set("musicscoresetting", state.setting);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ // 获取引导页信息
|
|
|
|
+ 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 = {}
|
|
|
|
+ }
|
|
|
|
+ state.guideInfo = guideInfo;
|
|
|
|
+ if (guideInfo && guideInfo.teacherDrag) {
|
|
|
|
+ headData.showGragGuide = false;
|
|
|
|
+ } else {
|
|
|
|
+ headData.showGragGuide = true;
|
|
|
|
+ }
|
|
|
|
+ }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)
|
|
|
|
+ }
|
|
|
|
+ headData.showGragGuide = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
return () => (
|
|
return () => (
|
|
<>
|
|
<>
|
|
<div
|
|
<div
|
|
@@ -336,10 +388,10 @@ export default defineComponent({
|
|
<div class={[styles.back, "headTopBackBtn", !headTopData.showBack && styles.hidenBack]} onClick={handleBack}>
|
|
<div class={[styles.back, "headTopBackBtn", !headTopData.showBack && styles.hidenBack]} onClick={handleBack}>
|
|
<img src={iconBack} />
|
|
<img src={iconBack} />
|
|
</div>
|
|
</div>
|
|
- {query.iscurseplay === "play" ? 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
|
|
<div
|
|
- class={[styles.headRight]}
|
|
|
|
|
|
+ class={[styles.headRight, state.platform === IPlatform.PC && styles.pcHeadRight]}
|
|
onClick={(e: Event) => {
|
|
onClick={(e: Event) => {
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
}}
|
|
}}
|
|
@@ -436,7 +488,7 @@ export default defineComponent({
|
|
<span>指法</span>
|
|
<span>指法</span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <Popover trigger="manual" v-model:show={headData.speedShow} placement="bottom" overlay={false}>
|
|
|
|
|
|
+ <Popover trigger="manual" v-model:show={headData.speedShow} placement={state.platform === IPlatform.PC ? "top" : "bottom"} overlay={false}>
|
|
{{
|
|
{{
|
|
reference: () => (
|
|
reference: () => (
|
|
<div
|
|
<div
|
|
@@ -459,7 +511,7 @@ export default defineComponent({
|
|
</Popover>
|
|
</Popover>
|
|
{
|
|
{
|
|
state.enableNotation ?
|
|
state.enableNotation ?
|
|
- <Popover trigger="manual" v-model:show={headData.musicTypeShow} placement="bottom-end" overlay={false}>
|
|
|
|
|
|
+ <Popover trigger="manual" v-model:show={headData.musicTypeShow} placement={state.platform === IPlatform.PC ? "top-end" : "bottom-end"} overlay={false}>
|
|
{{
|
|
{{
|
|
reference: () => (
|
|
reference: () => (
|
|
<div
|
|
<div
|
|
@@ -490,12 +542,12 @@ export default defineComponent({
|
|
<div
|
|
<div
|
|
id="studnetT-7"
|
|
id="studnetT-7"
|
|
style={{ display: playBtn.value.display ? "" : "none" }}
|
|
style={{ display: playBtn.value.display ? "" : "none" }}
|
|
- class={[styles.btn, styles.playBtn, playBtn.value.disabled && styles.disabled, state.platform === IPlatform.PC && styles.playButton, state.platform === IPlatform.PC && !state.attendHideMenu && styles.playButtonHide]}
|
|
|
|
|
|
+ class={[styles.btn, styles.playBtn, playBtn.value.disabled && styles.disabled, state.platform === IPlatform.PC && state.playBtnDirection === 'left' ? styles.playLeftButton : state.platform === IPlatform.PC && state.playBtnDirection === 'right' ? styles.playRightButton : '', state.platform === IPlatform.PC && !state.attendHideMenu && styles.playButtonHide]}
|
|
onClick={() => togglePlay()}
|
|
onClick={() => togglePlay()}
|
|
>
|
|
>
|
|
<div class={styles.btnWrap}>
|
|
<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")} />
|
|
|
|
|
|
+ <img style={{ display: state.playState === "play" ? "none" : "" }} class={styles.iconBtn} src={headImg(state.platform === IPlatform.PC ? "pc_icon_playbtn.png" : "icon_play.svg")} />
|
|
|
|
+ <img style={{ display: state.playState === "play" ? "" : "none" }} class={styles.iconBtn} src={headImg(state.platform === IPlatform.PC ? "pc_icon_pausebtn.png" : "icon_pause.svg")} />
|
|
<Circle style={{ opacity: state.playState === "play" ? 1 : 0 }} class={styles.progress} stroke-width={80} currentRate={state.playProgress} rate={100} color="#FFC830" />
|
|
<Circle style={{ opacity: state.playState === "play" ? 1 : 0 }} class={styles.progress} stroke-width={80} currentRate={state.playProgress} rate={100} color="#FFC830" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -504,14 +556,15 @@ export default defineComponent({
|
|
<div
|
|
<div
|
|
id="tips-step-9"
|
|
id="tips-step-9"
|
|
style={{ display: resetBtn.value.display ? "" : "none" }}
|
|
style={{ display: resetBtn.value.display ? "" : "none" }}
|
|
- class={[styles.btn, styles.resetBtn, resetBtn.value.disabled && styles.disabled, state.platform === IPlatform.PC && styles.pauseButton, state.platform === IPlatform.PC && !state.attendHideMenu && styles.playButtonHide]}
|
|
|
|
|
|
+ class={[styles.btn, styles.resetBtn, resetBtn.value.disabled && styles.disabled, state.platform === IPlatform.PC && state.playBtnDirection === 'left' ? styles.pauseLeftButton : state.platform === IPlatform.PC && state.playBtnDirection === 'right' ? styles.pauseRightButton : '', state.platform === IPlatform.PC && !state.attendHideMenu && styles.playButtonHide]}
|
|
onClick={() => handleResetPlay()}
|
|
onClick={() => handleResetPlay()}
|
|
>
|
|
>
|
|
- <img class={styles.iconBtn} src={headImg("icon_resetbtn.svg")} />
|
|
|
|
|
|
+ <img class={styles.iconBtn} src={headImg(state.platform === IPlatform.PC ? "pc_icon_resetbtn.png" : "icon_resetbtn.svg")} />
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <Popup v-model:show={headTopData.settingMode} class="popup-custom van-scale center-closeBtn" transition="van-scale" teleport="body" closeable>
|
|
|
|
|
|
+ <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 />
|
|
<Settting />
|
|
|
|
+ { state.platform === IPlatform.PC && <Dragbom showGuide={headData.showGragGuide} onGuideDone={handleGuide} /> }
|
|
</Popup>
|
|
</Popup>
|
|
|
|
|
|
{/* 模式切换 */}
|
|
{/* 模式切换 */}
|