|  | @@ -10,7 +10,7 @@ import {
 | 
	
		
			
				|  |  |  } from 'vue';
 | 
	
		
			
				|  |  |  import styles from './index.module.less';
 | 
	
		
			
				|  |  |  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 {
 | 
	
		
			
				|  |  |    Empty,
 | 
	
		
			
				|  |  |    Icon,
 | 
	
	
		
			
				|  | @@ -24,7 +24,7 @@ import {
 | 
	
		
			
				|  |  |  } from 'vant';
 | 
	
		
			
				|  |  |  import icon_back from './image/icon_back.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 icons from '@/common/images/index.json';
 | 
	
		
			
				|  |  |  import {
 | 
	
	
		
			
				|  | @@ -33,16 +33,18 @@ import {
 | 
	
		
			
				|  |  |    promisefiyPostMessage
 | 
	
		
			
				|  |  |  } from '@/helpers/native-message';
 | 
	
		
			
				|  |  |  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 MEmpty from '@/components/m-empty';
 | 
	
		
			
				|  |  |  import Coaiguide from '@/custom-plugins/guide-page/coai-guide';
 | 
	
		
			
				|  |  | -import { usePageVisibility } from '@vant/use';
 | 
	
		
			
				|  |  |  import TheVip from '@/components/the-vip';
 | 
	
		
			
				|  |  |  import request from '@/helpers/request';
 | 
	
		
			
				|  |  |  import { useRoute } from 'vue-router';
 | 
	
		
			
				|  |  |  import { addWatermark, convasToImg, imgToCanvas } from './imageFunction';
 | 
	
		
			
				|  |  | -import { browser } from '@/helpers/utils';
 | 
	
		
			
				|  |  |  import ChangeVoice from './change-voice';
 | 
	
		
			
				|  |  |  import { storage } from '@/helpers/storage';
 | 
	
		
			
				|  |  |  import { ACCESS_TOKEN } from '@/store/mutation-types';
 | 
	
	
		
			
				|  | @@ -61,7 +63,8 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        rows: 20,
 | 
	
		
			
				|  |  |        status: 1,
 | 
	
		
			
				|  |  |        keyword: '', // 关键词
 | 
	
		
			
				|  |  | -      musicSheetCategoriesId: route.query.id as any
 | 
	
		
			
				|  |  | +      musicSheetCategoriesId: route.query.id as any,
 | 
	
		
			
				|  |  | +      musicalInstrumentId: ''
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |      const data = reactive({
 | 
	
		
			
				|  |  |        musicSheetCategoriesName: route.query.name as any,
 | 
	
	
		
			
				|  | @@ -92,7 +95,10 @@ export default defineComponent({
 | 
	
		
			
				|  |  |          height: ''
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        showVip: false,
 | 
	
		
			
				|  |  | -      vipMember: state.user.data?.vipMember
 | 
	
		
			
				|  |  | +      vipMember: state.user.data?.vipMember,
 | 
	
		
			
				|  |  | +      subjectStatus: false,
 | 
	
		
			
				|  |  | +      subjectList: [],
 | 
	
		
			
				|  |  | +      subjectItem: {} as any // 当前乐器
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |      const downRef = ref();
 | 
	
		
			
				|  |  |      const showGuide = ref(false);
 | 
	
	
		
			
				|  | @@ -232,7 +238,8 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        data.loading = true;
 | 
	
		
			
				|  |  |        try {
 | 
	
		
			
				|  |  |          const res = await api_musicSheetPage({
 | 
	
		
			
				|  |  | -          ...musicForms
 | 
	
		
			
				|  |  | +          ...musicForms,
 | 
	
		
			
				|  |  | +          musicalInstrumentId: data.subjectItem.value || null
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  |          if (res.code === 200 && Array.isArray(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 () => {
 | 
	
		
			
				|  |  |        // 安卓的状态栏
 | 
	
		
			
				|  |  |        postMessage({
 | 
	
	
		
			
				|  | @@ -294,7 +340,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |            isVisibility: 0
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +      await getSubjecList();
 | 
	
		
			
				|  |  |        await getMusicSheetCategories();
 | 
	
		
			
				|  |  |        await getMusicList();
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -304,7 +350,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |        nextTick(() => {
 | 
	
		
			
				|  |  | -        obv.observe(spinRef.value);
 | 
	
		
			
				|  |  | +        spinRef.value && obv.observe(spinRef.value);
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |        const getUserInfo = async () => {
 | 
	
	
		
			
				|  | @@ -364,34 +410,6 @@ export default defineComponent({
 | 
	
		
			
				|  |  |          <div class={styles.content}>
 | 
	
		
			
				|  |  |            <div class={[styles.leftContent]}>
 | 
	
		
			
				|  |  |              <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.centerSearch}>
 | 
	
		
			
				|  |  |                  <div id="coai-0">
 | 
	
	
		
			
				|  | @@ -401,7 +419,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |                        data.searchNoticeShow ? styles.searchNoticeShow : ''
 | 
	
		
			
				|  |  |                      ]}
 | 
	
		
			
				|  |  |                      shape="round"
 | 
	
		
			
				|  |  | -                    background="transparent"
 | 
	
		
			
				|  |  | +                    // background="transparent"
 | 
	
		
			
				|  |  |                      clearable={false}
 | 
	
		
			
				|  |  |                      placeholder="请输入关键字"
 | 
	
		
			
				|  |  |                      modelValue={musicForms.keyword}
 | 
	
	
		
			
				|  | @@ -419,8 +437,43 @@ export default defineComponent({
 | 
	
		
			
				|  |  |                      onSearch={val => {
 | 
	
		
			
				|  |  |                        musicForms.keyword = val;
 | 
	
		
			
				|  |  |                        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 class={styles.musicContent}>
 |