From 4ca125387e908c3542f410de9d2186860d737f39 Mon Sep 17 00:00:00 2001 From: zhangjianjun Date: Thu, 19 Mar 2026 16:36:29 +0800 Subject: [PATCH] save --- public/images/{ => icons}/icon-arrow-down.png | Bin public/images/{ => icons}/icon-arrowleft.png | Bin public/images/{ => icons}/icon-search.png | Bin public/images/svg/logo.svg | 1 - src/App.css | 4 + src/App.tsx | 6 +- src/components/YearPicker/index.tsx | 2 +- src/components/banner.tsx | 5 +- src/components/layout/Article/index.tsx | 2 +- src/components/layout/JobPage/index.tsx | 2 +- src/components/layout/RowAccordion/index.tsx | 4 +- .../layout/SwiperCardSection/index.tsx | 22 +++++- .../layout/TopTabsSection/index.tsx | 22 +++++- src/hooks/useHashScroll.ts | 16 +++- src/layouts/Footer.module.css | 4 +- src/layouts/Footer.tsx | 40 ++++++---- src/layouts/Header.module.css | 72 ++++++++++++++---- src/layouts/Header.tsx | 26 +++++-- src/layouts/MainLayout.tsx | 3 +- src/pages/About/Founder.tsx | 16 ++-- src/pages/Business/InvestGroup.tsx | 26 ++++--- src/pages/Home/Home.module.css | 2 +- src/pages/Home/index.tsx | 6 +- src/pages/Join/CampusDetail.tsx | 2 +- src/pages/Others/SiteMap.tsx | 2 +- src/utils/parsePageConfig.ts | 39 +--------- 26 files changed, 205 insertions(+), 119 deletions(-) rename public/images/{ => icons}/icon-arrow-down.png (100%) rename public/images/{ => icons}/icon-arrowleft.png (100%) rename public/images/{ => icons}/icon-search.png (100%) delete mode 100644 public/images/svg/logo.svg diff --git a/public/images/icon-arrow-down.png b/public/images/icons/icon-arrow-down.png similarity index 100% rename from public/images/icon-arrow-down.png rename to public/images/icons/icon-arrow-down.png diff --git a/public/images/icon-arrowleft.png b/public/images/icons/icon-arrowleft.png similarity index 100% rename from public/images/icon-arrowleft.png rename to public/images/icons/icon-arrowleft.png diff --git a/public/images/icon-search.png b/public/images/icons/icon-search.png similarity index 100% rename from public/images/icon-search.png rename to public/images/icons/icon-search.png diff --git a/public/images/svg/logo.svg b/public/images/svg/logo.svg deleted file mode 100644 index ed314ee..0000000 --- a/public/images/svg/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/App.css b/src/App.css index f2c22a5..e138139 100644 --- a/src/App.css +++ b/src/App.css @@ -137,4 +137,8 @@ body { transform: scale(1.05); } } +} + +.logo-dark { + filter: brightness(0) saturate(100%) invert(16%) sepia(25%) saturate(4500%) hue-rotate(223deg) brightness(80%) contrast(85%); } \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index c5398bd..9a09dc1 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -17,9 +17,9 @@ function App() { const locale = useStore((s) => s.locale); const appConfig = useStore((s) => s.appConfig); - const initState = useCallback((data: Record) => { - const company = data?.company as { config?: { favicon?: string; shortName?: string } } | undefined; - const { favicon, shortName } = company?.config || {}; + const initState = useCallback((data: any) => { + const company = data?.__global__.company; + const { favicon, shortName } = company || {}; if (favicon) { const favor: any = document.querySelector("link[rel*='icon']") || document.createElement('link'); favor.type = 'image/x-icon'; diff --git a/src/components/YearPicker/index.tsx b/src/components/YearPicker/index.tsx index 4e76765..716cb5d 100644 --- a/src/components/YearPicker/index.tsx +++ b/src/components/YearPicker/index.tsx @@ -94,7 +94,7 @@ export default function YearPicker({ {value != null ? `${value}年` : placeholder}
- arrow-down + arrow-down
diff --git a/src/components/banner.tsx b/src/components/banner.tsx index 9933bd6..0b32bd4 100644 --- a/src/components/banner.tsx +++ b/src/components/banner.tsx @@ -33,8 +33,7 @@ export default function Banner({ backgroundImage, }: Props) { const appConfig = useStore((s) => s.appConfig); - const header = appConfig?.header; - const navItems = header?.navItems ?? []; + const navItems = appConfig?.navItems ?? []; const location = useLocation(); const images = Array.isArray(backgroundImage) ? backgroundImage : [backgroundImage]; @@ -61,7 +60,7 @@ export default function Banner({ if (child) return child.label; } const last = path.split("/").pop() ?? path; - return last; + return title; }; const items = paths.map((path) => ({ label: getLabelByPath(path), diff --git a/src/components/layout/Article/index.tsx b/src/components/layout/Article/index.tsx index c50c9e5..13394b7 100644 --- a/src/components/layout/Article/index.tsx +++ b/src/components/layout/Article/index.tsx @@ -13,7 +13,7 @@ export default function Article({ data }: { data: Data }) {
window.history.back()}> - arrowleft + arrowleft 返回
diff --git a/src/components/layout/JobPage/index.tsx b/src/components/layout/JobPage/index.tsx index 5908151..0b6ffb3 100644 --- a/src/components/layout/JobPage/index.tsx +++ b/src/components/layout/JobPage/index.tsx @@ -18,7 +18,7 @@ export default function JobPage({ data }: { data: Data }) {
window.history.back()}> - arrowleft + arrowleft 返回
diff --git a/src/components/layout/RowAccordion/index.tsx b/src/components/layout/RowAccordion/index.tsx index f2b9c7d..94093da 100644 --- a/src/components/layout/RowAccordion/index.tsx +++ b/src/components/layout/RowAccordion/index.tsx @@ -61,7 +61,7 @@ export default function RowAccordion({ data, placement='bottom' }: Props) { useEffect(() => { if (isInView && containerRef.current) { const rect = containerRef.current.getBoundingClientRect(); - smoothScrollTo(window.scrollY + rect.top, 1200); + smoothScrollTo(window.scrollY + rect.top, 800); } }, [isInView]); @@ -99,7 +99,7 @@ export default function RowAccordion({ data, placement='bottom' }: Props) { variants={contentItemVariants} transition={{ duration: 0.6, - delay: 0.5 + index * 0.12, + delay: 0.3 + index * 0.12, ease: [0.25, 0.46, 0.45, 0.94], }} > diff --git a/src/components/layout/SwiperCardSection/index.tsx b/src/components/layout/SwiperCardSection/index.tsx index 8926ded..c38b469 100644 --- a/src/components/layout/SwiperCardSection/index.tsx +++ b/src/components/layout/SwiperCardSection/index.tsx @@ -1,10 +1,11 @@ -import { useCallback, useState } from "react"; +import { useCallback, useEffect, useState } from "react"; import { Swiper, SwiperSlide } from "swiper/react"; import type { Swiper as SwiperType } from "swiper"; import "swiper/css"; import SectionTitle from "../SectionTitle"; import styles from "./index.module.css"; import { RightOutlined, LeftOutlined } from "@ant-design/icons"; +import { useLocation } from "react-router-dom"; type Data = { title: string; cardItems: { @@ -18,15 +19,30 @@ type Data = { } export default function SwiperCardSection({ data }: { data: Data }) { + const location = useLocation(); + const hash = location.hash; + const id = decodeURIComponent(hash.replace('#', '')); + const [swiperRef, setSwiperRef] = useState(null); const [activeIndex, setActiveIndex] = useState(0); const onSwiperChange = useCallback((e: any) => { setActiveIndex(e.activeIndex); }, []) + + useEffect(() => { + if (id && data.cardItems && swiperRef) { + const index = data.cardItems.findIndex((item) => item.title === id); + if (index !== -1) { + setTimeout(() => { + swiperRef.slideTo(index); + }, 500); + } + } + }, [id, data.cardItems, swiperRef]) return ( -
+
-
+
{activeIndex > 0 && (