|
@@ -0,0 +1,105 @@
|
|
|
+import { defineComponent, reactive, ref } from 'vue';
|
|
|
+import { NImage, NModal } from 'naive-ui';
|
|
|
+import styles from './index.module.less';
|
|
|
+import icon1 from '../../images/addSource/icon1.png';
|
|
|
+import icon2 from '../../images/addSource/icon2.png';
|
|
|
+import icon3 from '../../images/addSource/icon3.png';
|
|
|
+import icon4 from '../../images/addSource/icon4.png';
|
|
|
+import icon5 from '../../images/addSource/icon5.png';
|
|
|
+import icon6 from '../../images/addSource/icon6.png';
|
|
|
+import icon7 from '../../images/addSource/icon7.png';
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
+import SourceRhythm from '../source-rhythm';
|
|
|
+
|
|
|
+export default defineComponent({
|
|
|
+ name: 'add-other-source',
|
|
|
+ emits: ['close', 'comfirm'],
|
|
|
+ setup(props, { emit }) {
|
|
|
+ const router = useRouter();
|
|
|
+ const sourceList = ref([
|
|
|
+ {
|
|
|
+ image: icon1,
|
|
|
+ name: '听音练习',
|
|
|
+ index: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ image: icon2,
|
|
|
+ name: '节奏练习',
|
|
|
+ index: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ image: icon3,
|
|
|
+ name: '乐器百科',
|
|
|
+ index: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ image: icon4,
|
|
|
+ name: '名曲鉴赏',
|
|
|
+ index: 3
|
|
|
+ },
|
|
|
+ {
|
|
|
+ image: icon5,
|
|
|
+ name: '音乐家',
|
|
|
+ index: 4
|
|
|
+ },
|
|
|
+ {
|
|
|
+ image: icon6,
|
|
|
+ name: '乐理知识',
|
|
|
+ index: 5
|
|
|
+ },
|
|
|
+ {
|
|
|
+ image: icon7,
|
|
|
+ name: '制作曲谱',
|
|
|
+ index: 6
|
|
|
+ }
|
|
|
+ ]);
|
|
|
+ const state = reactive({
|
|
|
+ listenStatus: false, // 听音练习
|
|
|
+ rhythmStatus: false, //节奏
|
|
|
+ theoryStatus: false, //
|
|
|
+ musicStatus: false, //
|
|
|
+ instrumentStatus: false, //
|
|
|
+ musicianStatus: false //
|
|
|
+ });
|
|
|
+ // LISTEN:听音,RHYTHM:节奏,THEORY:乐理知识,MUSIC:曲目 INSTRUMENT:乐器 MUSICIAN:音乐家)
|
|
|
+
|
|
|
+ const onDetail = (item: any) => {
|
|
|
+ switch (item.index) {
|
|
|
+ case 1:
|
|
|
+ state.rhythmStatus = true;
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ // 直接跳转到制谱页面 (临时存储数据)
|
|
|
+ sessionStorage.setItem('notation-open-create', '1');
|
|
|
+ router.push('/notation');
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ return () => (
|
|
|
+ <>
|
|
|
+ <div class={styles.addOtherSource}>
|
|
|
+ {sourceList.value.map(source => (
|
|
|
+ <div class={styles.sourceItem} onClick={() => onDetail(source)}>
|
|
|
+ <NImage
|
|
|
+ class={styles.coverImg}
|
|
|
+ src={source.image}
|
|
|
+ previewDisabled
|
|
|
+ />
|
|
|
+ <p class={styles.name}>{source.name}</p>
|
|
|
+ </div>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ {/* 节奏练习 */}
|
|
|
+ <NModal
|
|
|
+ v-model:show={state.rhythmStatus}
|
|
|
+ preset="card"
|
|
|
+ class={['modalTitle background', styles.addOtherSourceModal]}
|
|
|
+ title={'节奏练习'}>
|
|
|
+ <SourceRhythm />
|
|
|
+ </NModal>
|
|
|
+ </>
|
|
|
+ );
|
|
|
+ }
|
|
|
+});
|