diff --git a/package.json b/package.json index 2a9e9c2..0a145c9 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "rollup-plugin-visualizer": "^5.9.0", "terser": ">=5.4.0 <6.0.0", "typescript": "^4.9.3", - "vite": "^4.0.0", + "vite": "4.0.3", "vite-plugin-compression": "^0.5.1" } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 47c273e..20f946a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,7 +38,7 @@ specifiers: rollup-plugin-visualizer: ^5.9.0 terser: '>=5.4.0 <6.0.0' typescript: ^4.9.3 - vite: ^4.0.0 + vite: 4.0.3 vite-plugin-compression: ^0.5.1 whatwg-fetch: ^3.6.2 diff --git a/readme.md b/readme.md index 0988ee8..2496016 100644 --- a/readme.md +++ b/readme.md @@ -23,34 +23,39 @@ $ npm run build $ npm run preview ``` +## 时间线 + +- 15 号->完成整体布局 +- 22 号->上线 + ## 已完成功能 -- [x] 二创图feed流 +- [x] 二创图 feed 流 - [x] 滚动加载 -- [x] 基础tag栏展示 -- [x] tag栏用户自定义排序 +- [x] 基础 tag 栏展示 +- [x] tag 栏用户自定义排序 - [x] 视频接口测通 +- [x] tag 栏放缩动画 ## TODO ### 急急急 -- [ ] 总体layout布局 -- [ ] 总体font-family,各种layout下font-size等全局属性的设定 -- [ ] tag栏放缩动画 -- [ ] 理解完视频接口的q等属性特点 +- [ ] 总体 layout 布局 +- [ ] 总体 font-family,各种 layout 下 font-size 等全局属性的设定 +- [ ] 理解完视频接口的 q 等属性特点 +- [ ] UI 设计 ### 现在还没定论的 - [ ] 图片接口还没有出 - [ ] 二创图瀑布流页面 -- [ ] UI设计 - [ ] 接口测试 - [ ] 封闭测试 ### 后续有空可以添加的 - [ ] 主题设置 -- [ ] 跳转app +- [ ] 跳转 app - [ ] 用户系统 - [ ] 拉黑 diff --git a/src/components/proview/imageSize.tsx b/src/components/proview/imageSize.tsx index 701c5d0..70c6ed2 100644 --- a/src/components/proview/imageSize.tsx +++ b/src/components/proview/imageSize.tsx @@ -1,21 +1,13 @@ -import { - useContext, - useState, - createContext, - useEffect, - ReactElement, -} from "react"; +import { useContext, useState, createContext, useEffect } from "react"; import { thorttleFn } from "@utils/index"; +import { ReactChildrenType } from "./type"; export const image_order_width = 200; const ImageContext = createContext<{ isShouldchangeSize: boolean }>({ isShouldchangeSize: false, }); -type ImageProviewProps = { - children: ReactElement; -}; -const ImageShouldResizeProview = ({ children }: ImageProviewProps) => { +const ImageShouldResizeProview = ({ children }: ReactChildrenType) => { const [isShouldchangeSize, setIs] = useState(false); useEffect(() => { const handleWindowResize = () => { diff --git a/src/components/proview/navShow.tsx b/src/components/proview/navShow.tsx new file mode 100644 index 0000000..832657e --- /dev/null +++ b/src/components/proview/navShow.tsx @@ -0,0 +1,23 @@ +import { createContext, useContext, useState } from "react"; +import { Flipper } from "react-flip-toolkit"; +import { ReactChildrenType } from "./type"; + +const NavContext = createContext({ + showed: false, + handlerChangeShow: () => {}, +}); +const NavShowProview = ({ children }: ReactChildrenType) => { + const [showed, set] = useState(false), + handlerChangeShow = () => set((showed) => !showed); + return ( + + + {children} + + + ); +}; + +export const useNavShowed = () => useContext(NavContext); + +export default NavShowProview; diff --git a/src/components/proview/screenSize.tsx b/src/components/proview/screenSize.tsx index 865792a..d6b39f2 100644 --- a/src/components/proview/screenSize.tsx +++ b/src/components/proview/screenSize.tsx @@ -1,12 +1,7 @@ import { Breakpoint } from "@mui/material"; import { useScreenMatchSize } from "@utils/hooks/match"; -import { - useContext, - useState, - createContext, - useEffect, - ReactElement, -} from "react"; +import { ReactChildrenType } from "./type"; +import { useContext, createContext } from "react"; const size_list: Breakpoint[] = ["lg", "md", "sm", "xs"]; const ScreenContext = createContext( @@ -22,11 +17,8 @@ type ScreenContextType = { sm: boolean; xs: boolean; }; -type ProviewProps = { - children: ReactElement; -}; -const ScreenProview = ({ children }: ProviewProps) => { +const ScreenProview = ({ children }: ReactChildrenType) => { const ScreenSize: ScreenContextType = size_list.reduce((preObj, size) => { //@ts-ignore preObj[size] = useScreenMatchSize(size); diff --git a/src/components/proview/tagSelect.tsx b/src/components/proview/tagSelect.tsx index 21a53ac..0883347 100644 --- a/src/components/proview/tagSelect.tsx +++ b/src/components/proview/tagSelect.tsx @@ -1,16 +1,7 @@ import { NavQueryItemType } from "@routers/layout/nav/tools"; -import { - useContext, - useState, - createContext, - useEffect, - ReactElement, - useReducer, -} from "react"; +import { ReactChildrenType } from "./type"; +import { useContext, createContext, useReducer } from "react"; -type TagSelectProps = { - children: ReactElement; -}; interface TagStates { tags: NavQueryItemType[]; } @@ -43,7 +34,7 @@ function reducer(state: TagStates, action: TagsAction) { return state; } } -const TagSelectProview = ({ children }: TagSelectProps) => { +const TagSelectProview = ({ children }: ReactChildrenType) => { const [tags, tagsDispath] = useReducer(reducer, { tags: [] as NavQueryItemType[], }), diff --git a/src/components/proview/type.tsx b/src/components/proview/type.tsx new file mode 100644 index 0000000..080be35 --- /dev/null +++ b/src/components/proview/type.tsx @@ -0,0 +1,5 @@ +import { ReactElement } from "react"; + +export type ReactChildrenType = { + children: ReactElement; +}; diff --git a/src/index.less b/src/index.less index 6fac532..87660c6 100644 --- a/src/index.less +++ b/src/index.less @@ -8,10 +8,4 @@ margin: 0 auto; padding: 0 8px; max-width: 1200px; - - // .element-item { - // min-width: 200px; - // box-sizing: border-box; - // padding: 0 5px; - // } } \ No newline at end of file diff --git a/src/main.tsx b/src/main.tsx index 6d1d710..5fe23f3 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,24 +1,19 @@ -import React, { lazy, Suspense } from "react"; import ReactDOM from "react-dom/client"; import { createBrowserRouter, RouterProvider } from "react-router-dom"; import VideoPage from "./routers/video"; import "./index.less"; -import ReadPage from "./routers/read"; import Layout from "./routers/layout"; import PhotoPage from "./routers/photo"; import ErrorPage from "./routers/error"; import ScreenProview from "@components/proview/screenSize"; import TagSelectProview from "@components/proview/tagSelect"; -// const ReadPage = lazy(() => import("./routers/read")), -// Layout = lazy(() => import("./routers/layout")), -// PhotoPage = lazy(() => import("./routers/photo")), -// ErrorPage = lazy(() => import("./routers/error")); //ployfill import "intersection-observer"; import "./normalize.css"; import "loading-attribute-polyfill"; import "whatwg-fetch"; +import NavShowProview from "@components/proview/navShow"; const router = createBrowserRouter([ { path: "/", @@ -35,18 +30,13 @@ const router = createBrowserRouter([ { //默认页面 index: true, - element: , + element: , }, { // video瀑布流展示页面 path: "video", element: , }, - { - // 二创文章瀑布流展示页面 - path: "read", - element: , - }, { // 二创图片瀑布流展示页面 path: "photo", @@ -59,14 +49,11 @@ const router = createBrowserRouter([ ]); ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( - // - // - + + + - // - - // ); diff --git a/src/routers/layout/header.tsx b/src/routers/layout/header.tsx index cf45ce0..fcd263d 100644 --- a/src/routers/layout/header.tsx +++ b/src/routers/layout/header.tsx @@ -1,13 +1,5 @@ import SearchSharpIcon from "@mui/icons-material/SearchSharp"; -import { - Outlet, - NavLink, - useLoaderData, - Form, - redirect, - useLocation, - useSubmit, -} from "react-router-dom"; +import { Form } from "react-router-dom"; import Header_Nav from "./nav"; import styles from "./layout.module.less"; import { useFocus } from "./hooks"; diff --git a/src/routers/layout/index.tsx b/src/routers/layout/index.tsx index fa5e647..b35cfc1 100644 --- a/src/routers/layout/index.tsx +++ b/src/routers/layout/index.tsx @@ -1,24 +1,19 @@ -import { - Outlet, - NavLink, - useLoaderData, - Form, - redirect, - useNavigation, - useSubmit, -} from "react-router-dom"; +import { Flipped } from "react-flip-toolkit"; +import { Outlet } from "react-router-dom"; import Header from "./header"; export default function Layout() { return ( <>
-
-
- -
-
+ +
+
+ +
+
+
); } diff --git a/src/routers/layout/layout.module.less b/src/routers/layout/layout.module.less index e0bd230..9dad787 100644 --- a/src/routers/layout/layout.module.less +++ b/src/routers/layout/layout.module.less @@ -1,8 +1,3 @@ -.header { - // transition: height 1s linear; -} - - .search-box { position: relative; margin: 0 8px; diff --git a/src/routers/layout/nav/index.tsx b/src/routers/layout/nav/index.tsx index fc1838c..dfa2291 100644 --- a/src/routers/layout/nav/index.tsx +++ b/src/routers/layout/nav/index.tsx @@ -14,14 +14,10 @@ import { } from "@dnd-kit/core"; import { arrayMove, SortableContext, useSortable } from "@dnd-kit/sortable"; import { CSS } from "@dnd-kit/utilities"; -import { - restrictToHorizontalAxis, - restrictToParentElement, -} from "@dnd-kit/modifiers"; +import { restrictToParentElement } from "@dnd-kit/modifiers"; import styles from "./nav.module.less"; -import { FC, useState, useEffect, useMemo, memo } from "react"; -import { Pick } from "@utils/index"; -import { Flipped, Flipper } from "react-flip-toolkit"; +import { FC, useState, useMemo, memo } from "react"; +import { Flipped } from "react-flip-toolkit"; import { NavListItemType, NavRouterItemType, @@ -30,11 +26,12 @@ import { } from "./tools"; import { setLocalstorage } from "../tools"; import { useTagsSelected } from "@components/proview/tagSelect"; -//todo 拆分组件 +import { useNavShowed } from "../../../components/proview/navShow"; export default function Header_Nav() { const [navLists, setLists] = useNavList(); //tag区是否展开 - const [showed, setShow] = useState(false); + // const [showed, setShow] = useState(false); + const { showed } = useNavShowed(); //拖拽事件绑定 const sensors = useSensors( // 鼠标点击 @@ -76,42 +73,38 @@ export default function Header_Nav() { [navLists] ); return ( - - -
- - - - {ComRes} - setShow((show) => !show)} /> - - - -
-
-
+ +
+ + + + {ComRes} + + + + +
+
); } -const NavInViewItem: FC<{ - handlerClick: React.MouseEventHandler; -}> = ({ handlerClick }) => { +const NavInViewItem = () => { //最后一个span是否可见 const { ref, inView } = useInView({ initialInView: true }); + const { handlerChangeShow } = useNavShowed(); return ( <>
= memo((props) => { ); }); //todo:修复展示更多栏的bug +//todo:拆分组件 +//todo:点击事件后修改icon diff --git a/src/routers/layout/nav/nav.module.less b/src/routers/layout/nav/nav.module.less index 41601e3..51817cc 100644 --- a/src/routers/layout/nav/nav.module.less +++ b/src/routers/layout/nav/nav.module.less @@ -2,7 +2,7 @@ position: relative; overflow: hidden; margin: 10px; - background-color: aquamarine; + background-color: #fff; .navstack { overflow-x: auto; @@ -16,8 +16,6 @@ @itemWidth: 80px; @itemMarginHalfWidth: 8px; @itemMarginHalfHeight: 4px; - // grid布局 - // grid-template-columns: repeat(auto-fit, minmax(@itemWidth+2*@itemMarginHalfWidth, 1fr)); &>* { margin: @itemMarginHalfHeight @itemMarginHalfWidth; @@ -33,17 +31,12 @@ } } - &-filter-tag { - // width: @itemWidth; - // flex: 0 0 @itemWidth; - } + .navlink { text-decoration: none; - &-active>div { - // background-color: ; - } + } } diff --git a/src/routers/photo.tsx b/src/routers/photo.tsx index 953b182..c1f970f 100644 --- a/src/routers/photo.tsx +++ b/src/routers/photo.tsx @@ -1,18 +1,11 @@ -import getrealtiveTime from "@utils/time"; -const url = `https://images.pexels.com/photos/5702958/pexels-photo-5702958.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1`; export default function PhotoPage() { - const time = getrealtiveTime(1672570122); return ( - <> - {/* */} - {/* */} - {/* { - console.log(inView + "123"); - }} - /> */} - +

