|
@@ -5,11 +5,13 @@ import iconBack from "./image/icon-back.svg";
|
|
|
import Title from "./title";
|
|
|
import state, { handleChangeSection, handleResetPlay, togglePlay } from "../../state";
|
|
|
import { headImg } from "./image";
|
|
|
-import icons from './image/headerTop.json'
|
|
|
+import icons from "./image/headerTop.json";
|
|
|
import { Badge, Circle, Popover } from "vant";
|
|
|
import { metronomeData } from "../../helpers/metronome";
|
|
|
import Speed from "./speed";
|
|
|
import { evaluatingData, handleStartEvaluat } from "/src/view/evaluating";
|
|
|
+import { Popup } from "@varlet/ui";
|
|
|
+import Settting from "./settting";
|
|
|
|
|
|
export const headData = reactive({
|
|
|
speedShow: false,
|
|
@@ -18,12 +20,15 @@ export const headData = reactive({
|
|
|
export default defineComponent({
|
|
|
name: "header-top",
|
|
|
setup() {
|
|
|
+ const headerData = reactive({
|
|
|
+ settingMode: false,
|
|
|
+ });
|
|
|
const headRef = ref();
|
|
|
|
|
|
const toggleEvaluat = () => {
|
|
|
- handleStartEvaluat()
|
|
|
- }
|
|
|
- const disabledList = [ "evaluating"]
|
|
|
+ handleStartEvaluat();
|
|
|
+ };
|
|
|
+ const disabledList = ["evaluating"];
|
|
|
return () => (
|
|
|
<div ref={headRef} class={styles.headerTop}>
|
|
|
<div class={styles.back}>
|
|
@@ -33,7 +38,7 @@ export default defineComponent({
|
|
|
|
|
|
<div class={styles.headRight}>
|
|
|
<div class={styles.btn} id="tips-step-2" onClick={toggleEvaluat}>
|
|
|
- <img class={styles.iconBtn} src={state.modeType === 'evaluating' ? icons.evaluating2 : icons.evaluating} />
|
|
|
+ <img class={styles.iconBtn} src={state.modeType === "evaluating" ? icons.evaluating2 : icons.evaluating} />
|
|
|
<span>评测</span>
|
|
|
</div>
|
|
|
<div class={[styles.btn, disabledList.includes(state.modeType) && styles.disable]} id="tips-step-4" onClick={() => handleChangeSection()}>
|
|
@@ -43,7 +48,7 @@ export default defineComponent({
|
|
|
</div>
|
|
|
<div class={[styles.btn, disabledList.includes(state.modeType) && styles.disable]} id="tips-step-5" onClick={() => togglePlay()}>
|
|
|
<div class={styles.btnWrap}>
|
|
|
- <img style={{ marginTop: "-1px" }} class={styles.iconBtn} src={ state.playState === "paused" ? icons.play : icons.pause} />
|
|
|
+ <img style={{ marginTop: "-1px" }} class={styles.iconBtn} src={state.playState === "paused" ? icons.play : icons.pause} />
|
|
|
<Circle class={styles.progress} stroke-width={80} currentRate={state.playProgress} rate={100} layerColor="#01C1B5" color="#FFC830" />
|
|
|
</div>
|
|
|
<span>{state.playState === "play" ? "暂停" : "播放"}</span>
|
|
@@ -55,7 +60,7 @@ export default defineComponent({
|
|
|
state.playSource = state.playSource === "music" ? "background" : "music";
|
|
|
}}
|
|
|
>
|
|
|
- <img class={styles.iconBtn} src={state.playSource === "music" ? icons.music : icons.background } />
|
|
|
+ <img class={styles.iconBtn} src={state.playSource === "music" ? icons.music : icons.background} />
|
|
|
<span>{state.playSource === "music" ? "原声" : "伴奏"}</span>
|
|
|
</div>
|
|
|
<div
|
|
@@ -71,7 +76,7 @@ export default defineComponent({
|
|
|
class={styles.btn}
|
|
|
onClick={async () => {
|
|
|
metronomeData.disable = !metronomeData.disable;
|
|
|
- metronomeData.metro?.initPlayer()
|
|
|
+ metronomeData.metro?.initPlayer();
|
|
|
}}
|
|
|
>
|
|
|
<img style={{ display: metronomeData.disable ? "block" : "none" }} class={styles.iconBtn} src={headImg("tickoff.png")} />
|
|
@@ -90,7 +95,7 @@ export default defineComponent({
|
|
|
id="tips-step-8"
|
|
|
class={[styles.btn, disabledList.includes(state.modeType) && styles.disable]}
|
|
|
onClick={(e: Event) => {
|
|
|
- e.stopPropagation()
|
|
|
+ e.stopPropagation();
|
|
|
headData.speedShow = !headData.speedShow;
|
|
|
}}
|
|
|
>
|
|
@@ -103,11 +108,15 @@ export default defineComponent({
|
|
|
default: () => <Speed />,
|
|
|
}}
|
|
|
</Popover>
|
|
|
- <div class={[styles.btn, disabledList.includes(state.modeType) && styles.disable]}>
|
|
|
+ <div class={[styles.btn, disabledList.includes(state.modeType) && styles.disable]} onClick={() => (headerData.settingMode = true)}>
|
|
|
<img class={styles.iconBtn} src={headImg("menu.svg")} />
|
|
|
<span>设置</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <Popup teleport="body" closeOnClickOverlay={false} defaultStyle={false} v-model:show={headerData.settingMode}>
|
|
|
+ <Settting onClose={() => headerData.settingMode = false} />
|
|
|
+ </Popup>
|
|
|
</div>
|
|
|
);
|
|
|
},
|