index.tsx 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  1. import {
  2. computed,
  3. defineComponent,
  4. nextTick,
  5. onMounted,
  6. onUnmounted,
  7. reactive,
  8. ref,
  9. Teleport,
  10. toRefs,
  11. watch
  12. } from 'vue';
  13. import styles from './index.module.less';
  14. import { browser, vaildMusicScoreUrl } from '@/helpers/utils';
  15. import MSticky from '@/components/m-sticky';
  16. import MHeader from '@/components/m-header';
  17. import { useRoute, useRouter } from 'vue-router';
  18. import MSearch from '@/components/m-search';
  19. import { Cell, Icon, Image, List, Popup, Tab, Tabs } from 'vant';
  20. import iconPlayer from './images/icon-player.png';
  21. import iconFire from './images/icon-fire.png';
  22. import iconTitleArrow from './images/icon-title-arrow.png';
  23. import { api_musicSheetPage } from '../co-ai/api';
  24. import { state as baseState } from '@/state';
  25. import request from '@/helpers/request';
  26. import MEmpty from '@/components/m-empty';
  27. import { listenerMessage, postMessage } from '@/helpers/native-message';
  28. import { audioPlayType } from '@/helpers/constant';
  29. import MusicDetail from './music-detail';
  30. import TheVip from '@/components/the-vip';
  31. import { useEventListener } from '@vueuse/core';
  32. const ChildNodeSearch = defineComponent({
  33. name: 'ChildNodeSearch',
  34. props: {
  35. activeRow: {
  36. type: Object,
  37. default: () => ({})
  38. },
  39. list: {
  40. type: Array,
  41. default: () => []
  42. }
  43. },
  44. emits: ['selectChildTag'],
  45. setup(props, { emit }) {
  46. const { activeRow } = toRefs(props);
  47. const selectItem = ref({});
  48. watch(
  49. () => props.activeRow,
  50. () => {
  51. activeRow.value = props.activeRow;
  52. selectItem.value = {};
  53. }
  54. );
  55. return () => (
  56. <>
  57. {activeRow.value?.id && (
  58. <>
  59. <div class={styles.title}>{activeRow.value.columnName}</div>
  60. <div class={[styles.subjectContainer]}>
  61. {activeRow.value?.children.map((subject: any) => (
  62. <div
  63. class={[
  64. styles.subjectItem,
  65. styles.subjectItem4,
  66. (activeRow.value.activeIndex || '') == subject.id &&
  67. styles.active
  68. ]}
  69. onClick={() => {
  70. activeRow.value.activeIndex = subject.id;
  71. let children: any;
  72. let columnName = '';
  73. if (subject.children) {
  74. children = [
  75. {
  76. columnName: subject.children[0].columnName,
  77. name: '全部',
  78. id: ''
  79. },
  80. ...subject.children
  81. ];
  82. columnName = subject.children[0].columnName;
  83. selectItem.value = {
  84. ...subject,
  85. columnName,
  86. activeIndex: '',
  87. children
  88. };
  89. } else {
  90. selectItem.value = {};
  91. }
  92. emit('selectChildTag', activeRow.value.activeIndex);
  93. }}>
  94. {subject.name}
  95. </div>
  96. ))}
  97. </div>
  98. <ChildNodeSearch
  99. activeRow={selectItem.value}
  100. onSelectChildTag={(item: any) => {
  101. emit('selectChildTag', item || activeRow.value.activeIndex);
  102. }}
  103. />
  104. </>
  105. )}
  106. </>
  107. );
  108. }
  109. });
  110. export default defineComponent({
  111. name: 'hot-music-more',
  112. setup() {
  113. const router = useRouter();
  114. const route = useRoute();
  115. const state = reactive({
  116. background: 'transparent',
  117. loading: false,
  118. finished: false,
  119. isAllStatus: true, // 当前是否已经为全部了
  120. searchPopup: false,
  121. musicDetailPopup: false,
  122. showVip: false,
  123. vipMember: baseState.user.data.vipMember,
  124. tabActive: '' as any,
  125. instrumentCodes: {} as any, // 所有的乐器code 对应的名称
  126. newTags: [] as any,
  127. isTagExpand: false,
  128. musics: [] as any,
  129. types: [] as any,
  130. subjectList: [] as any,
  131. audioPlayTypeList: [] as any, // 场景
  132. sNt: '' as any, // 标签
  133. sAPT: '', // 场景
  134. item: {} as any,
  135. allSearch: {
  136. name: '',
  137. musicTagIds: '' as any,
  138. audioPlayTypes: [] as any,
  139. bookVersionId: null as any,
  140. musicalInstrumentId: ''
  141. },
  142. hotSearch: {
  143. name: ''
  144. },
  145. newSearch: {
  146. name: ''
  147. },
  148. recommendSearch: {
  149. name: ''
  150. }
  151. });
  152. const tabsRef = ref();
  153. const musicForms = reactive({
  154. page: 1,
  155. rows: 20,
  156. status: 1,
  157. sortType: 2, // 默认热度排序
  158. keyword: '' // 关键词
  159. });
  160. const data = reactive({
  161. selectParents: {}, // 选中的数据
  162. tags: [] as any[],
  163. tagActiveId: '' as any,
  164. tagActive: {} as any,
  165. childSelectId: null as any
  166. });
  167. const contentRef = ref();
  168. const searchValue = computed(() => {
  169. if (state.tabActive === 'RECOMMEND') {
  170. return state.recommendSearch.name;
  171. } else if (state.tabActive === 'HOT') {
  172. return state.hotSearch.name;
  173. } else if (state.tabActive === 'NEW') {
  174. return state.newSearch.name;
  175. } else {
  176. return state.allSearch.name;
  177. }
  178. });
  179. let isClick = false;
  180. const getMusicList = async () => {
  181. if (isClick) return;
  182. isClick = true;
  183. state.loading = true;
  184. try {
  185. const { ...result } = musicForms;
  186. let params = {
  187. ...result,
  188. searchType: state.tabActive
  189. } as any;
  190. if (state.tabActive === 'RECOMMEND') {
  191. params = Object.assign(params, state.recommendSearch);
  192. params.page = 1;
  193. params.rows = 60;
  194. } else if (state.tabActive === 'HOT') {
  195. params = Object.assign(params, state.hotSearch);
  196. params.page = 1;
  197. params.rows = 60;
  198. } else if (state.tabActive === 'NEW') {
  199. params = Object.assign(params, state.newSearch);
  200. params.page = 1;
  201. params.rows = 60;
  202. } else {
  203. params.name = state.allSearch.name;
  204. params = Object.assign(params, state.allSearch);
  205. }
  206. const res = await api_musicSheetPage(params);
  207. if (res.code === 200 && Array.isArray(res?.data?.rows)) {
  208. const result = res.data.rows || [];
  209. result.forEach((item: any) => {
  210. item.audioPlayTypeArray = item.audioPlayTypes
  211. ? item.audioPlayTypes.split(',')
  212. : [];
  213. });
  214. state.musics = [...state.musics, ...res.data.rows];
  215. state.finished = !res.data.next;
  216. musicForms.page = res.data.current + 1;
  217. // state.listState.dataShow = state.list.length > 0;
  218. } else {
  219. state.finished = true;
  220. }
  221. } catch (error) {
  222. // console.log('🚀 ~ error:', error);
  223. state.finished = true;
  224. }
  225. state.loading = false;
  226. isClick = false;
  227. };
  228. const getTags = async () => {
  229. try {
  230. const res = await request.get('/edu-app/musicSheetTag/queryList');
  231. const result = res.data || [];
  232. state.newTags = [
  233. {
  234. name: '全部',
  235. id: ''
  236. },
  237. ...result.map((item: any) => {
  238. return {
  239. name: item.name,
  240. id: item.id
  241. };
  242. })
  243. ];
  244. } catch {
  245. //
  246. }
  247. };
  248. const formatParentId = (id: any, list: any, ids = [] as any) => {
  249. for (const item of list) {
  250. if (item.children && item.children.length > 0) {
  251. const cIds: any = formatParentId(id, item.children, [
  252. ...ids,
  253. item.id
  254. ]);
  255. if (cIds.includes(id)) {
  256. return cIds;
  257. }
  258. }
  259. if (item.id === id) {
  260. return [...ids, id];
  261. }
  262. }
  263. return ids;
  264. };
  265. const onSearch = () => {
  266. musicForms.page = 1;
  267. state.musics = [];
  268. state.finished = false;
  269. getMusicList();
  270. };
  271. const onReset = () => {
  272. state.sNt = '';
  273. state.sAPT = '';
  274. data.tagActiveId = '';
  275. data.childSelectId = null;
  276. data.selectParents = {};
  277. // state.allSearch.bookVersionId = data.childSelectId || data.tagActiveId;
  278. // state.allSearch.audioPlayTypes = state.sAPT
  279. // ? state.sAPT === 'PLAY_SING'
  280. // ? ['SING', 'PLAY']
  281. // : [state.sAPT]
  282. // : [];
  283. // state.allSearch.musicTagIds = state.sNt;
  284. // state.searchPopup = false;
  285. // onSearch();
  286. };
  287. const onDetail = (item: any) => {
  288. state.item = item;
  289. state.musicDetailPopup = true;
  290. };
  291. const getMusicTagTree = async () => {
  292. try {
  293. const res = await request.get('/edu-app/musicTag/tree');
  294. const result = res.data || [];
  295. // 去掉上下册
  296. result.forEach((item: any) => {
  297. if (item.children && item.children.length > 0) {
  298. const child = item.children;
  299. child?.forEach((c: any) => {
  300. c.children = null;
  301. });
  302. }
  303. });
  304. data.tags = [
  305. {
  306. columnName: result[0].columnName,
  307. name: '全部',
  308. id: ''
  309. },
  310. ...result
  311. ];
  312. data.tagActiveId = data.tags[0].id;
  313. } catch {
  314. //
  315. }
  316. };
  317. const changeTag = (item: any, activeIndex?: any) => {
  318. data.tagActiveId = item.id;
  319. data.childSelectId = activeIndex;
  320. let children: any;
  321. let columnName = '';
  322. if (item.children) {
  323. children = [
  324. {
  325. columnName: item.children[0].columnName,
  326. name: '全部',
  327. id: ''
  328. },
  329. ...item.children
  330. ];
  331. columnName = item.children[0].columnName;
  332. data.selectParents = {
  333. ...item,
  334. columnName,
  335. activeIndex: activeIndex || '',
  336. children
  337. };
  338. } else {
  339. data.selectParents = {};
  340. }
  341. };
  342. const formatUsedNum = (num: number) => {
  343. if (num < 10000) {
  344. return num;
  345. } else {
  346. const n = num / 10000;
  347. return Number(n.toFixed(1)) + '万';
  348. }
  349. };
  350. // 判断是否有数据
  351. // const isSearch = computed(() => {
  352. // return data.tags.length > 0 ? true : false;
  353. // });
  354. const handleGoto = (
  355. item: any,
  356. showMusicImg: string,
  357. selectMusicInstrumentIndex: number
  358. ) => {
  359. if (!state.vipMember && item?.paymentType === 'VIP') {
  360. state.showVip = true;
  361. return;
  362. }
  363. // 默认进页面显示对应的曲谱
  364. let lineType = 'staff';
  365. if (showMusicImg === 'first') {
  366. lineType = 'firstTone';
  367. } else if (showMusicImg === 'fixed') {
  368. lineType = 'fixedTone';
  369. } else if (showMusicImg === 'staff') {
  370. lineType = 'staff';
  371. }
  372. let src = `${vaildMusicScoreUrl()}/instrument/?id=${
  373. item?.id
  374. }&musicRenderType=${lineType}&showGuide=true&part-index=${selectMusicInstrumentIndex}`;
  375. postMessage({
  376. api: 'openAccompanyWebView',
  377. content: {
  378. url: src,
  379. orientation: 0,
  380. isHideTitle: true,
  381. statusBarTextColor: false,
  382. isOpenLight: true,
  383. c_orientation: 0 // 0 横屏 1 竖屏
  384. }
  385. });
  386. };
  387. const getUserInfo = async () => {
  388. const res = await request.get('/edu-app/user/getUserInfo', {
  389. initRequest: true, // 初始化接口
  390. requestType: 'form',
  391. hideLoading: true
  392. });
  393. if (res?.code === 200) {
  394. state.vipMember = res.data.vipMember;
  395. }
  396. };
  397. /**
  398. * 获取所有曲目code
  399. */
  400. const getInstrumentCode = async () => {
  401. try {
  402. const { data } = await request.get('/edu-app/musicSheet/instrumentCode');
  403. const result = data || [];
  404. const tempCodes: any = {}
  405. result.forEach((item: any) => {
  406. const codes = item.code?.split(',');
  407. codes.forEach((code: any) => {
  408. tempCodes[code] = item.name;
  409. });
  410. });
  411. state.instrumentCodes = tempCodes;
  412. } catch {
  413. //
  414. }
  415. }
  416. const tabResize = () => {
  417. tabsRef.value?.resize();
  418. };
  419. onMounted(async () => {
  420. getInstrumentCode()
  421. if (route.query.type) {
  422. state.tabActive = route.query.type;
  423. state.isAllStatus = false;
  424. }
  425. // tabsRef
  426. // 场景
  427. const tempAudio = Object.keys(audioPlayType).map(key => {
  428. return {
  429. id: key,
  430. name: audioPlayType[key]
  431. };
  432. });
  433. state.audioPlayTypeList = [{ name: '全部', id: '' }, ...tempAudio];
  434. state.loading = true;
  435. getUserInfo();
  436. await getTags();
  437. await getMusicTagTree();
  438. getMusicList();
  439. window.addEventListener('resize', tabResize);
  440. listenerMessage('webViewOnResume', () => {
  441. tabResize();
  442. });
  443. });
  444. onUnmounted(() => {
  445. window.removeEventListener('resize', tabResize);
  446. });
  447. return () => (
  448. <div
  449. class={[
  450. styles.hotMusicMore,
  451. browser().isTablet ? styles.hotMusicMoreTablet : ''
  452. ]}>
  453. <MSticky position="top">
  454. <MHeader border={false} background={'transparent'}>
  455. {{
  456. content: () => (
  457. <div class={styles.woringHeader}>
  458. <i
  459. onClick={() => {
  460. if (browser().isApp) {
  461. postMessage({
  462. api: 'back'
  463. });
  464. } else {
  465. router.back();
  466. }
  467. }}
  468. class={[
  469. 'van-badge__wrapper van-icon van-icon-arrow-left van-nav-bar__arrow',
  470. styles.leftArrow
  471. ]}></i>
  472. <Tabs
  473. ref={tabsRef}
  474. class={styles.tabSection}
  475. v-model:active={state.tabActive}
  476. shrink
  477. onClickTab={(val) => {
  478. if (state.tabActive === '') {
  479. if (state.isAllStatus) {
  480. state.searchPopup = !state.searchPopup;
  481. if (state.searchPopup) {
  482. const allSearch = state.allSearch;
  483. if (allSearch.audioPlayTypes.length > 0) {
  484. if (allSearch.audioPlayTypes.length == 1) {
  485. state.sAPT = allSearch.audioPlayTypes.join(',');
  486. } else {
  487. state.sAPT = 'PLAY_SING';
  488. }
  489. } else {
  490. state.sAPT = '';
  491. }
  492. state.sNt = allSearch.musicTagIds;
  493. if (allSearch.bookVersionId) {
  494. let ids: any = [];
  495. data.tags.forEach((item: any) => {
  496. if (item.id === allSearch.bookVersionId) {
  497. ids.push(item.id);
  498. }
  499. });
  500. if (ids.length <= 0) {
  501. ids = formatParentId(
  502. allSearch.bookVersionId,
  503. data.tags
  504. );
  505. }
  506. // console.log(ids, 'ids', allSearch.bookVersionId)
  507. data.tagActiveId = ids[0];
  508. if (data.tagActiveId) {
  509. const item = data.tags.find(
  510. item => item.id === ids[0]
  511. );
  512. if (item) changeTag(item, ids[1]);
  513. }
  514. } else {
  515. data.tagActiveId = '';
  516. data.childSelectId = null;
  517. data.selectParents = {};
  518. }
  519. }
  520. } else {
  521. state.isAllStatus = true;
  522. onSearch();
  523. }
  524. } else {
  525. state.searchPopup = false;
  526. state.isAllStatus = false;
  527. onSearch();
  528. }
  529. }}>
  530. <Tab name="">
  531. {{
  532. title: () => (
  533. <div class={styles.moreIcon}>
  534. <span>全部</span>
  535. <img
  536. src={iconTitleArrow}
  537. class={[
  538. styles.iconArrow,
  539. state.searchPopup && styles.iconArrowActive
  540. ]}
  541. />
  542. </div>
  543. )
  544. }}
  545. </Tab>
  546. {/* 推荐 - 由于Android 在华为平台审核的原因 */}
  547. <Tab name="RECOMMEND" title="精选"></Tab>
  548. <Tab name="HOT" title="热门"></Tab>
  549. <Tab name="NEW" title="最新"></Tab>
  550. </Tabs>
  551. </div>
  552. )
  553. }}
  554. </MHeader>
  555. <MSearch
  556. v-model:modelValue={searchValue.value}
  557. background={'transparent'}
  558. inputBackground="transparent"
  559. class={styles.mSearch11}
  560. onFocus={() => {
  561. state.searchPopup = false;
  562. }}
  563. onSearch={(val: any) => {
  564. if (state.tabActive === 'RECOMMEND') {
  565. state.recommendSearch.name = val;
  566. } else if (state.tabActive === 'HOT') {
  567. state.hotSearch.name = val;
  568. } else if (state.tabActive === 'NEW') {
  569. state.newSearch.name = val;
  570. } else {
  571. state.allSearch.name = val;
  572. }
  573. state.searchPopup = false;
  574. onSearch();
  575. }}></MSearch>
  576. </MSticky>
  577. <div style="height: calc(100vh - var(--header-height)); overflow-x: hidden; overflow-y: auto;">
  578. <List
  579. loading={state.loading}
  580. finished={state.finished}
  581. finishedText=" "
  582. onLoad={() => {
  583. if (!state.tabActive) {
  584. getMusicList();
  585. }
  586. }}
  587. immediateCheck={false}>
  588. {state.musics.length > 0 && (
  589. <div class={styles.musicListSection}>
  590. <div class={styles.musicList}>
  591. {state.musics.map((item: any) => (
  592. <Cell
  593. class={styles.musicItem}
  594. border={false}
  595. center
  596. onClick={() => onDetail(item)}>
  597. {{
  598. icon: () => (
  599. <div class={styles.musicImg}>
  600. <i
  601. class={[
  602. styles.iconType,
  603. styles[item.paymentType]
  604. ]}></i>
  605. <Image
  606. class={styles.musicImg}
  607. src={item.titleImg}
  608. />
  609. </div>
  610. ),
  611. title: () => (
  612. <div class={styles.musicContnet}>
  613. <h2>{item.musicSheetName}</h2>
  614. <div class={styles.allStatus}>
  615. <span class={styles.hotNum}>
  616. <img src={iconFire} class={styles.iconFire} />
  617. {formatUsedNum(item.usedNum)}
  618. </span>
  619. {item.audioPlayTypes?.includes('SING') && (
  620. <span
  621. class={[
  622. styles.iconPlayType,
  623. styles.iconSing
  624. ]}>
  625. 演唱
  626. </span>
  627. )}
  628. {item.audioPlayTypes?.includes('PLAY') && (
  629. <span
  630. class={[
  631. styles.iconPlayType,
  632. styles.iconPlay
  633. ]}>
  634. 演奏
  635. </span>
  636. )}
  637. {item.composer && <p>{item.composer}</p>}
  638. </div>
  639. </div>
  640. ),
  641. 'right-icon': () => (
  642. <Image
  643. class={styles.musicPlayIcon}
  644. src={iconPlayer}
  645. />
  646. )
  647. }}
  648. </Cell>
  649. ))}
  650. </div>
  651. </div>
  652. )}
  653. {!state.loading && state.musics.length === 0 && (
  654. <div class={styles.emptyGroup}>
  655. <MEmpty description="暂无曲谱" />
  656. </div>
  657. )}
  658. </List>
  659. </div>
  660. <Teleport to={'body'}>
  661. <div class={[styles.searchBodySection]}>
  662. <Popup position="top" round v-model:show={state.searchPopup}>
  663. <div class={styles.searchContainer}>
  664. <div class={styles.changeSubjectContainer}>
  665. {state.newTags.length > 1 && (
  666. <>
  667. <div class={styles.title}>标签</div>
  668. <div class={styles.subjectContainer}>
  669. {state.newTags.map((subject: any) => (
  670. <div
  671. class={[
  672. styles.subjectItem,
  673. subject.id === state.sNt && styles.active
  674. ]}
  675. onClick={() => {
  676. state.sNt = subject.id;
  677. }}>
  678. {subject.name}
  679. </div>
  680. ))}
  681. </div>
  682. </>
  683. )}
  684. {state.audioPlayTypeList.length > 0 && (
  685. <>
  686. <div class={styles.title}>场景</div>
  687. <div class={styles.subjectContainer}>
  688. {state.audioPlayTypeList.map((subject: any) => (
  689. <div
  690. class={[
  691. styles.subjectItem,
  692. styles.subjectItem4,
  693. subject.id === state.sAPT && styles.active
  694. ]}
  695. onClick={() => {
  696. state.sAPT = subject.id;
  697. }}>
  698. {subject.name}
  699. </div>
  700. ))}
  701. </div>
  702. </>
  703. )}
  704. {data.tags.length > 0 && (
  705. <>
  706. <div class={styles.title} ref={contentRef}>
  707. {data.tags[0]?.columnName}
  708. {state.isTagExpand && (
  709. <span onClick={() => (state.isTagExpand = false)}>
  710. 收起
  711. <Icon name="arrow-up" />
  712. </span>
  713. )}
  714. </div>
  715. <div
  716. class={[
  717. styles.subjectContainer,
  718. styles.subjectContainerTwo
  719. ]}>
  720. {data.tags.map(
  721. (subject: any, index: number) =>
  722. ((!state.isTagExpand && index <= 4) ||
  723. state.isTagExpand) && (
  724. <div
  725. class={[
  726. styles.subjectItem,
  727. (subject.id || '') ===
  728. (data.tagActiveId || '') && styles.active
  729. ]}
  730. onClick={() => {
  731. changeTag(subject);
  732. }}>
  733. {subject.name}
  734. </div>
  735. )
  736. )}
  737. {!state.isTagExpand && data.tags.length > 5 && (
  738. <div
  739. class={[styles.subjectItem]}
  740. onClick={() => {
  741. state.isTagExpand = true;
  742. nextTick(() => {
  743. contentRef.value?.scrollIntoView({
  744. behavior: 'smooth',
  745. block: 'start'
  746. });
  747. });
  748. }}>
  749. 更多 <Icon name="arrow-down" />
  750. </div>
  751. )}
  752. </div>
  753. <ChildNodeSearch
  754. activeRow={data.selectParents}
  755. onSelectChildTag={(val: any) => {
  756. data.childSelectId = val;
  757. // onSearch();
  758. }}
  759. />
  760. </>
  761. )}
  762. </div>
  763. <div class={styles.searchHead}>
  764. <span class={styles.cancel} onClick={() => onReset()}>
  765. 重置
  766. </span>
  767. {/* <span>筛选</span> */}
  768. <span
  769. class={styles.confirm}
  770. onClick={() => {
  771. state.allSearch.bookVersionId =
  772. data.childSelectId || data.tagActiveId;
  773. state.allSearch.audioPlayTypes = state.sAPT
  774. ? state.sAPT === 'PLAY_SING'
  775. ? ['SING', 'PLAY']
  776. : [state.sAPT]
  777. : [];
  778. state.allSearch.musicTagIds = state.sNt;
  779. state.searchPopup = false;
  780. onSearch();
  781. }}>
  782. 确定
  783. </span>
  784. </div>
  785. </div>
  786. </Popup>
  787. </div>
  788. </Teleport>
  789. <Popup
  790. position="bottom"
  791. class={styles.popupMusicDetail}
  792. closeable
  793. round
  794. v-model:show={state.musicDetailPopup}>
  795. <MusicDetail item={state.item} instrumentCodes={state.instrumentCodes} onHandleGoto={handleGoto} />
  796. </Popup>
  797. <Popup
  798. class="popup-custom van-scale"
  799. transition="van-scale"
  800. closeOnClickOverlay={false}
  801. v-model:show={state.showVip}>
  802. <TheVip
  803. onClose={val => {
  804. if (val) {
  805. router.push('/member-center');
  806. }
  807. state.showVip = false;
  808. }}
  809. />
  810. </Popup>
  811. </div>
  812. );
  813. }
  814. });