Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
a10f75fe
提交
a10f75fe
authored
1月 10, 2024
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:首页热门话题
上级
965861b6
流水线
#7936
已失败 于阶段
in 41 秒
变更
4
流水线
1
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
100 行增加
和
10 行删除
+100
-10
send-webhook.sh
send-webhook.sh
+0
-1
index.tsx
src/components/forumItem/index.tsx
+47
-2
index.tsx
src/components/home-comp/home-forum/index.tsx
+2
-2
index.tsx
src/components/home-comp/home-topic/index.tsx
+51
-5
没有找到文件。
send-webhook.sh
浏览文件 @
a10f75fe
#!/bin/bash # 指定解释器
# webhook地址
# webhook地址
api
=
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=a9a79936-bbbb-4a20-a40e-c0bc01a83e8c"
api
=
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=a9a79936-bbbb-4a20-a40e-c0bc01a83e8c"
# 参数
# 参数
...
...
src/components/forumItem/index.tsx
浏览文件 @
a10f75fe
import
React
from
'react'
;
import
React
from
'react'
;
import
{
ExportOutlined
,
LikeOutlined
,
MessageOutlined
,
}
from
'@ant-design/icons'
;
import
{
Image
}
from
'antd'
;
import
{
Image
}
from
'antd'
;
import
styled
from
'styled-components'
;
import
styled
from
'styled-components'
;
import
{
InterListType
}
from
'@/api/interface'
;
import
{
InterListType
}
from
'@/api/interface'
;
...
@@ -12,6 +17,10 @@ const ForumItemView: React.FC<{ detail: DetailType }> = ({ detail }) => {
...
@@ -12,6 +17,10 @@ const ForumItemView: React.FC<{ detail: DetailType }> = ({ detail }) => {
const
getForumMedia
=
(
type
:
number
)
=>
{
const
getForumMedia
=
(
type
:
number
)
=>
{
return
detail
?.
mediaVO
?.
filter
((
i
)
=>
i
?.
type
===
type
)?.
slice
(
0
,
4
);
return
detail
?.
mediaVO
?.
filter
((
i
)
=>
i
?.
type
===
type
)?.
slice
(
0
,
4
);
};
};
// 帖子相关操作
const
handleAction
=
(
type
:
number
)
=>
{
console
.
log
(
type
);
};
return
(
return
(
<
ForumItemWrap
>
<
ForumItemWrap
>
<
div
className=
"relative mb-2 flex w-full items-center justify-start"
>
<
div
className=
"relative mb-2 flex w-full items-center justify-start"
>
...
@@ -43,13 +52,30 @@ const ForumItemView: React.FC<{ detail: DetailType }> = ({ detail }) => {
...
@@ -43,13 +52,30 @@ const ForumItemView: React.FC<{ detail: DetailType }> = ({ detail }) => {
:
undefined
}
:
undefined
}
{
getForumMedia
(
1
)?.
length
{
getForumMedia
(
1
)?.
length
?
getForumMedia
(
1
)?.
map
((
i
,
j
)
=>
(
?
getForumMedia
(
1
)?.
map
((
i
,
j
)
=>
(
<
div
className=
"h-64 w-3/5 overflow-hidden rounded-lg"
key=
{
j
}
>
<
div
className=
"media-video relative box-border overflow-hidden rounded-lg"
key=
{
j
}
>
{
/* eslint-disable-next-line jsx-a11y/media-has-caption */
}
{
/* eslint-disable-next-line jsx-a11y/media-has-caption */
}
<
video
src=
{
i
.
url
}
controls=
{
true
}
className=
"h-full"
/>
<
video
src=
{
i
.
url
}
controls=
{
true
}
/>
</
div
>
</
div
>
))
))
:
undefined
}
:
undefined
}
</
div
>
</
div
>
<
div
className=
"forum-action flex pb-2 text-777"
>
<
div
className=
"action-item mr-8 flex"
onClick=
{
()
=>
handleAction
(
1
)
}
>
<
LikeOutlined
/>
<
div
className=
"ml-1"
>
{
detail
?.
likesCount
}
</
div
>
</
div
>
<
div
className=
"action-item mr-8 flex"
onClick=
{
()
=>
handleAction
(
2
)
}
>
<
MessageOutlined
/>
<
div
className=
"ml-1"
>
{
detail
?.
commentCount
}
</
div
>
</
div
>
<
div
className=
"action-item mr-8 flex"
onClick=
{
()
=>
handleAction
(
3
)
}
>
<
ExportOutlined
/>
<
div
className=
"ml-1"
>
{
detail
?.
transpond
}
</
div
>
</
div
>
</
div
>
</
ForumItemWrap
>
</
ForumItemWrap
>
);
);
};
};
...
@@ -61,6 +87,25 @@ const ForumItemWrap = styled.div`
...
@@ -61,6 +87,25 @@ const ForumItemWrap = styled.div`
width: 100%;
width: 100%;
box-sizing: border-box;
box-sizing: border-box;
margin-bottom: 1rem;
margin-bottom: 1rem;
.forum-media {
.media-video {
width: 500px;
height: calc(500px / 16 * 9);
margin-bottom: 1rem;
video {
width: 100%;
height: 100%;
}
}
}
.forum-action {
.action-item {
cursor: pointer;
&:hover {
color: #ff552d;
}
}
}
.ant-image {
.ant-image {
width: calc((100% - 0.67rem * 3) / 4);
width: calc((100% - 0.67rem * 3) / 4);
height: 8.6rem;
height: 8.6rem;
...
...
src/components/home-comp/home-forum/index.tsx
浏览文件 @
a10f75fe
...
@@ -23,12 +23,12 @@ const HomeForumView = () => {
...
@@ -23,12 +23,12 @@ const HomeForumView = () => {
// 获取论坛列表
// 获取论坛列表
const
getForumList
=
async
()
=>
{
const
getForumList
=
async
()
=>
{
const
res
=
await
HomeAPI
.
getForumList
({
const
res
=
await
HomeAPI
.
getForumList
({
pageNo
:
1
,
pageNo
:
5
,
pageSize
:
10
,
pageSize
:
10
,
});
});
if
(
res
&&
res
.
code
===
'200'
)
{
if
(
res
&&
res
.
code
===
'200'
)
{
setForumList
(
res
.
result
?.
list
||
[]);
setForumList
(
res
.
result
?.
list
||
[]);
console
.
log
(
'论坛列表 --->'
,
res
.
result
?.
list
);
//
console.log('论坛列表 --->', res.result?.list);
}
}
};
};
// 页面挂载
// 页面挂载
...
...
src/components/home-comp/home-topic/index.tsx
浏览文件 @
a10f75fe
import
React
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Affix
}
from
'antd'
;
import
{
Affix
}
from
'antd'
;
import
styled
from
'styled-components'
;
import
styled
from
'styled-components'
;
import
{
HomeAPI
}
from
'@/api'
;
import
{
InterListType
}
from
'@/api/interface'
;
import
{
GetAppGambitListType
}
from
'@/api/interface/home'
;
// 列表类型
type
ListType
=
InterListType
<
GetAppGambitListType
>
;
// 帖子类型
const
indexList
=
[
{
label
:
1
,
value
:
'text-[#FF392B]'
},
{
label
:
2
,
value
:
'text-[#FE792B]'
},
{
label
:
3
,
value
:
'text-[#FEA32B]'
},
{
label
:
4
,
value
:
'text-[#FEA32B]'
},
{
label
:
5
,
value
:
'text-[#FEA32B]'
},
];
const
HomeTopicView
=
()
=>
{
const
HomeTopicView
=
()
=>
{
// 话题列表
const
[
topicList
,
setTopicList
]
=
useState
<
ListType
>
();
// 获取话题列表
const
getListGambit
=
async
()
=>
{
const
res
=
await
HomeAPI
.
getAppGambitList
({
pageNo
:
1
,
pageSize
:
10
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
setTopicList
(
res
.
result
.
list
||
[]);
}
};
// 组件挂载
useEffect
(()
=>
{
getListGambit
().
then
();
},
[]);
return
(
return
(
<
Affix
offsetTop=
{
58
}
>
<
Affix
offsetTop=
{
58
}
>
<
HomeTopicWrap
>
<
HomeTopicWrap
>
<
div
>
212341
</
div
>
<
div
className=
"title"
>
热门话题
</
div
>
<
div
>
HomeTopicView
</
div
>
{
topicList
?.
map
((
i
,
j
)
=>
(
<
div
key=
{
j
}
className=
"mb-3 flex"
>
<
div
className=
{
`${indexList[j]?.value} font-bold`
}
>
{
j
+
1
}
</
div
>
<
div
className=
"hover:text-tag ml-2 cursor-pointer text-ellipsis"
>
{
i
.
gambitName
}
</
div
>
</
div
>
))
}
</
HomeTopicWrap
>
</
HomeTopicWrap
>
</
Affix
>
</
Affix
>
);
);
...
@@ -18,7 +55,7 @@ export default HomeTopicView;
...
@@ -18,7 +55,7 @@ export default HomeTopicView;
const
HomeTopicWrap
=
styled
.
div
`
const
HomeTopicWrap
=
styled
.
div
`
position: relative;
position: relative;
width: 20rem;
width: 20rem;
height: 20rem;
min-
height: 20rem;
//background: linear-gradient(
//background: linear-gradient(
// 180deg,
// 180deg,
// #fff9f8 2%,
// #fff9f8 2%,
...
@@ -29,5 +66,14 @@ const HomeTopicWrap = styled.div`
...
@@ -29,5 +66,14 @@ const HomeTopicWrap = styled.div`
//);
//);
border-radius: 0.42rem;
border-radius: 0.42rem;
box-sizing: border-box;
box-sizing: border-box;
background: lightpink;
background-image: url('https://file.iuav.com/file/sharefly-topic-bg.png');
background-size: cover;
border: 1px solid #e3e3e3;
padding: 0.75rem 1.25rem 0 1.25rem;
.title {
font-size: 16px;
font-weight: bold;
color: #333;
margin-bottom: 1rem;
}
`
;
`
;
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论