Skip to content

Commit

Permalink
完成根据tag搜索
Browse files Browse the repository at this point in the history
  • Loading branch information
master1lan committed Jan 15, 2023
1 parent ad23a08 commit 81114d3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
8 changes: 3 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,19 @@ $ npm run preview

## 已完成功能

- [x] 二创图 feed 流
- [x] 滚动加载
- [x] 基础 tag 栏展示
- [x] tag 栏用户自定义排序
- [x] 视频接口测通
- [x] tag 栏放缩动画
- [x] 根据tag栏进行重新查询

## TODO

### 急急急

- [ ] 总体 layout 布局
- [ ] 总体 font-family,各种 layout 下 font-size 等全局属性的设定
- [ ] 理解完视频接口的 q 等属性特点
- [ ] UI 设计
- [ ] 搜索功能
- [ ] 图片加载序列

### 现在还没定论的

Expand Down
6 changes: 3 additions & 3 deletions src/routers/layout/nav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ const NavTagChipItem: FC<NavQueryItemType> = memo((props) => {
dispatch(handerAddTag(props));
}
};
//todo 修改颜色
//todo 修改颜色,我感觉这个颜色应该会蛮难写的
return (
<Button
variant='contained'
color={clicked ? "secondary" : "primary"}
variant={clicked ? "contained" : "outlined"}
color='info'
onClick={handerclick}
sx={{
wordBreak: "keep-all",
Expand Down
1 change: 0 additions & 1 deletion src/routers/layout/nav/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,3 @@ export const router_nav_list = router_list.map((item) => ({
id: nanoid(3),
cancelable: false,
})) as NavRouterItemType[];
//todo 增加新的tag
12 changes: 7 additions & 5 deletions src/routers/video/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ export default function VideoPage() {
?.queryString as ValueOf<Pick<VideoRouterMasonryType, "tname">>,
copyright = activeTags.find((item) => item.queryType === "copyright")
?.queryString as ValueOf<Pick<VideoRouterMasonryType, "copyright">>,
order = activeTags.find((item) => item.queryType === "order")
?.queryString as ValueOf<Pick<VideoRouterMasonryType, "order">>,
q = activeTags
.filter((item) => item.queryType === "q")
.reduceRight((pre, cur) => {
return `${cur.queryString}+${pre}`;
}, "");
.reduceRight((pre, cur, index, arr) => {
return `${cur.queryString}${index < arr.length - 1 ? "+" : ""}${pre}`;
}, ""),
props = { tname, copyright, order, q };
return (
<>
<VideoMasonry tname={tname} copyright={copyright} />
<VideoMasonry {...props} />
</>
);
}
//todo 重新写q
1 change: 0 additions & 1 deletion src/utils/fetch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export function fetchVideos(
${params.tname ? `&tname=${params.tname}` : ""}`
.replace(/\s+/g, "")
.trim();
console.log({ fetchUrl });
return fetch(fetchUrl, {
method: "GET",
headers: {
Expand Down

0 comments on commit 81114d3

Please sign in to comment.