|
@@ -28,6 +28,7 @@ import { listenerMessage, postMessage } from '@/helpers/native-message';
|
|
|
import { audioPlayType } from '@/helpers/constant';
|
|
|
import MusicDetail from './music-detail';
|
|
|
import TheVip from '@/components/the-vip';
|
|
|
+import { useEventListener } from '@vueuse/core';
|
|
|
|
|
|
const ChildNodeSearch = defineComponent({
|
|
|
name: 'ChildNodeSearch',
|
|
@@ -182,6 +183,7 @@ export default defineComponent({
|
|
|
return state.allSearch.name;
|
|
|
}
|
|
|
});
|
|
|
+ const mSearchRef = ref()
|
|
|
|
|
|
let isClick = false;
|
|
|
const getMusicList = async () => {
|
|
@@ -196,14 +198,21 @@ export default defineComponent({
|
|
|
} as any;
|
|
|
if (state.tabActive === 'RECOMMEND') {
|
|
|
params = Object.assign(params, state.recommendSearch);
|
|
|
+ params.page = 1
|
|
|
+ params.rows = 60
|
|
|
} else if (state.tabActive === 'HOT') {
|
|
|
params = Object.assign(params, state.hotSearch);
|
|
|
+ params.page = 1
|
|
|
+ params.rows = 60
|
|
|
} else if (state.tabActive === 'NEW') {
|
|
|
params = Object.assign(params, state.newSearch);
|
|
|
+ params.page = 1
|
|
|
+ params.rows = 60
|
|
|
} else {
|
|
|
params.name = state.allSearch.name;
|
|
|
params = Object.assign(params, state.allSearch);
|
|
|
}
|
|
|
+
|
|
|
const res = await api_musicSheetPage(params);
|
|
|
if (res.code === 200 && Array.isArray(res?.data?.rows)) {
|
|
|
const result = res.data.rows || [];
|
|
@@ -268,8 +277,8 @@ export default defineComponent({
|
|
|
: [state.sAPT]
|
|
|
: [];
|
|
|
state.allSearch.musicTagIds = state.sNt;
|
|
|
- state.searchPopup = false;
|
|
|
- onSearch();
|
|
|
+ // state.searchPopup = false;
|
|
|
+ // onSearch();
|
|
|
};
|
|
|
|
|
|
const onDetail = (item: any) => {
|
|
@@ -406,6 +415,9 @@ export default defineComponent({
|
|
|
getMusicList();
|
|
|
|
|
|
window.addEventListener('resize', tabResize);
|
|
|
+ useEventListener(document, 'scroll', () => {
|
|
|
+ mSearchRef.value?.searchBlur()
|
|
|
+ });
|
|
|
|
|
|
listenerMessage('webViewOnResume', () => {
|
|
|
tabResize();
|
|
@@ -450,7 +462,7 @@ export default defineComponent({
|
|
|
if (state.isAllStatus) {
|
|
|
state.searchPopup = !state.searchPopup;
|
|
|
if (state.searchPopup) {
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
} else {
|
|
|
state.isAllStatus = true;
|
|
@@ -489,6 +501,7 @@ export default defineComponent({
|
|
|
|
|
|
<MSearch
|
|
|
v-model:modelValue={searchValue.value}
|
|
|
+ ref={mSearchRef}
|
|
|
background={'transparent'}
|
|
|
inputBackground="transparent"
|
|
|
class={styles.mSearch11}
|
|
@@ -513,7 +526,11 @@ export default defineComponent({
|
|
|
loading={state.loading}
|
|
|
finished={state.finished}
|
|
|
finishedText=" "
|
|
|
- onLoad={getMusicList}
|
|
|
+ onLoad={() => {
|
|
|
+ if(!state.tabActive) {
|
|
|
+ getMusicList()
|
|
|
+ }
|
|
|
+ }}
|
|
|
immediateCheck={false}>
|
|
|
{state.musics.length > 0 && (
|
|
|
<div class={styles.musicListSection}>
|