This commit is contained in:
parent
187a034a22
commit
4ce17fb5f4
|
|
@ -10,7 +10,7 @@
|
||||||
white-space: pre-line;
|
white-space: pre-line;
|
||||||
|
|
||||||
.paragraphSectionTitle {
|
.paragraphSectionTitle {
|
||||||
font-weight: 500;
|
font-weight: bold;
|
||||||
font-size: 2.5rem;
|
font-size: 2.5rem;
|
||||||
color: #14355C;
|
color: #14355C;
|
||||||
line-height: 3.125rem;
|
line-height: 3.125rem;
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ html {
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
min-width: 1320px;
|
/* min-width: 1320px; */
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
||||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
||||||
sans-serif;
|
sans-serif;
|
||||||
|
|
@ -75,3 +75,4 @@ code {
|
||||||
font-family: 'Source Han Sans';
|
font-family: 'Source Han Sans';
|
||||||
src: url('/public/ttf/SourceHanSansCN-Normal.otf');
|
src: url('/public/ttf/SourceHanSansCN-Normal.otf');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -314,8 +314,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropPanel {
|
.dropPanel {
|
||||||
height: auto;
|
height: 0;
|
||||||
padding: 1rem;
|
/* padding: 1rem; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropPanelLink {
|
.dropPanelLink {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 6.25rem auto;
|
padding: 6.25rem auto;
|
||||||
padding-bottom: 6.25rem;
|
padding-bottom: 9.375rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ function TimelineItemRow({
|
||||||
</div>
|
</div>
|
||||||
<div className={`${styles.dotWrapper} ${isSelected ? styles.selected : ""}`}>
|
<div className={`${styles.dotWrapper} ${isSelected ? styles.selected : ""}`}>
|
||||||
<div className={styles.dot} />
|
<div className={styles.dot} />
|
||||||
{isSelected && <div ref={dotLineRef} className={styles.dotLine} />}
|
{isSelected && <div ref={dotLineRef} key={index} className={styles.dotLine} />}
|
||||||
</div>
|
</div>
|
||||||
<div ref={isRight ? contentSideRef : undefined} className={styles.side}>
|
<div ref={isRight ? contentSideRef : undefined} className={styles.side}>
|
||||||
{isRight && (
|
{isRight && (
|
||||||
|
|
|
||||||
|
|
@ -13,14 +13,18 @@ export default function About() {
|
||||||
const banner = overview?.banner;
|
const banner = overview?.banner;
|
||||||
const section1Data = overview?.section1Data?.items ?? [];
|
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 (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Banner
|
<Banner
|
||||||
title={banner?.title ?? ""}
|
title={banner?.title ?? ""}
|
||||||
desc={banner?.content}
|
desc={banner?.content}
|
||||||
backgroundImage={banner?.backgroundImage ?? "/images/bg-overview.png"}
|
backgroundImage={banner?.backgroundImage}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{section1Data.map((item: { title: string; content?: string; backgroundImage?: string; links?: { label: string; path: string }[] }, index: number) => (
|
{section1Data.map((item: { title: string; content?: string; backgroundImage?: string; links?: { label: string; path: string }[] }, index: number) => (
|
||||||
|
|
@ -41,7 +45,7 @@ export default function About() {
|
||||||
<div className={styles.links}>
|
<div className={styles.links}>
|
||||||
{item.links?.map((link: { label: string; path: string }) => (
|
{item.links?.map((link: { label: string; path: string }) => (
|
||||||
<span key={link.label}>
|
<span key={link.label}>
|
||||||
<Link to={link.path}>{link.label}</Link>
|
<Link to={getLinkPath(link)}>{link.label}</Link>
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,7 @@
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
width: 80%;
|
width: 70%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList {
|
.newsList {
|
||||||
|
|
@ -302,12 +302,12 @@
|
||||||
|
|
||||||
.newsItem {
|
.newsItem {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 1.5rem 1.875rem 1.25rem 1.875rem;
|
padding: 0 1.875rem;
|
||||||
height: 11.25rem;
|
height: 11.25rem;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
.newsItemArrowIcon {
|
.newsItemArrowIcon {
|
||||||
|
|
@ -338,6 +338,9 @@
|
||||||
margin: 0 0 0.5rem;
|
margin: 0 0 0.5rem;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
transition: color 0.3s ease-in-out;
|
transition: color 0.3s ease-in-out;
|
||||||
|
/* overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsItemTitle a {
|
.newsItemTitle a {
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||||
import { motion, type Variants } from "motion/react";
|
import { motion, type Variants } from "motion/react";
|
||||||
import { ArrowRightOutlined } from "@ant-design/icons";
|
import { ArrowRightOutlined } from "@ant-design/icons";
|
||||||
import appApi from "@/api/app";
|
import appApi from "@/api/app";
|
||||||
|
import { dateFormat } from "@/utils";
|
||||||
const cardVariants: Variants = {
|
const cardVariants: Variants = {
|
||||||
hidden: { opacity: 0, y: 220 },
|
hidden: { opacity: 0, y: 220 },
|
||||||
visible: { opacity: 1, y: 0 },
|
visible: { opacity: 1, y: 0 },
|
||||||
|
|
@ -20,7 +21,7 @@ export default function Home() {
|
||||||
|
|
||||||
const banner = home?.banner;
|
const banner = home?.banner;
|
||||||
const section1Data = home?.section1Data;
|
const section1Data = home?.section1Data;
|
||||||
const section2Data = home?.section2Data?.items ?? [];
|
const section2Data = home?.section2Data ?? null;
|
||||||
|
|
||||||
if (!home) return null;
|
if (!home) return null;
|
||||||
|
|
||||||
|
|
@ -32,7 +33,7 @@ export default function Home() {
|
||||||
<Banner
|
<Banner
|
||||||
title={banner?.title ?? ""}
|
title={banner?.title ?? ""}
|
||||||
desc={banner?.content}
|
desc={banner?.content}
|
||||||
backgroundImage={banner?.backgroundImage ?? "/images/bg-overview.png"}
|
backgroundImage={banner?.backgroundImage }
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Commercial */}
|
{/* Commercial */}
|
||||||
|
|
@ -41,9 +42,9 @@ export default function Home() {
|
||||||
}
|
}
|
||||||
|
|
||||||
{/* 首页名片 */}
|
{/* 首页名片 */}
|
||||||
<Section background="/images/bg-mask-card.png">
|
<Section background={section2Data?.backgroundImage}>
|
||||||
<div className={styles.cardsInner}>
|
<div className={styles.cardsInner}>
|
||||||
{section2Data.map((item: any, i: number) => (
|
{section2Data?.items?.map((item: any, i: number) => (
|
||||||
<motion.div
|
<motion.div
|
||||||
key={i}
|
key={i}
|
||||||
initial="hidden"
|
initial="hidden"
|
||||||
|
|
@ -169,7 +170,10 @@ function News() {
|
||||||
</h3>
|
</h3>
|
||||||
<p className={styles.newsItemSnippet} dangerouslySetInnerHTML={{ __html: item.snippet }} ></p>
|
<p className={styles.newsItemSnippet} dangerouslySetInnerHTML={{ __html: item.snippet }} ></p>
|
||||||
<div className={styles.newsItemDateWrap}>
|
<div className={styles.newsItemDateWrap}>
|
||||||
<span className={styles.newsItemDate}>{item.date}</span>
|
<span className={styles.newsItemDate}>{locale.startsWith("zh")
|
||||||
|
? dateFormat(item.date, "yyyy年MM月dd日")
|
||||||
|
: dateFormat(item.date, "yyyy-MM-dd")
|
||||||
|
}</span>
|
||||||
<ArrowRightOutlined className={styles.newsItemArrowIcon} style={{ fontSize: '12px' }} />
|
<ArrowRightOutlined className={styles.newsItemArrowIcon} style={{ fontSize: '12px' }} />
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ export const debounce = (func: (...args: any[]) => void, delay: number) => {
|
||||||
* @returns 日期字符串
|
* @returns 日期字符串
|
||||||
*/
|
*/
|
||||||
export const dateFormat = (date: Date | string, format: string) => {
|
export const dateFormat = (date: Date | string, format: string) => {
|
||||||
|
if(!date) return '';
|
||||||
const d = typeof date === 'string' ? new Date(date) : date;
|
const d = typeof date === 'string' ? new Date(date) : date;
|
||||||
if (Number.isNaN(d.getTime())) return '';
|
if (Number.isNaN(d.getTime())) return '';
|
||||||
const year = d.getFullYear();
|
const year = d.getFullYear();
|
||||||
|
|
|
||||||
|
|
@ -161,9 +161,16 @@ export function parsePageConfig(items: RawPageItem[]): {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const menuItems = filtered.filter((it) => it.tags === "menu");
|
const topMenuConfig = filtered.find((it) => it.tags === "top-menus");
|
||||||
const zhNavItems = buildNavItems(menuItems, "ZH", parsedContentMap);
|
let topMenuJson: any = null
|
||||||
const enNavItems = buildNavItems(menuItems, "EN", parsedContentMap);
|
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<string, any> = {};
|
const zhConfig: Record<string, any> = {};
|
||||||
|
|
@ -193,8 +200,8 @@ export function parsePageConfig(items: RawPageItem[]): {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
zhConfig.navItems = zhNavItems;
|
zhConfig.navItems = topMenuJson.ZH.items;
|
||||||
enConfig.navItems = enNavItems;
|
enConfig.navItems = topMenuJson.EN.items;
|
||||||
deepFallback(enConfig, zhConfig);
|
deepFallback(enConfig, zhConfig);
|
||||||
|
|
||||||
return { "zh-CN": zhConfig, "en-US": enConfig };
|
return { "zh-CN": zhConfig, "en-US": enConfig };
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue