This commit is contained in:
quantulr
2023-11-02 17:24:34 +08:00
parent 593a8a0bc3
commit 2423f8c2e8
8 changed files with 86 additions and 9 deletions

BIN
app/assets/backtop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -157,6 +157,7 @@ const AnhuiSwiper = () => {
>
<img
src={`${process.env.NEXT_PUBLIC_ADMIN_BASE_URL}${el.path}`}
alt={""}
/>
{/*@ts-ignore*/}
</swiper-slide>

View File

@ -0,0 +1,19 @@
"use client";
import backTop from "@/app/assets/backtop.png";
import Image from "next/image";
// import { useScroll } from "ahooks";
const BackToTop = () => {
// const position = useScroll();
return (
<div className={`fixed bottom-4 right-10 w-[50px] h-[50px]`}>
<Image
className={"w-full h-full cursor-pointer"}
src={backTop}
alt={""}
/>
</div>
);
};
export default BackToTop;

View File

@ -1,15 +1,23 @@
"use client";
import styles from "@/app/assets/page.module.css";
import Image from "next/image";
import trumpetIcon from "@/app/assets/trumpet-icon.png";
import { articleDetail, listArticles } from "@/app/api/articles";
import { htmlToText } from "html-to-text";
import Link from "next/link";
import { useEffect, useState } from "react";
import { Article } from "@/app/types/article";
// TODO:
// const [lists, setLists] = useState<Article[]>([]);
// useEffect(() => {
// listArticles({ cid: "13" }).then((res) => {
// setLists(() => res.lists);
// });
// }, []);
const BranchLifeSketch = async () => {
const { lists } = await listArticles({ cid: "13" });
return (
<div>
<>
<div
className={`title-bar text-white flex items-center px-2 font-bold ${styles.articleBlockTitleBar} relative`}
>
@ -76,7 +84,7 @@ const BranchLifeSketch = async () => {
{/*@ts-ignore*/}
</swiper-container>
</div>
</div>
</>
);
};

View File

@ -1,12 +1,12 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import Link from "next/link";
import footer from "@/app/assets/footer.jpg";
import Image from "next/image";
import banner from "@/app/assets/banner.jpg";
import { ReactNode } from "react";
import MainNav from "@/app/components/MainNav";
import BackToTop from "@/app/components/BackToTop";
const inter = Inter({ subsets: ["latin"] });
@ -25,6 +25,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
{children}
<Image src={footer} alt={"footer"} className={"mt-4"} />
</main>
<BackToTop />
</body>
</html>
);

View File

@ -81,9 +81,7 @@ export default async function Home() {
target="_blank"
/>
</map>
<div className={"mt-1"}>
<BranchLifeSketch />
</div>
<div className={"mt-1"}>{/*<BranchLifeSketch />*/}</div>
</div>
<div className={"main-content w-[540px]"}>
<LatestNews />