mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-05-18 11:37:31 +08:00
修改动画, 修改搜索
This commit is contained in:
@@ -26,11 +26,12 @@
|
||||
class="search-list"
|
||||
:class="setAnimationClass('animate__fadeInUp')"
|
||||
:native-scrollbar="false"
|
||||
@scroll="searchScrolling"
|
||||
>
|
||||
<div class="title">{{ hotKeyword }}</div>
|
||||
<template v-if="searchDetail">
|
||||
<div
|
||||
v-for="(item, index) in searchDetail?.result.song.songs"
|
||||
v-for="(item, index) in searchDetail?.result.songs"
|
||||
:key="item.id"
|
||||
:class="setAnimationClass('animate__bounceInRight')"
|
||||
:style="setAnimationDelay(index, 100)"
|
||||
@@ -55,7 +56,7 @@ import SongItem from "@/components/common/SongItem.vue";
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const searchDetail = ref<ISearchDetail>();
|
||||
const searchDetail = ref<any>();
|
||||
|
||||
// 热搜列表
|
||||
const hotSearchData = ref<IHotSearch>();
|
||||
@@ -64,6 +65,10 @@ const loadHotSearch = async () => {
|
||||
hotSearchData.value = data;
|
||||
};
|
||||
|
||||
function searchScrolling(e: any) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
loadHotSearch();
|
||||
@@ -88,14 +93,15 @@ const loadSearch = async (keyword: any) => {
|
||||
searchDetail.value = undefined;
|
||||
if (!keyword) return;
|
||||
const { data } = await getSearch(keyword);
|
||||
const songs = data.result.song.songs;
|
||||
|
||||
const songs = data.result.songs;
|
||||
|
||||
// songs map 替换属性
|
||||
songs.map((item: any) => {
|
||||
item.picUrl = item.al.picUrl;
|
||||
item.song = item;
|
||||
item.artists = item.ar;
|
||||
});
|
||||
data.result.song.songs = songs;
|
||||
searchDetail.value = data;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user