+ 二创图片页还在制作,敬请期待! +

); } diff --git a/src/routers/read.tsx b/src/routers/read.tsx deleted file mode 100644 index 46ddd84..0000000 --- a/src/routers/read.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import getrealtiveTime from "@utils/time"; -export default function ReadPage() { - const time = getrealtiveTime(1672570020000); - return ( - <> -

这里是read路由页面

-

- 1672570020000-{time} -

- - ); -} diff --git a/src/routers/video/masonry.tsx b/src/routers/video/masonry.tsx index 0a3638d..7e1fc19 100644 --- a/src/routers/video/masonry.tsx +++ b/src/routers/video/masonry.tsx @@ -1,7 +1,7 @@ import { fetchVideos } from "@utils/fetch"; -import { concurrencyRequest, Pick } from "@utils/index"; +import { Pick } from "@utils/index"; import { useState, useEffect, FC, memo } from "react"; -import { VideoRouterImageCardType, VideoRouterMasonryType } from "./videotype"; +import { VideoRouterImageCardType } from "./videotype"; import { Unstable_Grid2 as Grid } from "@mui/material"; import ImageShouldResizeProview from "@components/proview/imageSize"; import { VideoRouterImageCard } from "./item"; diff --git a/src/utils/fetch/index.ts b/src/utils/fetch/index.ts index 34cfa2a..f930021 100644 --- a/src/utils/fetch/index.ts +++ b/src/utils/fetch/index.ts @@ -1,5 +1,3 @@ -// import videoJson from "./video.json"; - /** * 类型文件导入 */ @@ -11,12 +9,7 @@ import { IFetchVideoParams, RFetchVideoRes } from "./fetchtype"; export function fetchVideos( params: IFetchVideoParams ): Promise { - console.log({ params }); - // return new Promise((resolve) => { - // setTimeout(() => { - // resolve(videoJson); - // }, 1000); - // }); + // console.log({ params }); return fetch( `/v1/video-interface/advanced-search?order=${params.order}&page=${ params.page diff --git a/src/utils/fetch/video.json b/src/utils/fetch/video.json deleted file mode 100644 index 102e9a9..0000000 --- a/src/utils/fetch/video.json +++ /dev/null @@ -1,530 +0,0 @@ -{ - "code": 0, - "message": "ok", - "ttl": 1, - "data": { - "page": 1, - "numResults": 6699, - "result": [{ - "bvid": "BV1dY41127BZ", - "aid": 264621793, - "name": "米诺高分少女", - "mid": 1778026586, - "face": "https://i2.hdslb.com/bfs/face/3da6145e81745cabd1f79b9c61772f884e783b7e.jpg", - "tid": 31, - "tname": "翻唱", - "copyright": 1, - "title": "一人弹奏,一人唱:你是我《不能说的秘密》【4K现场纯享】", - "desc": "原曲:周杰伦\n翻唱:米诺\n钢琴:柚恩\n-----------------------\n莞儿@莞儿睡不醒 :https://space.bilibili.com/1875044092\n露早@露早GOGO :https://space.bilibili.com/1669777785\n米诺@米诺高分少女 :https://space.bilibili.com/1778026586\n虞莫@虞莫MOMO :https://space.bilibili.com/1811071010\n柚恩@柚恩不加糖 :https://space.bilibili.com/1795147802\n官号@EOE组合 :https://space.bilibili.com/2018113152", - "pic": "http://i1.hdslb.com/bfs/archive/cec5a75c1321f81d960020a7a3e17c3f89b8dc78.jpg", - "tag": "钢琴,周杰伦,弹唱,EOE,不能说的秘密,4K,米诺,华语现场,让虚拟歌手为你唱,柚恩,2023虚拟歌手贺岁纪", - "pubdate": 1672568007, - "duration": "332", - "view": 3876, - "danmaku": 332, - "reply": 221, - "favorite": 364, - "coin": 649, - "share": 71, - "like": 1404, - "score": 2591, - "status": 1, - "created_at": 1672570122, - "updated_at": 1672570122 - }, { - "bvid": "BV1dY41127BZ", - "aid": 264621793, - "name": "米诺高分少女", - "mid": 1778026586, - "face": "https://i2.hdslb.com/bfs/face/3da6145e81745cabd1f79b9c61772f884e783b7e.jpg", - "tid": 31, - "tname": "翻唱", - "copyright": 1, - "title": "一人弹奏,一人唱:你是我《不能说的秘密》【4K现场纯享】", - "desc": "原曲:周杰伦\n翻唱:米诺\n钢琴:柚恩\n-----------------------\n莞儿@莞儿睡不醒 :https://space.bilibili.com/1875044092\n露早@露早GOGO :https://space.bilibili.com/1669777785\n米诺@米诺高分少女 :https://space.bilibili.com/1778026586\n虞莫@虞莫MOMO :https://space.bilibili.com/1811071010\n柚恩@柚恩不加糖 :https://space.bilibili.com/1795147802\n官号@EOE组合 :https://space.bilibili.com/2018113152", - "pic": "http://i1.hdslb.com/bfs/archive/cec5a75c1321f81d960020a7a3e17c3f89b8dc78.jpg", - "tag": "钢琴,周杰伦,弹唱,EOE,不能说的秘密,4K,米诺,华语现场,让虚拟歌手为你唱,柚恩,2023虚拟歌手贺岁纪", - "pubdate": 1672568007, - "duration": "332", - "view": 3796, - "danmaku": 332, - "reply": 217, - "favorite": 360, - "coin": 637, - "share": 70, - "like": 1375, - "score": 2540, - "status": 1, - "created_at": 1672570020, - "updated_at": 1672570020 - }, { - "bvid": "BV1dY41127BZ", - "aid": 264621793, - "name": "米诺高分少女", - "mid": 1778026586, - "face": "https://i2.hdslb.com/bfs/face/3da6145e81745cabd1f79b9c61772f884e783b7e.jpg", - "tid": 31, - "tname": "翻唱", - "copyright": 1, - "title": "一人弹奏,一人唱:你是我《不能说的秘密》【4K现场纯享】", - "desc": "原曲:周杰伦\n翻唱:米诺\n钢琴:柚恩\n-----------------------\n莞儿@莞儿睡不醒 :https://space.bilibili.com/1875044092\n露早@露早GOGO :https://space.bilibili.com/1669777785\n米诺@米诺高分少女 :https://space.bilibili.com/1778026586\n虞莫@虞莫MOMO :https://space.bilibili.com/1811071010\n柚恩@柚恩不加糖 :https://space.bilibili.com/1795147802\n官号@EOE组合 :https://space.bilibili.com/2018113152", - "pic": "http://i1.hdslb.com/bfs/archive/cec5a75c1321f81d960020a7a3e17c3f89b8dc78.jpg", - "tag": "钢琴,周杰伦,弹唱,EOE,不能说的秘密,4K,米诺,华语现场,让虚拟歌手为你唱,柚恩,2023虚拟歌手贺岁纪", - "pubdate": 1672568007, - "duration": "332", - "view": 3728, - "danmaku": 332, - "reply": 217, - "favorite": 351, - "coin": 622, - "share": 70, - "like": 1343, - "score": 2489, - "status": 1, - "created_at": 1672569952, - "updated_at": 1672569952 - }, { - "bvid": "BV1dY41127BZ", - "aid": 264621793, - "name": "米诺高分少女", - "mid": 1778026586, - "face": "https://i2.hdslb.com/bfs/face/3da6145e81745cabd1f79b9c61772f884e783b7e.jpg", - "tid": 31, - "tname": "翻唱", - "copyright": 1, - "title": "一人弹奏,一人唱:你是我《不能说的秘密》【4K现场纯享】", - "desc": "原曲:周杰伦\n翻唱:米诺\n钢琴:柚恩\n-----------------------\n莞儿@莞儿睡不醒 :https://space.bilibili.com/1875044092\n露早@露早GOGO :https://space.bilibili.com/1669777785\n米诺@米诺高分少女 :https://space.bilibili.com/1778026586\n虞莫@虞莫MOMO :https://space.bilibili.com/1811071010\n柚恩@柚恩不加糖 :https://space.bilibili.com/1795147802\n官号@EOE组合 :https://space.bilibili.com/2018113152", - "pic": "http://i1.hdslb.com/bfs/archive/cec5a75c1321f81d960020a7a3e17c3f89b8dc78.jpg", - "tag": "钢琴,周杰伦,弹唱,EOE,不能说的秘密,4K,米诺,华语现场,让虚拟歌手为你唱,柚恩,2023虚拟歌手贺岁纪", - "pubdate": 1672568007, - "duration": "332", - "view": 3390, - "danmaku": 332, - "reply": 205, - "favorite": 329, - "coin": 595, - "share": 65, - "like": 1250, - "score": 2305, - "status": 1, - "created_at": 1672569627, - "updated_at": 1672569627 - }, { - "bvid": "BV1dY41127BZ", - "aid": 264621793, - "name": "米诺高分少女", - "mid": 1778026586, - "face": "https://i2.hdslb.com/bfs/face/3da6145e81745cabd1f79b9c61772f884e783b7e.jpg", - "tid": 31, - "tname": "翻唱", - "copyright": 1, - "title": "一人弹奏,一人唱:你是我《不能说的秘密》【4K现场纯享】", - "desc": "原曲:周杰伦\n翻唱:米诺\n钢琴:柚恩\n-----------------------\n莞儿@莞儿睡不醒 :https://space.bilibili.com/1875044092\n露早@露早GOGO :https://space.bilibili.com/1669777785\n米诺@米诺高分少女 :https://space.bilibili.com/1778026586\n虞莫@虞莫MOMO :https://space.bilibili.com/1811071010\n柚恩@柚恩不加糖 :https://space.bilibili.com/1795147802\n官号@EOE组合 :https://space.bilibili.com/2018113152", - "pic": "http://i1.hdslb.com/bfs/archive/cec5a75c1321f81d960020a7a3e17c3f89b8dc78.jpg", - "tag": "钢琴,周杰伦,弹唱,EOE,不能说的秘密,4K,米诺,华语现场,让虚拟歌手为你唱,柚恩,2023虚拟歌手贺岁纪", - "pubdate": 1672568007, - "duration": "332", - "view": 3268, - "danmaku": 332, - "reply": 204, - "favorite": 327, - "coin": 591, - "share": 63, - "like": 1230, - "score": 2254, - "status": 1, - "created_at": 1672569587, - "updated_at": 1672569587 - }, { - "bvid": "BV1dY41127BZ", - "aid": 264621793, - "name": "米诺高分少女", - "mid": 1778026586, - "face": "https://i2.hdslb.com/bfs/face/3da6145e81745cabd1f79b9c61772f884e783b7e.jpg", - "tid": 31, - "tname": "翻唱", - "copyright": 1, - "title": "一人弹奏,一人唱:你是我《不能说的秘密》【4K现场纯享】", - "desc": "原曲:周杰伦\n翻唱:米诺\n钢琴:柚恩\n-----------------------\n莞儿@莞儿睡不醒 :https://space.bilibili.com/1875044092\n露早@露早GOGO :https://space.bilibili.com/1669777785\n米诺@米诺高分少女 :https://space.bilibili.com/1778026586\n虞莫@虞莫MOMO :https://space.bilibili.com/1811071010\n柚恩@柚恩不加糖 :https://space.bilibili.com/1795147802\n官号@EOE组合 :https://space.bilibili.com/2018113152", - "pic": "http://i1.hdslb.com/bfs/archive/cec5a75c1321f81d960020a7a3e17c3f89b8dc78.jpg", - "tag": "让虚拟歌手为你唱,华语现场,周杰伦,4K,钢琴,翻唱,演奏,音乐现场,弹唱,EOE,不能说的秘密,米诺,柚恩,2023虚拟歌手贺岁纪", - "pubdate": 1672568007, - "duration": "332", - "view": 2720, - "danmaku": 332, - "reply": 192, - "favorite": 297, - "coin": 534, - "share": 62, - "like": 1091, - "score": 1969, - "status": 1, - "created_at": 1672569190, - "updated_at": 1672569190 - }, { - "bvid": "BV1dY41127BZ", - "aid": 264621793, - "name": "米诺高分少女", - "mid": 1778026586, - "face": "https://i2.hdslb.com/bfs/face/3da6145e81745cabd1f79b9c61772f884e783b7e.jpg", - "tid": 31, - "tname": "翻唱", - "copyright": 1, - "title": "一人弹奏,一人唱:你是我《不能说的秘密》【4K现场纯享】", - "desc": "原曲:周杰伦\n翻唱:米诺\n钢琴:柚恩\n-----------------------\n莞儿@莞儿睡不醒 :https://space.bilibili.com/1875044092\n露早@露早GOGO :https://space.bilibili.com/1669777785\n米诺@米诺高分少女 :https://space.bilibili.com/1778026586\n虞莫@虞莫MOMO :https://space.bilibili.com/1811071010\n柚恩@柚恩不加糖 :https://space.bilibili.com/1795147802\n官号@EOE组合 :https://space.bilibili.com/2018113152", - "pic": "http://i1.hdslb.com/bfs/archive/cec5a75c1321f81d960020a7a3e17c3f89b8dc78.jpg", - "tag": "让虚拟歌手为你唱,华语现场,周杰伦,4K,钢琴,翻唱,演奏,音乐现场,弹唱,EOE,不能说的秘密,米诺,柚恩,2023虚拟歌手贺岁纪", - "pubdate": 1672568007, - "duration": "332", - "view": 2720, - "danmaku": 332, - "reply": 192, - "favorite": 297, - "coin": 534, - "share": 62, - "like": 1091, - "score": 1969, - "status": 1, - "created_at": 1672569189, - "updated_at": 1672569189 - }, { - "bvid": "BV1dY41127BZ", - "aid": 264621793, - "name": "米诺高分少女", - "mid": 1778026586, - "face": "https://i2.hdslb.com/bfs/face/3da6145e81745cabd1f79b9c61772f884e783b7e.jpg", - "tid": 31, - "tname": "翻唱", - "copyright": 1, - "title": "一人弹奏,一人唱:你是我《不能说的秘密》【4K现场纯享】", - "desc": "原曲:周杰伦\n翻唱:米诺\n钢琴:柚恩\n-----------------------\n莞儿@莞儿睡不醒 :https://space.bilibili.com/1875044092\n露早@露早GOGO :https://space.bilibili.com/1669777785\n米诺@米诺高分少女 :https://space.bilibili.com/1778026586\n虞莫@虞莫MOMO :https://space.bilibili.com/1811071010\n柚恩@柚恩不加糖 :https://space.bilibili.com/1795147802\n官号@EOE组合 :https://space.bilibili.com/2018113152", - "pic": "http://i1.hdslb.com/bfs/archive/cec5a75c1321f81d960020a7a3e17c3f89b8dc78.jpg", - "tag": "让虚拟歌手为你唱,华语现场,周杰伦,4K,钢琴,翻唱,演奏,音乐现场,弹唱,不能说的秘密,EOE,米诺,柚恩,2023虚拟歌手贺岁纪", - "pubdate": 1672568007, - "duration": "332", - "view": 2720, - "danmaku": 332, - "reply": 192, - "favorite": 297, - "coin": 534, - "share": 60, - "like": 1091, - "score": 1968, - "status": 1, - "created_at": 1672569189, - "updated_at": 1672569189 - }, { - "bvid": "BV1dY41127BZ", - "aid": 264621793, - "name": "米诺高分少女", - "mid": 1778026586, - "face": "https://i2.hdslb.com/bfs/face/3da6145e81745cabd1f79b9c61772f884e783b7e.jpg", - "tid": 31, - "tname": "翻唱", - "copyright": 1, - "title": "一人弹奏,一人唱:你是我《不能说的秘密》【4K现场纯享】", - "desc": "原曲:周杰伦\n翻唱:米诺\n钢琴:柚恩\n-----------------------\n莞儿@莞儿睡不醒 :https://space.bilibili.com/1875044092\n露早@露早GOGO :https://space.bilibili.com/1669777785\n米诺@米诺高分少女 :https://space.bilibili.com/1778026586\n虞莫@虞莫MOMO :https://space.bilibili.com/1811071010\n柚恩@柚恩不加糖 :https://space.bilibili.com/1795147802\n官号@EOE组合 :https://space.bilibili.com/2018113152", - "pic": "http://i1.hdslb.com/bfs/archive/cec5a75c1321f81d960020a7a3e17c3f89b8dc78.jpg", - "tag": "钢琴,周杰伦,弹唱,EOE,不能说的秘密,4K,米诺,华语现场,让虚拟歌手为你唱,柚恩,2023虚拟歌手贺岁纪", - "pubdate": 1672568007, - "duration": "332", - "view": 2573, - "danmaku": 332, - "reply": 185, - "favorite": 288, - "coin": 525, - "share": 60, - "like": 1056, - "score": 1894, - "status": 1, - "created_at": 1672569122, - "updated_at": 1672569122 - }, { - "bvid": "BV1dY41127BZ", - "aid": 264621793, - "name": "米诺高分少女", - "mid": 1778026586, - "face": "https://i2.hdslb.com/bfs/face/3da6145e81745cabd1f79b9c61772f884e783b7e.jpg", - "tid": 31, - "tname": "翻唱", - "copyright": 1, - "title": "一人弹奏,一人唱:你是我《不能说的秘密》【4K现场纯享】", - "desc": "原曲:周杰伦\n翻唱:米诺\n钢琴:柚恩\n-----------------------\n莞儿@莞儿睡不醒 :https://space.bilibili.com/1875044092\n露早@露早GOGO :https://space.bilibili.com/1669777785\n米诺@米诺高分少女 :https://space.bilibili.com/1778026586\n虞莫@虞莫MOMO :https://space.bilibili.com/1811071010\n柚恩@柚恩不加糖 :https://space.bilibili.com/1795147802\n官号@EOE组合 :https://space.bilibili.com/2018113152", - "pic": "http://i1.hdslb.com/bfs/archive/cec5a75c1321f81d960020a7a3e17c3f89b8dc78.jpg", - "tag": "钢琴,周杰伦,弹唱,EOE,不能说的秘密,4K,米诺,华语现场,让虚拟歌手为你唱,柚恩,2023虚拟歌手贺岁纪", - "pubdate": 1672568007, - "duration": "332", - "view": 2010, - "danmaku": 332, - "reply": 162, - "favorite": 228, - "coin": 422, - "share": 51, - "like": 832, - "score": 1500, - "status": 1, - "created_at": 1672568784, - "updated_at": 1672568784 - }, { - "bvid": "BV1dY41127BZ", - "aid": 264621793, - "name": "米诺高分少女", - "mid": 1778026586, - "face": "https://i2.hdslb.com/bfs/face/3da6145e81745cabd1f79b9c61772f884e783b7e.jpg", - "tid": 31, - "tname": "翻唱", - "copyright": 1, - "title": "一人弹奏,一人唱:你是我《不能说的秘密》【4K现场纯享】", - "desc": "原曲:周杰伦\n翻唱:米诺\n钢琴:柚恩\n-----------------------\n莞儿@莞儿睡不醒 :https://space.bilibili.com/1875044092\n露早@露早GOGO :https://space.bilibili.com/1669777785\n米诺@米诺高分少女 :https://space.bilibili.com/1778026586\n虞莫@虞莫MOMO :https://space.bilibili.com/1811071010\n柚恩@柚恩不加糖 :https://space.bilibili.com/1795147802\n官号@EOE组合 :https://space.bilibili.com/2018113152", - "pic": "http://i1.hdslb.com/bfs/archive/cec5a75c1321f81d960020a7a3e17c3f89b8dc78.jpg", - "tag": "钢琴,周杰伦,弹唱,EOE,不能说的秘密,4K,米诺,华语现场,让虚拟歌手为你唱,柚恩,2023虚拟歌手贺岁纪", - "pubdate": 1672568007, - "duration": "332", - "view": 1868, - "danmaku": 332, - "reply": 157, - "favorite": 223, - "coin": 418, - "share": 48, - "like": 807, - "score": 1438, - "status": 1, - "created_at": 1672568747, - "updated_at": 1672568747 - }, { - "bvid": "BV1T44y1d7Hh", - "aid": 989515927, - "name": "涅槃の托马斯", - "mid": 2042168082, - "face": "https://i0.hdslb.com/bfs/face/ffe8981975ef59fa5d0cf3f149e19baf77e043ef.jpg", - "tid": 216, - "tname": "鬼畜剧场", - "copyright": 1, - "title": "哇袄小火车", - "desc": "-", - "pic": "http://i1.hdslb.com/bfs/archive/012bf1302d94133a7c1d41366b393e3c1e4398e7.jpg", - "tag": "eoe,露早,露早GOGO", - "pubdate": 1672568003, - "duration": "30", - "view": 0, - "danmaku": 30, - "reply": 0, - "favorite": 0, - "coin": 0, - "share": 0, - "like": 0, - "score": 0, - "status": 1, - "created_at": 1672570123, - "updated_at": 1672570123 - }, { - "bvid": "BV1T44y1d7Hh", - "aid": 989515927, - "name": "涅槃の托马斯", - "mid": 2042168082, - "face": "https://i0.hdslb.com/bfs/face/ffe8981975ef59fa5d0cf3f149e19baf77e043ef.jpg", - "tid": 216, - "tname": "鬼畜剧场", - "copyright": 1, - "title": "哇袄小火车", - "desc": "-", - "pic": "http://i1.hdslb.com/bfs/archive/012bf1302d94133a7c1d41366b393e3c1e4398e7.jpg", - "tag": "eoe,露早,露早GOGO", - "pubdate": 1672568003, - "duration": "30", - "view": 0, - "danmaku": 30, - "reply": 0, - "favorite": 0, - "coin": 0, - "share": 0, - "like": 0, - "score": 0, - "status": 1, - "created_at": 1672569484, - "updated_at": 1672569484 - }, { - "bvid": "BV1T44y1d7Hh", - "aid": 989515927, - "name": "涅槃の托马斯", - "mid": 2042168082, - "face": "https://i0.hdslb.com/bfs/face/ffe8981975ef59fa5d0cf3f149e19baf77e043ef.jpg", - "tid": 216, - "tname": "鬼畜剧场", - "copyright": 1, - "title": "哇袄小火车", - "desc": "-", - "pic": "http://i1.hdslb.com/bfs/archive/012bf1302d94133a7c1d41366b393e3c1e4398e7.jpg", - "tag": "eoe,露早,露早GOGO", - "pubdate": 1672568003, - "duration": "30", - "view": 0, - "danmaku": 30, - "reply": 0, - "favorite": 0, - "coin": 0, - "share": 0, - "like": 0, - "score": 0, - "status": 1, - "created_at": 1672569406, - "updated_at": 1672569406 - }, { - "bvid": "BV1T44y1d7Hh", - "aid": 989515927, - "name": "涅槃の托马斯", - "mid": 2042168082, - "face": "https://i0.hdslb.com/bfs/face/ffe8981975ef59fa5d0cf3f149e19baf77e043ef.jpg", - "tid": 216, - "tname": "鬼畜剧场", - "copyright": 1, - "title": "哇袄小火车", - "desc": "-", - "pic": "http://i1.hdslb.com/bfs/archive/012bf1302d94133a7c1d41366b393e3c1e4398e7.jpg", - "tag": "eoe,露早,露早GOGO", - "pubdate": 1672568003, - "duration": "30", - "view": 0, - "danmaku": 30, - "reply": 0, - "favorite": 0, - "coin": 0, - "share": 0, - "like": 0, - "score": 0, - "status": 1, - "created_at": 1672569192, - "updated_at": 1672569192 - }, { - "bvid": "BV1T44y1d7Hh", - "aid": 989515927, - "name": "涅槃の托马斯", - "mid": 2042168082, - "face": "https://i0.hdslb.com/bfs/face/ffe8981975ef59fa5d0cf3f149e19baf77e043ef.jpg", - "tid": 216, - "tname": "鬼畜剧场", - "copyright": 1, - "title": "哇袄小火车", - "desc": "-", - "pic": "http://i1.hdslb.com/bfs/archive/012bf1302d94133a7c1d41366b393e3c1e4398e7.jpg", - "tag": "eoe,露早GOGO,露早", - "pubdate": 1672568003, - "duration": "30", - "view": 0, - "danmaku": 30, - "reply": 0, - "favorite": 0, - "coin": 0, - "share": 0, - "like": 0, - "score": 0, - "status": 1, - "created_at": 1672569191, - "updated_at": 1672569191 - }, { - "bvid": "BV1T44y1d7Hh", - "aid": 989515927, - "name": "涅槃の托马斯", - "mid": 2042168082, - "face": "https://i0.hdslb.com/bfs/face/ffe8981975ef59fa5d0cf3f149e19baf77e043ef.jpg", - "tid": 216, - "tname": "鬼畜剧场", - "copyright": 1, - "title": "哇袄小火车", - "desc": "-", - "pic": "http://i1.hdslb.com/bfs/archive/012bf1302d94133a7c1d41366b393e3c1e4398e7.jpg", - "tag": "eoe,露早,露早GOGO", - "pubdate": 1672568003, - "duration": "30", - "view": 0, - "danmaku": 30, - "reply": 0, - "favorite": 0, - "coin": 0, - "share": 0, - "like": 0, - "score": 0, - "status": 1, - "created_at": 1672568639, - "updated_at": 1672568639 - }, { - "bvid": "BV1T44y1d7Hh", - "aid": 989515927, - "name": "涅槃の托马斯", - "mid": 2042168082, - "face": "https://i0.hdslb.com/bfs/face/ffe8981975ef59fa5d0cf3f149e19baf77e043ef.jpg", - "tid": 216, - "tname": "鬼畜剧场", - "copyright": 1, - "title": "哇袄小火车", - "desc": "-", - "pic": "http://i1.hdslb.com/bfs/archive/012bf1302d94133a7c1d41366b393e3c1e4398e7.jpg", - "tag": "eoe,露早,露早GOGO", - "pubdate": 1672568003, - "duration": "30", - "view": 0, - "danmaku": 30, - "reply": 0, - "favorite": 0, - "coin": 0, - "share": 0, - "like": 0, - "score": 0, - "status": 1, - "created_at": 1672568565, - "updated_at": 1672568565 - }, { - "bvid": "BV1rP4y1v74o", - "aid": 904505456, - "name": "peacedoer", - "mid": 35330990, - "face": "https://i2.hdslb.com/bfs/face/166eb53c81b93b124871687deb8a20228631c964.jpg", - "tid": 242, - "tname": "粉丝创作", - "copyright": 1, - "title": "阳光开朗大虞莫", - "desc": "小茄崽子生来就是当阳光开朗大男孩的料\nBGM:阳光开朗大男孩—卦者灵风", - "pic": "http://i0.hdslb.com/bfs/archive/89568a1126d5ff0a94bd379c271fdb1a115ead3a.jpg", - "tag": "搞笑,虚拟偶像,影视剪辑,蛞蝓,米诺,eoe,莞儿,露早,虞莫,柚恩", - "pubdate": 1672567784, - "duration": "67", - "view": 5, - "danmaku": 67, - "reply": 0, - "favorite": 0, - "coin": 0, - "share": 0, - "like": 0, - "score": 1, - "status": 1, - "created_at": 1672570123, - "updated_at": 1672570123 - }, { - "bvid": "BV1rP4y1v74o", - "aid": 904505456, - "name": "peacedoer", - "mid": 35330990, - "face": "https://i2.hdslb.com/bfs/face/166eb53c81b93b124871687deb8a20228631c964.jpg", - "tid": 242, - "tname": "粉丝创作", - "copyright": 1, - "title": "阳光开朗大虞莫", - "desc": "小茄崽子生来就是当阳光开朗大男孩的料\nBGM:阳光开朗大男孩—卦者灵风", - "pic": "http://i0.hdslb.com/bfs/archive/89568a1126d5ff0a94bd379c271fdb1a115ead3a.jpg", - "tag": "搞笑,虚拟偶像,影视剪辑,蛞蝓,米诺,eoe,莞儿,露早,虞莫,柚恩", - "pubdate": 1672567784, - "duration": "67", - "view": 5, - "danmaku": 67, - "reply": 0, - "favorite": 0, - "coin": 0, - "share": 0, - "like": 0, - "score": 1, - "status": 1, - "created_at": 1672569953, - "updated_at": 1672569953 - }] - } -} \ No newline at end of file diff --git a/src/utils/index.ts b/src/utils/index.ts index 6313b50..ed03249 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -13,8 +13,7 @@ export function Once any>(fn: T) { * 重复触发请求,在第一个完成之前忽略其他fn。 */ export function SingleRun any>(handler: T) { - let flag = true, - times = 0; + let flag = true; return function (...res: Parameters) { return new Promise((resolve, reject) => { if (flag) { diff --git a/vite.config.ts b/vite.config.ts index c37c2a9..b9a1044 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,4 +1,4 @@ -import { defineConfig, splitVendorChunkPlugin } from "vite"; +import { defineConfig } from "vite"; import path from "path"; import react from "@vitejs/plugin-react-swc"; // 可视化打包文件 @@ -28,7 +28,6 @@ export default defineConfig({ }), { ...visualizer(), apply: "build" }, { ...viteCompression(), apply: "build" }, - // { ...splitVendorChunkPlugin(), apply: "build" }, ], build: { // target: "es2015",