feat:init
This commit is contained in:
1 parent
53d0eeac6b
commit
ae0c050010
494 files changed
+17701
-2318
No files matched your search
+35
-21
@@ -1,40 +1,54 @@
|
||||
import { createHashRouter, Navigate } from "react-router-dom";
|
||||
import { createHashRouter, Navigate, RouteObject } from "react-router-dom";
|
||||
|
||||
import Home from "@/pages/Home";
|
||||
import Menu from "@/pages/Menu";
|
||||
import NotFound from "@/pages/NotFound";
|
||||
import Publicity from "@/pages/Publicity";
|
||||
import Content from "@/pages/Content";
|
||||
import Guide from "@/pages/Guide";
|
||||
/**
|
||||
* 应用路由配置
|
||||
* 使用 React Router v7 的 createHashRouter
|
||||
*/
|
||||
const router = createHashRouter([
|
||||
import Menu from "@/pages/Menu";
|
||||
import Entrance from "@/pages/entrance";
|
||||
|
||||
//各个故居路由
|
||||
import { ChenyunRoutes, MaozedongRoutes, SunzhongshanRoutes, HuangyanpeiRoutes, LuxunRoutes } from "./modules";
|
||||
|
||||
const baseRoutes: RouteObject[] = [
|
||||
{
|
||||
path: "/",
|
||||
element: <Navigate to="/home" replace />,
|
||||
//重定向
|
||||
},
|
||||
{
|
||||
path: "/home",
|
||||
element: <Home />,
|
||||
},
|
||||
/**
|
||||
* 沪上故居-分为四个类型-8个故居
|
||||
* 类型:1:革命先驱、文化名人、艺术名家、经济巨擘
|
||||
* 每个类型下有2个故居
|
||||
* 革命先驱:毛泽东、孙中山
|
||||
* 文化名人:鲁迅、黄炎培
|
||||
* 艺术名家:聂耳、刘海栗
|
||||
* 经济巨擘:荣德生、陈云
|
||||
*/
|
||||
{
|
||||
path: "/menu",
|
||||
element: <Menu />,
|
||||
},
|
||||
{
|
||||
path: "/guide",
|
||||
element: <Guide />,
|
||||
},
|
||||
{
|
||||
path: "/publicity",
|
||||
element: <Publicity />,
|
||||
},
|
||||
{
|
||||
path: "/content/:id",
|
||||
element: <Content />,
|
||||
path: "/entrance/:moduleName",
|
||||
element: <Entrance />,
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 应用路由配置
|
||||
* 使用 React Router v7 的 createHashRouter
|
||||
*/
|
||||
const router = createHashRouter([
|
||||
//基础路由
|
||||
...baseRoutes,
|
||||
//名人故居
|
||||
...ChenyunRoutes,
|
||||
...MaozedongRoutes,
|
||||
...SunzhongshanRoutes,
|
||||
...HuangyanpeiRoutes,
|
||||
...LuxunRoutes,
|
||||
{
|
||||
path: "*",
|
||||
element: <NotFound />,
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
import { lazy } from "react";
|
||||
import { RouteObject } from "react-router-dom";
|
||||
import { ResidenceLayout } from "@/components/layout";
|
||||
|
||||
const HomePage = lazy(() => import("@/pages/chenyun/home"));
|
||||
const ChenyunPlace1 = lazy(() => import("@/pages/chenyun/place/place1"));
|
||||
const ChenyunPlace2 = lazy(() => import("@/pages/chenyun/place/place2"));
|
||||
const ChenyunPlace3 = lazy(() => import("@/pages/chenyun/place/place3"));
|
||||
const ChenyunPlace4 = lazy(() => import("@/pages/chenyun/place/place4"));
|
||||
const ChenyunPlace5 = lazy(() => import("@/pages/chenyun/place/place5"));
|
||||
const ChenyunPlace6 = lazy(() => import("@/pages/chenyun/place/place6"));
|
||||
const ChenyunPlace7 = lazy(() => import("@/pages/chenyun/place/place7"));
|
||||
const ChenyunPlace8 = lazy(() => import("@/pages/chenyun/place/place8"));
|
||||
const ChenyunPlace9 = lazy(() => import("@/pages/chenyun/place/place9"));
|
||||
const ChenyunReflection = lazy(() => import("@/pages/chenyun/reflection"));
|
||||
const ChenyunInternalization = lazy(
|
||||
() => import("@/pages/chenyun/internalization")
|
||||
);
|
||||
|
||||
//陈云 router
|
||||
// 路径格式:/:moduleName/chenyun/:page
|
||||
export const ChenyunRoutes: RouteObject[] = [
|
||||
{
|
||||
path: "/:moduleName/chenyun",
|
||||
element: <ResidenceLayout />,
|
||||
children: [
|
||||
{
|
||||
index: true,
|
||||
element: <HomePage />,
|
||||
handle: {
|
||||
videoSrc: "video/chenyun/lukou.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "home",
|
||||
element: <HomePage />,
|
||||
handle: {
|
||||
videoSrc: "video/chenyun/chenyun_lukou.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place1",
|
||||
element: <ChenyunPlace1 />,
|
||||
handle: {
|
||||
videoSrc: "video/chenyun/chenyun_01.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place2",
|
||||
element: <ChenyunPlace2 />,
|
||||
handle: {
|
||||
videoSrc: "video/chenyun/cunyun_02.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place3",
|
||||
element: <ChenyunPlace3 />,
|
||||
handle: {
|
||||
videoSrc: "video/chenyun/chenyun_03.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place4",
|
||||
element: <ChenyunPlace4 />,
|
||||
handle: {
|
||||
videoSrc: "video/chenyun/chenyun_05.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place5",
|
||||
element: <ChenyunPlace5 />,
|
||||
handle: {
|
||||
videoSrc: "video/chenyun/chenyun_06.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place6",
|
||||
element: <ChenyunPlace6 />,
|
||||
handle: {
|
||||
videoSrc: "video/chenyun/chenyun_08.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place7",
|
||||
element: <ChenyunPlace7 />,
|
||||
handle: {
|
||||
videoSrc: "video/chenyun/chenyun_09.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place8",
|
||||
element: <ChenyunPlace8 />,
|
||||
handle: {
|
||||
videoSrc: "video/chenyun/chenyun_12.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place9",
|
||||
element: <ChenyunPlace9 />,
|
||||
handle: {
|
||||
videoSrc: "video/chenyun/chenyun_13.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "reflection",
|
||||
element: <ChenyunReflection />,
|
||||
},
|
||||
{
|
||||
path: "internalization",
|
||||
element: <ChenyunInternalization />,
|
||||
// handle: {
|
||||
// videoSrc: "video/chenyun/chenyun_neihua.mp4",
|
||||
// },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,117 @@
|
||||
import { lazy } from "react";
|
||||
import { RouteObject } from "react-router-dom";
|
||||
import { ResidenceLayout } from "@/components/layout";
|
||||
|
||||
const HomePage = lazy(() => import("@/pages/huangyanpei/home"));
|
||||
const HuangyanpeiPlace1 = lazy(() => import("@/pages/huangyanpei/place/place1"));
|
||||
const HuangyanpeiPlace2 = lazy(() => import("@/pages/huangyanpei/place/place2"));
|
||||
const HuangyanpeiPlace3 = lazy(() => import("@/pages/huangyanpei/place/place3"));
|
||||
const HuangyanpeiPlace4 = lazy(() => import("@/pages/huangyanpei/place/place4"));
|
||||
const HuangyanpeiPlace5 = lazy(() => import("@/pages/huangyanpei/place/place5"));
|
||||
const HuangyanpeiPlace6 = lazy(() => import("@/pages/huangyanpei/place/place6"));
|
||||
const HuangyanpeiReflection = lazy(
|
||||
() => import("@/pages/huangyanpei/reflection/scene1")
|
||||
);
|
||||
const HuangyanpeiReflection2 = lazy(
|
||||
() => import("@/pages/huangyanpei/reflection/scene2")
|
||||
);
|
||||
const HuangyanpeiReflection3 = lazy(
|
||||
() => import("@/pages/huangyanpei/reflection/scene3")
|
||||
);
|
||||
const HuangyanpeiReflection4 = lazy(
|
||||
() => import("@/pages/huangyanpei/reflection/scene4")
|
||||
);
|
||||
const HuangyanpeiInternalization = lazy(
|
||||
() => import("@/pages/huangyanpei/internalization")
|
||||
);
|
||||
|
||||
//黄炎培 router
|
||||
// 路径格式:/:moduleName/huangyanpei/:page
|
||||
export const HuangyanpeiRoutes: RouteObject[] = [
|
||||
{
|
||||
path: "/:moduleName/huangyanpei",
|
||||
element: <ResidenceLayout />,
|
||||
children: [
|
||||
{
|
||||
index: true,
|
||||
element: <HomePage />,
|
||||
handle: {
|
||||
videoSrc: "video/huangyanpei/home.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "home",
|
||||
element: <HomePage />,
|
||||
handle: {
|
||||
videoSrc: "video/huangyanpei/home.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place1",
|
||||
element: <HuangyanpeiPlace1 />,
|
||||
handle: {
|
||||
videoSrc: "video/huangyanpei/place1.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place2",
|
||||
element: <HuangyanpeiPlace2 />,
|
||||
handle: {
|
||||
videoSrc: "video/huangyanpei/place2.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place3",
|
||||
element: <HuangyanpeiPlace3 />,
|
||||
handle: {
|
||||
videoSrc: "video/huangyanpei/place3.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place4",
|
||||
element: <HuangyanpeiPlace4 />,
|
||||
handle: {
|
||||
videoSrc: "video/huangyanpei/place4.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place5",
|
||||
element: <HuangyanpeiPlace5 />,
|
||||
handle: {
|
||||
videoSrc: "video/huangyanpei/place5.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place6",
|
||||
element: <HuangyanpeiPlace6 />,
|
||||
handle: {
|
||||
videoSrc: "video/huangyanpei/place6.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "reflection",
|
||||
element: <HuangyanpeiReflection />,
|
||||
},
|
||||
{
|
||||
path: "reflection2",
|
||||
element: <HuangyanpeiReflection2 />,
|
||||
},
|
||||
{
|
||||
path: "reflection3",
|
||||
element: <HuangyanpeiReflection3 />,
|
||||
},
|
||||
{
|
||||
path: "reflection4",
|
||||
element: <HuangyanpeiReflection4 />,
|
||||
},
|
||||
{
|
||||
path: "internalization",
|
||||
element: <HuangyanpeiInternalization />,
|
||||
handle: {
|
||||
videoSrc: "video/huangyanpei/internalization.mp4",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
export * from "./chenyun";
|
||||
export * from "./maozedong";
|
||||
export * from "./sunzhongshan";
|
||||
export * from "./huangyanpei";
|
||||
export * from "./luxun";
|
||||
@@ -0,0 +1,86 @@
|
||||
import { lazy } from "react";
|
||||
import { RouteObject } from "react-router-dom";
|
||||
import { ResidenceLayout } from "@/components/layout";
|
||||
|
||||
const HomePage = lazy(() => import("@/pages/luxun/home"));
|
||||
const LuxunPlace1 = lazy(() => import("@/pages/luxun/place/place1"));
|
||||
const LuxunPlace2 = lazy(() => import("@/pages/luxun/place/place2"));
|
||||
const LuxunPlace3 = lazy(() => import("@/pages/luxun/place/place3"));
|
||||
const LuxunPlace4 = lazy(() => import("@/pages/luxun/place/place4"));
|
||||
const LuxunPlace5 = lazy(() => import("@/pages/luxun/place/place5"));
|
||||
const LuxunReflection = lazy(() => import("@/pages/luxun/reflection"));
|
||||
const LuxunInternalization = lazy(
|
||||
() => import("@/pages/luxun/internalization")
|
||||
);
|
||||
|
||||
//鲁迅 router
|
||||
// 路径格式:/:moduleName/luxun/:page
|
||||
export const LuxunRoutes: RouteObject[] = [
|
||||
{
|
||||
path: "/:moduleName/luxun",
|
||||
element: <ResidenceLayout />,
|
||||
children: [
|
||||
{
|
||||
index: true,
|
||||
element: <HomePage />,
|
||||
handle: {
|
||||
videoSrc: "video/luxun/home.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "home",
|
||||
element: <HomePage />,
|
||||
handle: {
|
||||
videoSrc: "video/luxun/home.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place1",
|
||||
element: <LuxunPlace1 />,
|
||||
handle: {
|
||||
videoSrc: "video/luxun/place1.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place2",
|
||||
element: <LuxunPlace2 />,
|
||||
handle: {
|
||||
videoSrc: "video/luxun/place2.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place3",
|
||||
element: <LuxunPlace3 />,
|
||||
handle: {
|
||||
videoSrc: "video/luxun/place3.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place4",
|
||||
element: <LuxunPlace4 />,
|
||||
handle: {
|
||||
videoSrc: "video/luxun/place4.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place5",
|
||||
element: <LuxunPlace5 />,
|
||||
handle: {
|
||||
videoSrc: "video/luxun/place5.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "reflection",
|
||||
element: <LuxunReflection />,
|
||||
},
|
||||
{
|
||||
path: "internalization",
|
||||
element: <LuxunInternalization />,
|
||||
handle: {
|
||||
videoSrc: "video/luxun/internalization.mp4",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import { lazy } from "react";
|
||||
import { RouteObject } from "react-router-dom";
|
||||
import { ResidenceLayout } from "@/components/layout";
|
||||
import type { VideoRouteHandle } from "../types";
|
||||
|
||||
const DemoPage = lazy(() => import("@/pages/maozedong/demo"));
|
||||
const HomePage = lazy(() => import("@/pages/maozedong/home"));
|
||||
|
||||
//毛泽东 router
|
||||
// 路径格式:/:moduleName/:starName/:page
|
||||
export const MaozedongRoutes: RouteObject[] = [
|
||||
{
|
||||
path: "/:moduleName/maozedong",
|
||||
element: <ResidenceLayout />,
|
||||
children: [
|
||||
{
|
||||
index: true,
|
||||
element: <HomePage />,
|
||||
handle: {
|
||||
videoSrc: "video/maozedong/mzd_guju_map.mp4",
|
||||
} as VideoRouteHandle,
|
||||
},
|
||||
{
|
||||
path: "home",
|
||||
element: <HomePage />,
|
||||
handle: {
|
||||
videoSrc: "video/maozedong/mzd_guju_map.mp4",
|
||||
} as VideoRouteHandle,
|
||||
},
|
||||
//演示视频
|
||||
{
|
||||
path: "demo",
|
||||
element: <DemoPage />,
|
||||
// 没有 handle.videoSrc,直接渲染内容
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,78 @@
|
||||
import { lazy } from "react";
|
||||
import { RouteObject } from "react-router-dom";
|
||||
import { ResidenceLayout } from "@/components/layout";
|
||||
|
||||
const HomePage = lazy(() => import("@/pages/sunzhongshan/home"));
|
||||
const SunzhongshanPlace1 = lazy(() => import("@/pages/sunzhongshan/place/place1"));
|
||||
const SunzhongshanPlace2 = lazy(() => import("@/pages/sunzhongshan/place/place2"));
|
||||
const SunzhongshanPlace3 = lazy(() => import("@/pages/sunzhongshan/place/place3"));
|
||||
const SunzhongshanPlace4 = lazy(() => import("@/pages/sunzhongshan/place/place4"));
|
||||
const SunzhongshanReflection = lazy(() => import("@/pages/sunzhongshan/reflection"));
|
||||
const SunzhongshanInternalization = lazy(
|
||||
() => import("@/pages/sunzhongshan/internalization")
|
||||
);
|
||||
|
||||
//孙中山 router
|
||||
// 路径格式:/:moduleName/sunzhongshan/:page
|
||||
export const SunzhongshanRoutes: RouteObject[] = [
|
||||
{
|
||||
path: "/:moduleName/sunzhongshan",
|
||||
element: <ResidenceLayout />,
|
||||
children: [
|
||||
{
|
||||
index: true,
|
||||
element: <HomePage />,
|
||||
handle: {
|
||||
videoSrc: "video/sunzhongshan/home.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "home",
|
||||
element: <HomePage />,
|
||||
handle: {
|
||||
videoSrc: "video/sunzhongshan/home.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place1",
|
||||
element: <SunzhongshanPlace1 />,
|
||||
handle: {
|
||||
videoSrc: "video/sunzhongshan/place1.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place2",
|
||||
element: <SunzhongshanPlace2 />,
|
||||
handle: {
|
||||
videoSrc: "video/sunzhongshan/place2.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place3",
|
||||
element: <SunzhongshanPlace3 />,
|
||||
handle: {
|
||||
videoSrc: "video/sunzhongshan/place3.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "place4",
|
||||
element: <SunzhongshanPlace4 />,
|
||||
handle: {
|
||||
videoSrc: "video/sunzhongshan/place4.mp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "reflection",
|
||||
element: <SunzhongshanReflection />,
|
||||
},
|
||||
{
|
||||
path: "internalization",
|
||||
element: <SunzhongshanInternalization />,
|
||||
handle: {
|
||||
videoSrc: "video/sunzhongshan/internalization.mp4",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* 视频路由 Handle 类型定义
|
||||
* 用于在路由配置中传递视频路径
|
||||
*/
|
||||
export interface VideoRouteHandle {
|
||||
videoSrc?: string;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user