parent
f0c00aa830
commit
a7c36d3b27
@ -1,36 +0,0 @@
|
||||
import { Category, JournalList, HotJournalList } from '@/components';
|
||||
import { apiTagName } from '@/services/server';
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const tagNameList = await apiTagName({ level: 1, state: 1 });
|
||||
|
||||
return tagNameList.map((item: TagName) => {
|
||||
return {
|
||||
category: item.nameEn,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export default async function Journal({ params }: { params: { category: string } }) {
|
||||
const tagNameList = await apiTagName({ level: 1, state: 1 });
|
||||
const currentTag: TagName = tagNameList.find((item: TagName) => item.nameEn === params.category);
|
||||
const page = 1;
|
||||
|
||||
return (
|
||||
<main className="flex flex-row justify-between w-[1200px] mx-auto items-left pt-[80px] pb-[104px] ">
|
||||
{/* 左侧 */}
|
||||
<div className="w-[712px] mt-[50px]">
|
||||
{/* category */}
|
||||
<Category current={currentTag.nameEn} />
|
||||
{/* 期刊列表 */}
|
||||
<JournalList categoryId={currentTag.id} pageNum={page} />
|
||||
</div>
|
||||
|
||||
{/* 右侧 */}
|
||||
<div className="w-[346px] mt-[217px]">
|
||||
{/* 热门推荐 */}
|
||||
<HotJournalList />
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
import { Category, JournalList, HotJournalList } from '@/components';
|
||||
import { apiSearchCategory } from '@/services/server';
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const tagNameList: Category[] = await apiSearchCategory();
|
||||
tagNameList.push({
|
||||
id: '0',
|
||||
nameCh: '全部',
|
||||
nameEn: 'all',
|
||||
image: '',
|
||||
thumbnail: '',
|
||||
description: '',
|
||||
});
|
||||
|
||||
return tagNameList.map((item: Category) => ({ category: item.nameEn }));
|
||||
}
|
||||
|
||||
export default async function Journal({ params }: { params: { category: string } }) {
|
||||
const tagNameList: Category[] = await apiSearchCategory();
|
||||
const currentTag: Category | undefined = tagNameList.find((item: Category) => item.nameEn === params.category);
|
||||
const page = 1;
|
||||
|
||||
return (
|
||||
<main className="flex flex-row justify-between w-[1200px] mx-auto items-left pt-[80px] pb-[104px] ">
|
||||
{/* 左侧 */}
|
||||
<div className="w-[712px] mt-[50px]">
|
||||
{/* category */}
|
||||
<Category current={currentTag?.nameEn ?? 'all'} />
|
||||
{/* 期刊列表 */}
|
||||
<JournalList categoryId={currentTag?.id ?? '0'} nameCh={currentTag?.nameCh ?? '全部'} pageNum={page} />
|
||||
</div>
|
||||
|
||||
{/* 右侧 */}
|
||||
<div className="w-[346px] mt-[217px]">
|
||||
{/* 热门推荐 */}
|
||||
<HotJournalList categoryId="1" />
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
Loading…
Reference in new issue