diff --git a/src/app/(website)/music/[category]/[[...page]]/page.tsx b/src/app/(website)/music/[category]/[[...page]]/page.tsx
index 69edabc..18383c2 100644
--- a/src/app/(website)/music/[category]/[[...page]]/page.tsx
+++ b/src/app/(website)/music/[category]/[[...page]]/page.tsx
@@ -140,11 +140,11 @@ export default async function Journal({ params }: { params: { category?: string;
{/* 热门推荐 */}
-
+
{!!recommendList?.length && }
{!!carouselList?.length && (
-
+
)}
diff --git a/src/app/(website)/vol/[journalId]/page.tsx b/src/app/(website)/vol/[journalId]/page.tsx
index 6128c37..cec2a00 100644
--- a/src/app/(website)/vol/[journalId]/page.tsx
+++ b/src/app/(website)/vol/[journalId]/page.tsx
@@ -2,8 +2,21 @@
import Link from 'next/link';
import { notFound, redirect, RedirectType } from 'next/navigation';
-import { SongCardList, JournalRecommendList, Comment, CollectButton, VolDetailCoverCard } from '@/components';
-import { apiGetJournalInfoById, apiGetSongsByJournalNo, apiGetJournalRecommendById, apiGetTags } from '@/services';
+import {
+ SongCardList,
+ JournalRecommendList,
+ Comment,
+ CollectButton,
+ VolDetailCoverCard,
+ HomeCarousel,
+} from '@/components';
+import {
+ apiGetJournalInfoById,
+ apiGetSongsByJournalNo,
+ apiGetJournalRecommendById,
+ apiGetTags,
+ apiCarousel,
+} from '@/services';
export async function generateMetadata({ params: { journalId } }: { params: { journalId: string } }) {
const res = await apiGetJournalInfoById({ id: journalId });
@@ -12,11 +25,12 @@ export async function generateMetadata({ params: { journalId } }: { params: { jo
}
const getData = async (journalId: string) => {
- const [journalInfoRes, songListRes, recommendList, tagList] = await Promise.all([
+ const [journalInfoRes, songListRes, recommendList, tagList, carouselList] = await Promise.all([
apiGetJournalInfoById({ id: journalId }),
apiGetSongsByJournalNo({ id: journalId }),
apiGetJournalRecommendById({ id: journalId, limit: 8 }),
apiGetTags(),
+ apiCarousel(),
]);
if (!(journalInfoRes.code === 200 && songListRes.code === 200)) return notFound();
return {
@@ -24,6 +38,7 @@ const getData = async (journalId: string) => {
songList: songListRes.data,
recommendList: recommendList.data,
tagList: tagList.data,
+ carouselList: carouselList.data?.filter((item: Carousel) => item.outerLink),
};
};
@@ -34,7 +49,7 @@ export default async function JournalDetail({
params: { journalId: string };
searchParams: { mobile: string };
}) {
- const { journalInfo, songList, recommendList, tagList } = await getData(journalId);
+ const { journalInfo, songList, recommendList, tagList, carouselList } = await getData(journalId);
if (mobile) {
redirect(`${process.env.NEXT_PUBLIC_MOBILE_HOST}/journal.html?id=${journalInfo.id}`, RedirectType.replace);
@@ -118,6 +133,10 @@ export default async function JournalDetail({
{/* 热门推荐 */}
{!!recommendList?.length ?
:
}
+
+ {!!carouselList?.length && (
+
+ )}
);