|
|
@ -1,30 +1,79 @@
|
|
|
|
import { JournalCard, HotJournalList } from '@/components';
|
|
|
|
import Image from 'next/image';
|
|
|
|
import { apiGetJournalById, apiGetByJournalNo } from '@/services';
|
|
|
|
import Link from 'next/link';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { JournalCard, SongCardList, HotJournalList, Comment } from '@/components';
|
|
|
|
|
|
|
|
import { apiGetJournalById, apiGetSongsByJournalNo } from '@/services';
|
|
|
|
|
|
|
|
|
|
|
|
export default async function JournalDetail({ params: { journalId } }: { params: { journalId: string } }) {
|
|
|
|
export default async function JournalDetail({ params: { journalId } }: { params: { journalId: string } }) {
|
|
|
|
// const router = useRouter();
|
|
|
|
// const router = useRouter();
|
|
|
|
const [a, b] = await Promise.all([apiGetByJournalNo({ id: journalId }), apiGetJournalById({ id: journalId })]);
|
|
|
|
const [a, b] = await Promise.all([apiGetSongsByJournalNo({ id: journalId }), apiGetJournalById({ id: journalId })]);
|
|
|
|
|
|
|
|
|
|
|
|
let songList = null;
|
|
|
|
console.log({ a, b });
|
|
|
|
let journalInfo = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (a) songList = a;
|
|
|
|
if (!a || !b) return;
|
|
|
|
if (b) journalInfo = b;
|
|
|
|
const songList = a;
|
|
|
|
|
|
|
|
const journalInfo = b;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<main className="flex flex-col w-[1200px] mx-auto items-left pt-[80px] pb-[104px] ">
|
|
|
|
<main className="w-[1200px] mx-auto flex flex-row justify-between items-left pt-[145px] pb-[104px] ">
|
|
|
|
{!!journalInfo && <JournalCard image={journalInfo.image} journalNo={journalInfo.journalNo} />}
|
|
|
|
<div className="w-[712px]">
|
|
|
|
|
|
|
|
{/* 封面 */}
|
|
|
|
<div>
|
|
|
|
<JournalCard image={journalInfo.image} journalNo={journalInfo.journalNo} />
|
|
|
|
{songList &&
|
|
|
|
{/* 期刊号 & 标签 */}
|
|
|
|
songList.map((item) => (
|
|
|
|
<div className="flex flex-row items-center gap-[9px] w-full h-auto mt-[30px]">
|
|
|
|
<div key={item.id} {...item}>
|
|
|
|
<p className="text-[rgba(0,0,0,0.7)] text-[14px] leading-[19.6px]">{`VOL·${journalInfo?.journalNo}`}</p>
|
|
|
|
{item.title}
|
|
|
|
{journalInfo.tags.length &&
|
|
|
|
|
|
|
|
journalInfo.tags.map((tag: string) => (
|
|
|
|
|
|
|
|
<Link
|
|
|
|
|
|
|
|
href="/"
|
|
|
|
|
|
|
|
key={tag}
|
|
|
|
|
|
|
|
className="block w-auto py-[3px] px-[10px] rounded-[15px] bg-[rgba(0,0,0,0.05)] text-[rgba(0,0,0,0.7)] text-[12px] leading-[12px]"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{tag}
|
|
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
))}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="flex flex-row items-center justify-between w-full h-auto">
|
|
|
|
|
|
|
|
{/* 标题 */}
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<div className="w-autp text-[24px] leading-[33.6px] my-[9px] text-base text-bold text-overflow">
|
|
|
|
|
|
|
|
{journalInfo.title}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{/* 作者 & 时间 */}
|
|
|
|
|
|
|
|
<div className="flex flex-row item-center text-[rgba(0,0,0,0.4)] text-[12px] leading-[16.8px] gap-[12px]">
|
|
|
|
|
|
|
|
<p>{journalInfo.editor}</p>
|
|
|
|
|
|
|
|
<p>{journalInfo.date}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{/* 收藏 */}
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<Image
|
|
|
|
|
|
|
|
width={24}
|
|
|
|
|
|
|
|
height={24}
|
|
|
|
|
|
|
|
src={journalInfo.haveCollect ? '/img/icon/love-active.svg' : '/img/icon/love.svg'}
|
|
|
|
|
|
|
|
alt="collect"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{/* 内容 */}
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
className="mt-[24px] text-[15px] leading-[21px] text-base"
|
|
|
|
|
|
|
|
dangerouslySetInnerHTML={{ __html: journalInfo.content }}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* 卡片 */}
|
|
|
|
|
|
|
|
<SongCardList className="my-40px w-full" songList={songList} />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Comment
|
|
|
|
|
|
|
|
commentList={journalInfo.commentList}
|
|
|
|
|
|
|
|
totalCommentReply={journalInfo.totalCommentReplyInt}
|
|
|
|
|
|
|
|
className="w-full"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="w-[346px] mt-[217px]">
|
|
|
|
<div className="w-[346px]">
|
|
|
|
{/* 热门推荐 */}
|
|
|
|
{/* 热门推荐 */}
|
|
|
|
<HotJournalList type="hot" />
|
|
|
|
<HotJournalList type="hot" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|