update
This commit is contained in:
parent
a71b1089f5
commit
11b4dd75b2
|
|
@ -45,6 +45,8 @@
|
||||||
"jest": "^27.4.3",
|
"jest": "^27.4.3",
|
||||||
"jest-resolve": "^27.4.2",
|
"jest-resolve": "^27.4.2",
|
||||||
"jest-watch-typeahead": "^1.0.0",
|
"jest-watch-typeahead": "^1.0.0",
|
||||||
|
"keepalive-for-react": "^5.0.7",
|
||||||
|
"keepalive-for-react-router": "^5.0.7",
|
||||||
"lenis": "^1.3.19",
|
"lenis": "^1.3.19",
|
||||||
"mime": "^4.0.7",
|
"mime": "^4.0.7",
|
||||||
"mini-css-extract-plugin": "^2.4.5",
|
"mini-css-extract-plugin": "^2.4.5",
|
||||||
|
|
@ -57,7 +59,6 @@
|
||||||
"postcss-preset-env": "^7.0.1",
|
"postcss-preset-env": "^7.0.1",
|
||||||
"prompts": "^2.4.2",
|
"prompts": "^2.4.2",
|
||||||
"react": "^19.1.0",
|
"react": "^19.1.0",
|
||||||
"react-activation": "^0.13.4",
|
|
||||||
"react-app-polyfill": "^3.0.0",
|
"react-app-polyfill": "^3.0.0",
|
||||||
"react-countup": "^6.5.3",
|
"react-countup": "^6.5.3",
|
||||||
"react-dev-utils": "^12.0.1",
|
"react-dev-utils": "^12.0.1",
|
||||||
|
|
|
||||||
169
src/Routes.tsx
169
src/Routes.tsx
|
|
@ -1,9 +1,6 @@
|
||||||
import Home from "@/pages/Home/index";
|
import Home from "@/pages/Home/index";
|
||||||
import MainLayout from "@/layouts/MainLayout";
|
import MainLayout from "@/layouts/MainLayout";
|
||||||
import { Navigate, createBrowserRouter } from "react-router-dom";
|
import { Navigate, createBrowserRouter } from "react-router-dom";
|
||||||
import { lazy, Suspense } from "react";
|
|
||||||
import { KeepAlive } from "react-activation";
|
|
||||||
|
|
||||||
|
|
||||||
import TermsOfUse from "@/pages/Others/TermsOfUse";
|
import TermsOfUse from "@/pages/Others/TermsOfUse";
|
||||||
import PrivacyPolicy from "@/pages/Others/PrivacyPolicy";
|
import PrivacyPolicy from "@/pages/Others/PrivacyPolicy";
|
||||||
|
|
@ -35,219 +32,115 @@ const routes = createBrowserRouter([
|
||||||
path: "/",
|
path: "/",
|
||||||
element: <MainLayout></MainLayout>,
|
element: <MainLayout></MainLayout>,
|
||||||
children: [
|
children: [
|
||||||
{ index: true, element: <KeepAlive id="home"><Home /></KeepAlive> },
|
{ index: true, element: <Home /> },
|
||||||
// 关于银泰
|
// 关于银泰
|
||||||
{
|
{
|
||||||
path: "about",
|
path: "about",
|
||||||
element: (
|
element: (
|
||||||
<NavigateReplace path="/about/overview">
|
<NavigateReplace path="/about/overview">
|
||||||
<About />
|
<About />
|
||||||
</NavigateReplace>
|
</NavigateReplace>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "about/overview",
|
path: "about/overview",
|
||||||
element: (
|
element: <About />,
|
||||||
<KeepAlive id="about-overview">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<About />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "about/history",
|
path: "about/history",
|
||||||
element: (
|
element: <AboutHistory />,
|
||||||
<KeepAlive id="about-history">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<AboutHistory />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "about/founder",
|
path: "about/founder",
|
||||||
element: (
|
element: <AboutFounder />,
|
||||||
<KeepAlive id="about-founder">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<AboutFounder />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
// 集团业务
|
// 集团业务
|
||||||
{
|
{
|
||||||
path: "business",
|
path: "business",
|
||||||
element: (
|
element: (
|
||||||
<NavigateReplace path="/business/commercial-group">
|
<NavigateReplace path="/business/commercial-group">
|
||||||
<Suspense fallback={null}>
|
<BusinessCommercialGroup />
|
||||||
<BusinessCommercialGroup />
|
|
||||||
</Suspense>
|
|
||||||
</NavigateReplace>
|
</NavigateReplace>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "business/commercial-group",
|
path: "business/commercial-group",
|
||||||
element: (
|
element: <BusinessCommercialGroup />,
|
||||||
<KeepAlive id="business-commercial-group">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<BusinessCommercialGroup />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "business/commercial-group/:detailType",
|
path: "business/commercial-group/:detailType",
|
||||||
element: (
|
element: <BusinessCommercialGroupDetail />,
|
||||||
<KeepAlive id="business-commercial-group-detail">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<BusinessCommercialGroupDetail />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "business/base-group",
|
path: "business/base-group",
|
||||||
element: (
|
element: <BusinessBaseGroup />,
|
||||||
<KeepAlive id="business-base-group">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<BusinessBaseGroup />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "business/realty-group",
|
path: "business/realty-group",
|
||||||
element: (
|
element: <BusinessRealtyGroup />,
|
||||||
<KeepAlive id="business-realty-group">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<BusinessRealtyGroup />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "business/invest-group",
|
path: "business/invest-group",
|
||||||
element: (
|
element: <BusinessInvestGroup />,
|
||||||
<KeepAlive id="business-invest-group">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<BusinessInvestGroup />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "business/ruijing-group",
|
path: "business/ruijing-group",
|
||||||
element: (
|
element: <BusinessRujingGroup />,
|
||||||
<KeepAlive id="business-ruijing-group">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<BusinessRujingGroup />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
// 社会责任
|
// 社会责任
|
||||||
{
|
{
|
||||||
path: "social",
|
path: "social",
|
||||||
element: (
|
element: (
|
||||||
<NavigateReplace path="/social/sustainability">
|
<NavigateReplace path="/social/sustainability">
|
||||||
<Suspense fallback={null}>
|
<SocialSustainability />
|
||||||
<SocialSustainability />
|
|
||||||
</Suspense>
|
|
||||||
</NavigateReplace>
|
</NavigateReplace>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "social/sustainability",
|
path: "social/sustainability",
|
||||||
element: (
|
element: <SocialSustainability />,
|
||||||
<KeepAlive id="social-sustainability">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<SocialSustainability />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "social/foundation",
|
path: "social/foundation",
|
||||||
element: (
|
element: <SocialFoundation />,
|
||||||
<KeepAlive id="social-foundation">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<SocialFoundation />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
// 新闻中心
|
// 新闻中心
|
||||||
{
|
{
|
||||||
path: "news",
|
path: "news",
|
||||||
element: (
|
element: (
|
||||||
<NavigateReplace path="/news/public">
|
<NavigateReplace path="/news/public">
|
||||||
<Suspense fallback={null}>
|
<NewsPublic />
|
||||||
<NewsPublic />
|
|
||||||
</Suspense>
|
|
||||||
</NavigateReplace>
|
</NavigateReplace>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "news/public",
|
path: "news/public",
|
||||||
element: (
|
element: <NewsPublic />,
|
||||||
<KeepAlive id="news-public">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<NewsPublic />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "news/media",
|
path: "news/media",
|
||||||
element: (
|
element: <NewsMedia />,
|
||||||
<KeepAlive id="news-media">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<NewsMedia />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "news/detail/:id",
|
path: "news/detail/:id",
|
||||||
element: (
|
element: <NewsDetail />,
|
||||||
<KeepAlive id="news-detail">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<NewsDetail />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
// 加入银泰
|
// 加入银泰
|
||||||
{
|
{
|
||||||
path: "join",
|
path: "join",
|
||||||
element: (
|
element: (
|
||||||
<NavigateReplace path="/join/culture">
|
<NavigateReplace path="/join/culture">
|
||||||
<Suspense fallback={null}>
|
<JoinCulture />
|
||||||
<JoinCulture />
|
|
||||||
</Suspense>
|
|
||||||
</NavigateReplace>
|
</NavigateReplace>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "join/culture",
|
path: "join/culture",
|
||||||
element: (
|
element: <JoinCulture />,
|
||||||
<KeepAlive id="join-culture">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<JoinCulture />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "join/campus",
|
path: "join/campus",
|
||||||
element: (
|
element: <JoinCampus />,
|
||||||
<KeepAlive id="join-campus">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<JoinCampus />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "join/campus/detail/:id",
|
path: "join/campus/detail/:id",
|
||||||
|
|
@ -259,21 +152,15 @@ const routes = createBrowserRouter([
|
||||||
// 物业服务
|
// 物业服务
|
||||||
{
|
{
|
||||||
path: "/property-service",
|
path: "/property-service",
|
||||||
element: (
|
element: <PropertyService />,
|
||||||
<KeepAlive id="property-service">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<PropertyService />
|
|
||||||
</Suspense>
|
|
||||||
</KeepAlive>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
// 搜索
|
// 搜索
|
||||||
{ path: "/search", element: <KeepAlive id="search"><Search /></KeepAlive> },
|
{ path: "/search", element: <Search /> },
|
||||||
// 使用条款 隐私保护 审计举报 网站地图
|
// 使用条款 隐私保护 审计举报 网站地图
|
||||||
{ path: "/terms-of-use", element: <KeepAlive id="terms-of-use"><TermsOfUse /></KeepAlive> },
|
{ path: "/terms-of-use", element: <TermsOfUse /> },
|
||||||
{ path: "/privacy-policy", element: <KeepAlive id="privacy-policy"><PrivacyPolicy /></KeepAlive> },
|
{ path: "/privacy-policy", element: <PrivacyPolicy /> },
|
||||||
{ path: "/audit-report", element: <KeepAlive id="audit-report"><AuditReport /></KeepAlive> },
|
{ path: "/audit-report", element: <AuditReport /> },
|
||||||
{ path: "/site-map", element: <KeepAlive id="site-map"><SiteMap /></KeepAlive> },
|
{ path: "/site-map", element: <SiteMap /> },
|
||||||
{ path: "/contact-us", element: <Navigate to="/news/media"></Navigate> },
|
{ path: "/contact-us", element: <Navigate to="/news/media"></Navigate> },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
import { Outlet } from "react-router-dom";
|
|
||||||
import Header from "./Header";
|
import Header from "./Header";
|
||||||
import Footer from "./Footer";
|
import Footer from "./Footer";
|
||||||
import useHashScroll from "@/hooks/useHashScroll";
|
import useHashScroll from "@/hooks/useHashScroll";
|
||||||
import { AliveScope } from "react-activation";
|
import KeepAliveRouteOutlet from "keepalive-for-react-router";
|
||||||
|
|
||||||
export default function MainLayout() {
|
export default function MainLayout() {
|
||||||
useHashScroll()
|
useHashScroll()
|
||||||
|
|
@ -11,9 +10,7 @@ export default function MainLayout() {
|
||||||
<div className="layout">
|
<div className="layout">
|
||||||
<Header />
|
<Header />
|
||||||
<main className="container">
|
<main className="container">
|
||||||
<AliveScope>
|
<KeepAliveRouteOutlet />
|
||||||
<Outlet />
|
|
||||||
</AliveScope>
|
|
||||||
</main>
|
</main>
|
||||||
<Footer />
|
<Footer />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue