|
|
@ -1,11 +1,10 @@
|
|
|
|
/** 期刊详情 */
|
|
|
|
/** 期刊详情 */
|
|
|
|
|
|
|
|
|
|
|
|
import Image from 'next/image';
|
|
|
|
|
|
|
|
import Link from 'next/link';
|
|
|
|
import Link from 'next/link';
|
|
|
|
import { notFound } from 'next/navigation';
|
|
|
|
import { notFound } from 'next/navigation';
|
|
|
|
|
|
|
|
|
|
|
|
import { JournalCard, SongCardList, HotJournalList, Comment, Coolect } from '@/components';
|
|
|
|
import { JournalCard, SongCardList, HotJournalList, Comment, Coolect } from '@/components';
|
|
|
|
import { apiGetJournalInfoById, apiGetSongsByJournalNo, apiCollect } from '@/services';
|
|
|
|
import { apiGetJournalInfoById, apiGetSongsByJournalNo } from '@/services';
|
|
|
|
|
|
|
|
|
|
|
|
const getData = async (journalId: string) => {
|
|
|
|
const getData = async (journalId: string) => {
|
|
|
|
const [journalInfoRes, songListRes] = await Promise.all([
|
|
|
|
const [journalInfoRes, songListRes] = await Promise.all([
|
|
|
@ -16,13 +15,6 @@ const getData = async (journalId: string) => {
|
|
|
|
return { journalInfo: journalInfoRes.data, songList: songListRes.data };
|
|
|
|
return { journalInfo: journalInfoRes.data, songList: songListRes.data };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 收藏/取消收藏
|
|
|
|
|
|
|
|
const handleCollect = async ({ isAdd, id }: { isAdd: boolean; id: string }) => {
|
|
|
|
|
|
|
|
const res = await apiCollect({ isAdd: !isAdd, objectId: id, collectType: '1' });
|
|
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default async function JournalDetail({ params: { journalId } }: { params: { journalId: string } }) {
|
|
|
|
export default async function JournalDetail({ params: { journalId } }: { params: { journalId: string } }) {
|
|
|
|
const { journalInfo, songList } = await getData(journalId);
|
|
|
|
const { journalInfo, songList } = await getData(journalId);
|
|
|
|
|
|
|
|
|
|
|
@ -66,20 +58,9 @@ export default async function JournalDetail({ params: { journalId } }: { params:
|
|
|
|
id={journalInfo.id}
|
|
|
|
id={journalInfo.id}
|
|
|
|
type="1"
|
|
|
|
type="1"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
{/* <div className="flex flex-row items-center gap-[9px]">
|
|
|
|
|
|
|
|
<p className="text-[rgba(0,0,0,0.4)] text-[13px] leading-[18.2px]">{`${journalInfo.totalCommentReply}人收藏`}</p>
|
|
|
|
|
|
|
|
<div onClick={() => handleCollect({ id: journalInfo.id, isAdd: !journalInfo.haveCollect })}>
|
|
|
|
|
|
|
|
<Image
|
|
|
|
|
|
|
|
width={24}
|
|
|
|
|
|
|
|
height={24}
|
|
|
|
|
|
|
|
src={journalInfo.haveCollect ? '/img/icon/love-active.svg' : '/img/icon/love.svg'}
|
|
|
|
|
|
|
|
alt="collect"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div> */}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/* 内容 */}
|
|
|
|
{/* 内容 */}
|
|
|
|
<div
|
|
|
|
<article
|
|
|
|
className="mt-[24px] text-[15px] leading-[21px] text-base"
|
|
|
|
className="mt-[24px] text-[15px] leading-[21px] text-base"
|
|
|
|
dangerouslySetInnerHTML={{ __html: journalInfo.content }}
|
|
|
|
dangerouslySetInnerHTML={{ __html: journalInfo.content }}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -96,7 +77,7 @@ export default async function JournalDetail({ params: { journalId } }: { params:
|
|
|
|
|
|
|
|
|
|
|
|
<div className="w-[346px]">
|
|
|
|
<div className="w-[346px]">
|
|
|
|
{/* 热门推荐 */}
|
|
|
|
{/* 热门推荐 */}
|
|
|
|
<HotJournalList type="hot" />
|
|
|
|
<HotJournalList type="journal" journalId={journalInfo.id} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</main>
|
|
|
|
</main>
|
|
|
|
);
|
|
|
|
);
|
|
|
|