diff --git a/src/components/layout/ParagraphSection/index.module.css b/src/components/layout/ParagraphSection/index.module.css index 2cc6a02..02789c6 100644 --- a/src/components/layout/ParagraphSection/index.module.css +++ b/src/components/layout/ParagraphSection/index.module.css @@ -10,7 +10,7 @@ white-space: pre-line; .paragraphSectionTitle { - font-weight: 500; + font-weight: bold; font-size: 2.5rem; color: #14355C; line-height: 3.125rem; diff --git a/src/index.css b/src/index.css index f74d940..996a954 100644 --- a/src/index.css +++ b/src/index.css @@ -40,7 +40,7 @@ html { body { margin: 0; - min-width: 1320px; + /* min-width: 1320px; */ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; @@ -75,3 +75,4 @@ code { font-family: 'Source Han Sans'; src: url('/public/ttf/SourceHanSansCN-Normal.otf'); } + diff --git a/src/layouts/Header.module.css b/src/layouts/Header.module.css index 44beb28..39c0ec0 100644 --- a/src/layouts/Header.module.css +++ b/src/layouts/Header.module.css @@ -314,8 +314,8 @@ } .dropPanel { - height: auto; - padding: 1rem; + height: 0; + /* padding: 1rem; */ } .dropPanelLink { diff --git a/src/pages/About/History.module.css b/src/pages/About/History.module.css index 7f435d3..a539ddd 100644 --- a/src/pages/About/History.module.css +++ b/src/pages/About/History.module.css @@ -10,7 +10,7 @@ min-height: 100vh; width: 100%; padding: 6.25rem auto; - padding-bottom: 6.25rem; + padding-bottom: 9.375rem; display: flex; flex-direction: column; } diff --git a/src/pages/About/History.tsx b/src/pages/About/History.tsx index 2adb201..dbcac60 100644 --- a/src/pages/About/History.tsx +++ b/src/pages/About/History.tsx @@ -124,7 +124,7 @@ function TimelineItemRow({
- {isSelected &&
} + {isSelected &&
}
{isRight && ( diff --git a/src/pages/About/overview.tsx b/src/pages/About/overview.tsx index 0087879..75bf79a 100644 --- a/src/pages/About/overview.tsx +++ b/src/pages/About/overview.tsx @@ -13,14 +13,18 @@ export default function About() { const banner = overview?.banner; const section1Data = overview?.section1Data?.items ?? []; - if (!overview) return null; - + const getLinkPath = (item: any) => { + if(item.path.includes("{id}")) { + return item.path.replace("{id}", item.label); + } + return item.path; + } return (
{section1Data.map((item: { title: string; content?: string; backgroundImage?: string; links?: { label: string; path: string }[] }, index: number) => ( @@ -41,7 +45,7 @@ export default function About() {
{item.links?.map((link: { label: string; path: string }) => ( - {link.label} + {link.label} ))}
diff --git a/src/pages/Home/Home.module.css b/src/pages/Home/Home.module.css index c99a5a2..49cb9b7 100644 --- a/src/pages/Home/Home.module.css +++ b/src/pages/Home/Home.module.css @@ -285,7 +285,7 @@ font-weight: 500; font-size: 1.5rem; color: #FFFFFF; - width: 80%; + width: 70%; } .newsList { @@ -302,12 +302,12 @@ .newsItem { box-sizing: border-box; - padding: 1.5rem 1.875rem 1.25rem 1.875rem; + padding: 0 1.875rem; height: 11.25rem; background: #FFFFFF; display: flex; flex-direction: column; - justify-content: space-between; + justify-content: center; cursor: pointer; .newsItemArrowIcon { @@ -338,6 +338,9 @@ margin: 0 0 0.5rem; line-height: 1.4; transition: color 0.3s ease-in-out; + /* overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; */ } .newsItemTitle a { diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index c48ec02..4cc749e 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -9,6 +9,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { motion, type Variants } from "motion/react"; import { ArrowRightOutlined } from "@ant-design/icons"; import appApi from "@/api/app"; +import { dateFormat } from "@/utils"; const cardVariants: Variants = { hidden: { opacity: 0, y: 220 }, visible: { opacity: 1, y: 0 }, @@ -20,7 +21,7 @@ export default function Home() { const banner = home?.banner; const section1Data = home?.section1Data; - const section2Data = home?.section2Data?.items ?? []; + const section2Data = home?.section2Data ?? null; if (!home) return null; @@ -32,7 +33,7 @@ export default function Home() { {/* Commercial */} @@ -41,9 +42,9 @@ export default function Home() { } {/* 首页名片 */} -
+
- {section2Data.map((item: any, i: number) => ( + {section2Data?.items?.map((item: any, i: number) => (

- {item.date} + {locale.startsWith("zh") + ? dateFormat(item.date, "yyyy年MM月dd日") + : dateFormat(item.date, "yyyy-MM-dd") + }
diff --git a/src/utils/index.ts b/src/utils/index.ts index 72b8e18..5c7652f 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -17,6 +17,7 @@ export const debounce = (func: (...args: any[]) => void, delay: number) => { * @returns 日期字符串 */ export const dateFormat = (date: Date | string, format: string) => { + if(!date) return ''; const d = typeof date === 'string' ? new Date(date) : date; if (Number.isNaN(d.getTime())) return ''; const year = d.getFullYear(); diff --git a/src/utils/parsePageConfig.ts b/src/utils/parsePageConfig.ts index b49ede9..33cb2e6 100644 --- a/src/utils/parsePageConfig.ts +++ b/src/utils/parsePageConfig.ts @@ -161,9 +161,16 @@ export function parsePageConfig(items: RawPageItem[]): { } } - const menuItems = filtered.filter((it) => it.tags === "menu"); - const zhNavItems = buildNavItems(menuItems, "ZH", parsedContentMap); - const enNavItems = buildNavItems(menuItems, "EN", parsedContentMap); + const topMenuConfig = filtered.find((it) => it.tags === "top-menus"); + let topMenuJson: any = null + try { + topMenuJson = JSON.parse(topMenuConfig?.content ?? "[]"); + } catch(err) { + console.error('parse topMenuConfig error', err) + } + console.log('topMenuJson', topMenuJson) + // const zhNavItems = buildNavItems(menuItems, "ZH", parsedContentMap); + // const enNavItems = buildNavItems(menuItems, "EN", parsedContentMap); const zhConfig: Record = {}; @@ -193,8 +200,8 @@ export function parsePageConfig(items: RawPageItem[]): { } } - zhConfig.navItems = zhNavItems; - enConfig.navItems = enNavItems; + zhConfig.navItems = topMenuJson.ZH.items; + enConfig.navItems = topMenuJson.EN.items; deepFallback(enConfig, zhConfig); return { "zh-CN": zhConfig, "en-US": enConfig };