This commit is contained in:
parent
187a034a22
commit
4ce17fb5f4
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -314,8 +314,8 @@
|
|||
}
|
||||
|
||||
.dropPanel {
|
||||
height: auto;
|
||||
padding: 1rem;
|
||||
height: 0;
|
||||
/* padding: 1rem; */
|
||||
}
|
||||
|
||||
.dropPanelLink {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ function TimelineItemRow({
|
|||
</div>
|
||||
<div className={`${styles.dotWrapper} ${isSelected ? styles.selected : ""}`}>
|
||||
<div className={styles.dot} />
|
||||
{isSelected && <div ref={dotLineRef} className={styles.dotLine} />}
|
||||
{isSelected && <div ref={dotLineRef} key={index} className={styles.dotLine} />}
|
||||
</div>
|
||||
<div ref={isRight ? contentSideRef : undefined} className={styles.side}>
|
||||
{isRight && (
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div>
|
||||
<Banner
|
||||
title={banner?.title ?? ""}
|
||||
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) => (
|
||||
|
|
@ -41,7 +45,7 @@ export default function About() {
|
|||
<div className={styles.links}>
|
||||
{item.links?.map((link: { label: string; path: string }) => (
|
||||
<span key={link.label}>
|
||||
<Link to={link.path}>{link.label}</Link>
|
||||
<Link to={getLinkPath(link)}>{link.label}</Link>
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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() {
|
|||
<Banner
|
||||
title={banner?.title ?? ""}
|
||||
desc={banner?.content}
|
||||
backgroundImage={banner?.backgroundImage ?? "/images/bg-overview.png"}
|
||||
backgroundImage={banner?.backgroundImage }
|
||||
/>
|
||||
|
||||
{/* Commercial */}
|
||||
|
|
@ -41,9 +42,9 @@ export default function Home() {
|
|||
}
|
||||
|
||||
{/* 首页名片 */}
|
||||
<Section background="/images/bg-mask-card.png">
|
||||
<Section background={section2Data?.backgroundImage}>
|
||||
<div className={styles.cardsInner}>
|
||||
{section2Data.map((item: any, i: number) => (
|
||||
{section2Data?.items?.map((item: any, i: number) => (
|
||||
<motion.div
|
||||
key={i}
|
||||
initial="hidden"
|
||||
|
|
@ -169,7 +170,10 @@ function News() {
|
|||
</h3>
|
||||
<p className={styles.newsItemSnippet} dangerouslySetInnerHTML={{ __html: item.snippet }} ></p>
|
||||
<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' }} />
|
||||
</div>
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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<string, any> = {};
|
||||
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Reference in New Issue