|
@@ -10,7 +10,7 @@ import {
|
|
} from 'vue';
|
|
} from 'vue';
|
|
import styles from './index.module.less';
|
|
import styles from './index.module.less';
|
|
import MSearch from '@/components/m-search';
|
|
import MSearch from '@/components/m-search';
|
|
-import icon_play from '@/common/images/icon_play.svg';
|
|
|
|
|
|
+// import icon_play from '@/common/images/icon_play.svg';
|
|
import {
|
|
import {
|
|
Empty,
|
|
Empty,
|
|
Icon,
|
|
Icon,
|
|
@@ -24,7 +24,7 @@ import {
|
|
} from 'vant';
|
|
} from 'vant';
|
|
import icon_back from './image/icon_back.svg';
|
|
import icon_back from './image/icon_back.svg';
|
|
import icon_down from '@/common/images/icon_down.svg';
|
|
import icon_down from '@/common/images/icon_down.svg';
|
|
-import icon_jianpu from '@/common/images/icon_jianpu.svg';
|
|
|
|
|
|
+// import icon_jianpu from '@/common/images/icon_jianpu.svg';
|
|
import icon_jianpuActive from '@/common/images/icon_jianpuActive.svg';
|
|
import icon_jianpuActive from '@/common/images/icon_jianpuActive.svg';
|
|
import icons from '@/common/images/index.json';
|
|
import icons from '@/common/images/index.json';
|
|
import {
|
|
import {
|
|
@@ -33,16 +33,18 @@ import {
|
|
promisefiyPostMessage
|
|
promisefiyPostMessage
|
|
} from '@/helpers/native-message';
|
|
} from '@/helpers/native-message';
|
|
import html2canvas from 'html2canvas';
|
|
import html2canvas from 'html2canvas';
|
|
-import { api_musicSheetCategoriesPage, api_musicSheetPage } from './api';
|
|
|
|
|
|
+import {
|
|
|
|
+ api_musicSheetCategoriesPage,
|
|
|
|
+ api_musicSheetPage,
|
|
|
|
+ api_subjectList
|
|
|
|
+} from './api';
|
|
import { state } from '@/state';
|
|
import { state } from '@/state';
|
|
import MEmpty from '@/components/m-empty';
|
|
import MEmpty from '@/components/m-empty';
|
|
import Coaiguide from '@/custom-plugins/guide-page/coai-guide';
|
|
import Coaiguide from '@/custom-plugins/guide-page/coai-guide';
|
|
-import { usePageVisibility } from '@vant/use';
|
|
|
|
import TheVip from '@/components/the-vip';
|
|
import TheVip from '@/components/the-vip';
|
|
import request from '@/helpers/request';
|
|
import request from '@/helpers/request';
|
|
import { useRoute } from 'vue-router';
|
|
import { useRoute } from 'vue-router';
|
|
import { addWatermark, convasToImg, imgToCanvas } from './imageFunction';
|
|
import { addWatermark, convasToImg, imgToCanvas } from './imageFunction';
|
|
-import { browser } from '@/helpers/utils';
|
|
|
|
import ChangeVoice from './change-voice';
|
|
import ChangeVoice from './change-voice';
|
|
import { storage } from '@/helpers/storage';
|
|
import { storage } from '@/helpers/storage';
|
|
import { ACCESS_TOKEN } from '@/store/mutation-types';
|
|
import { ACCESS_TOKEN } from '@/store/mutation-types';
|
|
@@ -61,7 +63,8 @@ export default defineComponent({
|
|
rows: 20,
|
|
rows: 20,
|
|
status: 1,
|
|
status: 1,
|
|
keyword: '', // 关键词
|
|
keyword: '', // 关键词
|
|
- musicSheetCategoriesId: route.query.id as any
|
|
|
|
|
|
+ musicSheetCategoriesId: route.query.id as any,
|
|
|
|
+ musicalInstrumentId: ''
|
|
});
|
|
});
|
|
const data = reactive({
|
|
const data = reactive({
|
|
musicSheetCategoriesName: route.query.name as any,
|
|
musicSheetCategoriesName: route.query.name as any,
|
|
@@ -92,7 +95,10 @@ export default defineComponent({
|
|
height: ''
|
|
height: ''
|
|
},
|
|
},
|
|
showVip: false,
|
|
showVip: false,
|
|
- vipMember: state.user.data?.vipMember
|
|
|
|
|
|
+ vipMember: state.user.data?.vipMember,
|
|
|
|
+ subjectStatus: false,
|
|
|
|
+ subjectList: [],
|
|
|
|
+ subjectItem: {} as any // 当前乐器
|
|
});
|
|
});
|
|
const downRef = ref();
|
|
const downRef = ref();
|
|
const showGuide = ref(false);
|
|
const showGuide = ref(false);
|
|
@@ -232,7 +238,8 @@ export default defineComponent({
|
|
data.loading = true;
|
|
data.loading = true;
|
|
try {
|
|
try {
|
|
const res = await api_musicSheetPage({
|
|
const res = await api_musicSheetPage({
|
|
- ...musicForms
|
|
|
|
|
|
+ ...musicForms,
|
|
|
|
+ musicalInstrumentId: data.subjectItem.value || null
|
|
});
|
|
});
|
|
if (res.code === 200 && Array.isArray(res?.data?.rows)) {
|
|
if (res.code === 200 && Array.isArray(res?.data?.rows)) {
|
|
data.musics = [...data.musics, ...res.data.rows];
|
|
data.musics = [...data.musics, ...res.data.rows];
|
|
@@ -286,6 +293,45 @@ export default defineComponent({
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ const getSubjecList = async () => {
|
|
|
|
+ try {
|
|
|
|
+ let subjectIds = state.user.data?.subjectId || '';
|
|
|
|
+ subjectIds = subjectIds.split(',');
|
|
|
|
+ const subjectId = subjectIds[0] || '';
|
|
|
|
+ const res = await api_subjectList({
|
|
|
|
+ enableFlag: true,
|
|
|
|
+ delFlag: 0,
|
|
|
|
+ page: 1,
|
|
|
|
+ subjectId: subjectId || '',
|
|
|
|
+ rows: 999
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (subjectId) {
|
|
|
|
+ const result = res.data || [];
|
|
|
|
+ let tempSubjects: any = [];
|
|
|
|
+ result.forEach((item: any) => {
|
|
|
|
+ const instruments = item.instruments || [];
|
|
|
|
+ if (Number(subjectId) === item.id && instruments.length > 0) {
|
|
|
|
+ instruments.forEach((child: any, index: number) => {
|
|
|
|
+ tempSubjects.push({
|
|
|
|
+ text: child.name,
|
|
|
|
+ value: child.id,
|
|
|
|
+ className: index === 0 ? 'selected' : ''
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ data.subjectList = tempSubjects;
|
|
|
|
+ if (tempSubjects.length > 0) {
|
|
|
|
+ data.subjectItem = tempSubjects[0];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } catch {
|
|
|
|
+ //
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
// 安卓的状态栏
|
|
// 安卓的状态栏
|
|
postMessage({
|
|
postMessage({
|
|
@@ -294,7 +340,7 @@ export default defineComponent({
|
|
isVisibility: 0
|
|
isVisibility: 0
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+ await getSubjecList();
|
|
await getMusicSheetCategories();
|
|
await getMusicSheetCategories();
|
|
await getMusicList();
|
|
await getMusicList();
|
|
|
|
|
|
@@ -304,7 +350,7 @@ export default defineComponent({
|
|
}
|
|
}
|
|
});
|
|
});
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
- obv.observe(spinRef.value);
|
|
|
|
|
|
+ spinRef.value && obv.observe(spinRef.value);
|
|
});
|
|
});
|
|
|
|
|
|
const getUserInfo = async () => {
|
|
const getUserInfo = async () => {
|
|
@@ -364,34 +410,6 @@ export default defineComponent({
|
|
<div class={styles.content}>
|
|
<div class={styles.content}>
|
|
<div class={[styles.leftContent]}>
|
|
<div class={[styles.leftContent]}>
|
|
<div class={styles.leftBg2}></div>
|
|
<div class={styles.leftBg2}></div>
|
|
- {/* <div class={styles.leftBg}></div> */}
|
|
|
|
- {/* <div class={styles.types}>
|
|
|
|
- {data.types.map((item, index) => {
|
|
|
|
- return (
|
|
|
|
- <div
|
|
|
|
- class={[
|
|
|
|
- styles.type,
|
|
|
|
- musicForms.musicSheetCategoriesId === item.id &&
|
|
|
|
- styles.typeActive
|
|
|
|
- ]}
|
|
|
|
- onClick={() => {
|
|
|
|
- musicForms.musicSheetCategoriesId = item.id;
|
|
|
|
- handleReset();
|
|
|
|
- }}>
|
|
|
|
- <div class={styles.typeImg}>
|
|
|
|
- <img
|
|
|
|
- class={styles.typeIcon}
|
|
|
|
- src={item.coverImg}
|
|
|
|
- onLoad={(e: Event) => {
|
|
|
|
- const el = e.target as HTMLImageElement;
|
|
|
|
- el.setAttribute('loaded', 'true');
|
|
|
|
- }}
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- );
|
|
|
|
- })}
|
|
|
|
- </div> */}
|
|
|
|
<div class={styles.center}>
|
|
<div class={styles.center}>
|
|
<div class={styles.centerSearch}>
|
|
<div class={styles.centerSearch}>
|
|
<div id="coai-0">
|
|
<div id="coai-0">
|
|
@@ -401,7 +419,7 @@ export default defineComponent({
|
|
data.searchNoticeShow ? styles.searchNoticeShow : ''
|
|
data.searchNoticeShow ? styles.searchNoticeShow : ''
|
|
]}
|
|
]}
|
|
shape="round"
|
|
shape="round"
|
|
- background="transparent"
|
|
|
|
|
|
+ // background="transparent"
|
|
clearable={false}
|
|
clearable={false}
|
|
placeholder="请输入关键字"
|
|
placeholder="请输入关键字"
|
|
modelValue={musicForms.keyword}
|
|
modelValue={musicForms.keyword}
|
|
@@ -419,8 +437,43 @@ export default defineComponent({
|
|
onSearch={val => {
|
|
onSearch={val => {
|
|
musicForms.keyword = val;
|
|
musicForms.keyword = val;
|
|
handleReset();
|
|
handleReset();
|
|
|
|
+ }}>
|
|
|
|
+ {{
|
|
|
|
+ left: () =>
|
|
|
|
+ data.subjectItem.value &&
|
|
|
|
+ data.subjectList.length > 1 && (
|
|
|
|
+ <div class={styles.subjects}>
|
|
|
|
+ <Popover
|
|
|
|
+ v-model:show={data.subjectStatus}
|
|
|
|
+ offset={[0, 18]}
|
|
|
|
+ actions={data.subjectList}
|
|
|
|
+ placement="bottom-start"
|
|
|
|
+ onSelect={(item: any) => {
|
|
|
|
+ data.subjectList.forEach((c: any) => {
|
|
|
|
+ c.className = '';
|
|
|
|
+ });
|
|
|
|
+ data.subjectItem = {
|
|
|
|
+ ...item,
|
|
|
|
+ className: 'selected'
|
|
|
|
+ };
|
|
|
|
+ handleReset();
|
|
|
|
+ }}>
|
|
|
|
+ {{
|
|
|
|
+ reference: () => (
|
|
|
|
+ <div
|
|
|
|
+ class={[
|
|
|
|
+ styles.subjectName,
|
|
|
|
+ data.subjectStatus && styles.active
|
|
|
|
+ ]}>
|
|
|
|
+ <span>{data.subjectItem.text}</span> <i></i>
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }}
|
|
|
|
+ </Popover>
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
}}
|
|
}}
|
|
- />
|
|
|
|
|
|
+ </MSearch>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class={styles.musicContent}>
|
|
<div class={styles.musicContent}>
|