update
This commit is contained in:
@ -1,16 +1,9 @@
|
||||
import { ReactNode } from "react";
|
||||
import ArticleLayout from "@/app/components/ArticleLayout";
|
||||
|
||||
const navLinks = [
|
||||
{ title: "人才概况", href: "/" },
|
||||
{ title: "人才概况", href: "/3" },
|
||||
{ title: "人才概况", href: "/4" },
|
||||
{ title: "人才概况", href: "/5" },
|
||||
];
|
||||
import Breadcrumb from "@/app/components/Breadcrumb";
|
||||
|
||||
const Layout = ({
|
||||
children,
|
||||
params,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
params: {
|
||||
@ -19,7 +12,10 @@ const Layout = ({
|
||||
}) => {
|
||||
return (
|
||||
<ArticleLayout leftNavTitle={"新闻详情"} navigations={[]}>
|
||||
{children}
|
||||
<div className={"flex flex-col h-full"}>
|
||||
<Breadcrumb navigations={[]} />
|
||||
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
|
||||
</div>
|
||||
</ArticleLayout>
|
||||
);
|
||||
};
|
||||
|
21
app/(articles)/announcements/pages/[pageIndex]/layout.tsx
Normal file
21
app/(articles)/announcements/pages/[pageIndex]/layout.tsx
Normal file
@ -0,0 +1,21 @@
|
||||
import { ReactNode } from "react";
|
||||
import ArticleLayout from "@/app/components/ArticleLayout";
|
||||
import Breadcrumb from "@/app/components/Breadcrumb";
|
||||
|
||||
const Layout = ({ children }: { children: ReactNode }) => {
|
||||
return (
|
||||
<ArticleLayout navigations={[]} leftNavTitle={"公告通知"}>
|
||||
<div className={"flex flex-col h-full"}>
|
||||
<Breadcrumb
|
||||
navigations={[
|
||||
{ title: "首页", href: "/" },
|
||||
{ title: "公告通知", href: "/announcements/pages/1" },
|
||||
]}
|
||||
/>
|
||||
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
|
||||
</div>
|
||||
</ArticleLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default Layout;
|
43
app/(articles)/announcements/pages/[pageIndex]/page.tsx
Normal file
43
app/(articles)/announcements/pages/[pageIndex]/page.tsx
Normal file
@ -0,0 +1,43 @@
|
||||
import { listArticles } from "@/app/api/articles";
|
||||
import { Fragment } from "react";
|
||||
import styles from "./styles.module.scss";
|
||||
import Link from "next/link";
|
||||
import Pagination from "@/app/components/Pagination";
|
||||
|
||||
const Page = async ({
|
||||
params,
|
||||
}: {
|
||||
params: {
|
||||
pageIndex: string;
|
||||
};
|
||||
}) => {
|
||||
const data = await listArticles({
|
||||
cid: "3",
|
||||
pageNo: params.pageIndex,
|
||||
pageSize: 20,
|
||||
});
|
||||
return (
|
||||
<div>
|
||||
<h2 className={"text-[#0f6fca] text-sm"}>公告通知</h2>
|
||||
<ul className={`${styles.articles} mt-5`}>
|
||||
{data.lists.map((article, index) => (
|
||||
<li className={`${styles.article}`} key={article.id}>
|
||||
<Link
|
||||
className={"flex h-8 text-sm text-[#666666] items-center"}
|
||||
href={`/announcements/${article.id}`}
|
||||
>
|
||||
{article.title}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<Pagination
|
||||
page={parseInt(params.pageIndex)}
|
||||
total={data.count}
|
||||
perPage={20}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Page;
|
@ -0,0 +1,7 @@
|
||||
.articles {
|
||||
.article {
|
||||
&:not(:last-child) {
|
||||
border-bottom: 1px dashed #000;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user