|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import Image from 'next/image';
|
|
|
|
|
import { useRouter } from 'next/navigation';
|
|
|
|
|
// import { useRouter } from 'next/navigation';
|
|
|
|
|
|
|
|
|
|
import ImageWithBasePath from '@/components/ImageWithBasePath';
|
|
|
|
|
|
|
|
|
@ -12,14 +12,15 @@ import { useJournalAudioContext } from '@/context/JournalAudioContext';
|
|
|
|
|
export default function SongItem(props: { data: ISong }) {
|
|
|
|
|
const song = props?.data || {};
|
|
|
|
|
const { id, pic, title, artist, album } = song;
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
// const router = useRouter();
|
|
|
|
|
const { curSong, setCurSong, playing, setPlaying } = useJournalAudioContext();
|
|
|
|
|
|
|
|
|
|
const activeTextColor: string = curSong?.id && id && curSong?.id === id ? 'text-[#C43737ff]' : '';
|
|
|
|
|
|
|
|
|
|
// 点击歌曲封面跳转到单曲页面
|
|
|
|
|
const handleCoverClick = () => {
|
|
|
|
|
router.push(`/music?id=${id}`);
|
|
|
|
|
// router.push(`/music?id=${id}`);
|
|
|
|
|
window.location.href = `/music.html?id=${id}`;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 点击歌曲信息播放歌曲
|
|
|
|
@ -30,7 +31,8 @@ export default function SongItem(props: { data: ISong }) {
|
|
|
|
|
|
|
|
|
|
// 点击右侧图标,弹出弹窗(目前先跳转到下载页)
|
|
|
|
|
const handleBudsClick = () => {
|
|
|
|
|
router.push('/download');
|
|
|
|
|
// router.push('/download');
|
|
|
|
|
window.location.href = '/download.html';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|