|
@@ -16,7 +16,12 @@ import j1 from './images/music/j-1.png';
|
|
|
// import j2 from './images/music/j-2.png';
|
|
|
import { Popover, Popup, showToast } from 'vant';
|
|
|
import SettingModal from './setting-modal';
|
|
|
-import { randomScoreElement, renderScore, setting } from './setting';
|
|
|
+import {
|
|
|
+ randomScoreElement,
|
|
|
+ renderScore,
|
|
|
+ setting,
|
|
|
+ elementDirection
|
|
|
+} from './setting';
|
|
|
import { handleStartTick, hendleEndTick } from './tick';
|
|
|
import { handleStartBeat, hendleEndBeat } from './beat-tick';
|
|
|
import { browser } from '@/helpers/utils';
|
|
@@ -131,19 +136,37 @@ export default defineComponent({
|
|
|
item.length !== 1 &&
|
|
|
styles.small
|
|
|
]}>
|
|
|
- {item.map((child: any, j: number) => (
|
|
|
+ {item.map((child: any, jIndex: number) => (
|
|
|
<div
|
|
|
- class={[styles.beat, child.selected ? styles.active : '']}
|
|
|
- onClick={() => {
|
|
|
- if (setting.playState === 'play') return;
|
|
|
- if (setting.tempo.length <= 1) {
|
|
|
- showToast('无法切换,请选择至少2种节奏型');
|
|
|
- return;
|
|
|
- }
|
|
|
- const obj = randomScoreElement(child.index);
|
|
|
- child.index = obj.index;
|
|
|
- child.url = obj.url;
|
|
|
- }}>
|
|
|
+ class={[styles.beat, child.selected ? styles.active : '']}>
|
|
|
+ <div class={styles.direction}>
|
|
|
+ <div
|
|
|
+ class={styles.up}
|
|
|
+ onClick={() => {
|
|
|
+ if (setting.playState === 'play') return;
|
|
|
+ if (setting.tempo.length <= 1) {
|
|
|
+ showToast('无法切换,请选择至少2种节奏型');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // const obj = randomScoreElement(child.index);
|
|
|
+ const obj = elementDirection('up', child.index);
|
|
|
+ child.index = obj.index;
|
|
|
+ child.url = obj.url;
|
|
|
+ }}></div>
|
|
|
+ <div
|
|
|
+ class={styles.down}
|
|
|
+ onClick={() => {
|
|
|
+ if (setting.playState === 'play') return;
|
|
|
+ if (setting.tempo.length <= 1) {
|
|
|
+ showToast('无法切换,请选择至少2种节奏型');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // const obj = randomScoreElement(child.index);
|
|
|
+ const obj = elementDirection('down', child.index);
|
|
|
+ child.index = obj.index;
|
|
|
+ child.url = obj.url;
|
|
|
+ }}></div>
|
|
|
+ </div>
|
|
|
<div class={styles.imgSection}>
|
|
|
<img src={getImage(child.url)} />
|
|
|
</div>
|