-
-
EOEfans
+
+
+
EOEfans-web端
+
);
}
+//todo 修改logo
+
+const Yituo: FC<{
+ height: number | string;
+ width: number | string;
+}> = ({ height, width }) => (
+
+);
diff --git a/src/routers/layout/nav/index.tsx b/src/routers/layout/nav/index.tsx
index 9f15edb..936cb09 100644
--- a/src/routers/layout/nav/index.tsx
+++ b/src/routers/layout/nav/index.tsx
@@ -164,18 +164,29 @@ const NavTagChipItem: FC
= memo((props) => {
} else {
dispatch(handerAddTag(props));
}
- };
+ },
+ //@ts-ignore
+ color = nameToColor[props.query] || "info";
//todo 修改颜色,我感觉这个颜色应该会蛮难写的
return (
);
});
+
+const nameToColor = {
+ 露早: "luzao",
+ 柚恩: "youen",
+ 莞儿: "waner",
+ 米诺: "minuo",
+ 虞莫: "yumo",
+};
diff --git a/src/routers/layout/nav/nav.module.less b/src/routers/layout/nav/nav.module.less
index e793460..14d1a20 100644
--- a/src/routers/layout/nav/nav.module.less
+++ b/src/routers/layout/nav/nav.module.less
@@ -9,6 +9,7 @@
scrollbar-width: none;
-ms-overflow-style: none;
+
&::-webkit-scrollbar {
display: none;
}
diff --git a/src/routers/layout/nav/tools.ts b/src/routers/layout/nav/tools.ts
index b14b873..dfa2830 100644
--- a/src/routers/layout/nav/tools.ts
+++ b/src/routers/layout/nav/tools.ts
@@ -19,6 +19,10 @@ export function useNavList(): [
version: getVersion(),
res: [],
} as DnavStorage);
+ if (!local_lists.version) {
+ return query_nav_list;
+ }
+ //todo 修改逻辑
if (parseFloat(local_lists.version) < parseFloat(getVersion())) {
return query_nav_list;
}
diff --git a/src/routers/video/masonry.tsx b/src/routers/video/masonry.tsx
index a1f0843..b75b9d6 100644
--- a/src/routers/video/masonry.tsx
+++ b/src/routers/video/masonry.tsx
@@ -1,5 +1,3 @@
-import { fetchVideos } from "@utils/fetch";
-import { Pick } from "@utils/index";
import { useState, useEffect, FC, memo } from "react";
import { VideoRouterImageCardType, VideoRouterMasonryType } from "./videotype";
import { Unstable_Grid2 as Grid } from "@mui/material";
@@ -8,6 +6,7 @@ import { VideoRouterImageCard } from "./item";
import { Skeleton } from "@mui/material";
import { nanoid } from "nanoid";
import styles from "./video.module.less";
+import { fetchVideohnadler, PickVideoRouterImageCardType } from "./tools";
/**
* @description 该组件负责渲染视频图片的瀑布流
*/
@@ -19,34 +18,11 @@ export default function VideoMasonry(props: VideoRouterMasonryType) {
useEffect(() => {
// 在内部定义fetchHandler,保证拿到的是同步的
const fetchHandler = async (page: number = 1) => {
- const res = await fetchVideos({
- ...props,
- order: "view",
- page,
- }),
- data = res.data.result;
+ const data = await fetchVideohnadler(page, props);
setLists((lists) => [
...lists,
...data.map((item, index) => {
- const itemRes: VideoRouterImageCardType = Pick(
- item,
- "title",
- "bvid",
- "name",
- "tname",
- "copyright",
- "pic",
- "tag",
- "view",
- "coin",
- "share",
- "like",
- "pubdate",
- "danmaku",
- "duration",
- "favorite",
- "face"
- );
+ const itemRes = PickVideoRouterImageCardType(item);
if (index === data.length - 3) {
return {
...itemRes,
@@ -83,6 +59,7 @@ export default function VideoMasonry(props: VideoRouterMasonryType) {
sm: 6,
xs: 4,
}}
+ className={styles["container"]}
>
{lists.map((item) => (
diff --git a/src/routers/video/tools.ts b/src/routers/video/tools.ts
new file mode 100644
index 0000000..c97a786
--- /dev/null
+++ b/src/routers/video/tools.ts
@@ -0,0 +1,46 @@
+import { VideoRouterMasonryType, VideoRouterImageCardType } from "./videotype";
+import { fetchVideos } from "@utils/fetch/index";
+import message from "@components/message";
+import { Pick } from "@utils/index";
+
+export const fetchVideohnadler = async (
+ page: number = 1,
+ props: VideoRouterMasonryType
+) => {
+ const res = await fetchVideos({
+ order: "view",
+ ...props,
+ page,
+ });
+ if (res.code === 400) {
+ message.info("参数错误,请尝试其他tag");
+ return [];
+ } else if (res.data.result.length < 1) {
+ message.info("没有更多数据了,请尝试其他tag");
+ }
+ return res.data.result;
+};
+
+export function PickVideoRouterImageCardType<
+ T extends VideoRouterImageCardType
+>(item: T): VideoRouterImageCardType {
+ return Pick(
+ item,
+ "title",
+ "bvid",
+ "name",
+ "tname",
+ "copyright",
+ "pic",
+ "tag",
+ "view",
+ "coin",
+ "share",
+ "like",
+ "pubdate",
+ "danmaku",
+ "duration",
+ "favorite",
+ "face"
+ );
+}
diff --git a/src/routers/video/video.module.less b/src/routers/video/video.module.less
index 2bf6bdd..670ea5d 100644
--- a/src/routers/video/video.module.less
+++ b/src/routers/video/video.module.less
@@ -11,4 +11,15 @@
&>span:last-of-type {
margin-left: 5px;
}
+}
+
+.container:empty {
+ display: flex;
+ justify-content: center;
+
+ &::before {
+ margin-top: 50px;
+ content: "暂无数据";
+ color: #c1c1c1;
+ }
}
\ No newline at end of file
diff --git a/src/utils/fetch/fetchtype.ts b/src/utils/fetch/fetchtype.ts
index 6028ead..f58fd6c 100644
--- a/src/utils/fetch/fetchtype.ts
+++ b/src/utils/fetch/fetchtype.ts
@@ -172,7 +172,7 @@ export interface RFetchVideoRes {
/**
* @example 0
*/
- code: number;
+ code: 0 | 400;
/**
* @example "ok"
*/
diff --git a/src/utils/fetch/index.ts b/src/utils/fetch/index.ts
index 80bad69..02625a6 100644
--- a/src/utils/fetch/index.ts
+++ b/src/utils/fetch/index.ts
@@ -10,7 +10,7 @@ export function fetchVideos(
params: IFetchVideoParams
): Promise {
const fetchUrl = `/v1/video-interface/advanced-search?order=${
- params.order
+ params.order || "view"
}&page=${params.page}${
params.copyright ? `©right=${params.copyright}` : ""
}