Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
web-ci-test
Commits
24863734
提交
24863734
authored
5月 20, 2023
作者:
翁进城
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
案例文章开发
上级
4680d00a
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
169 行增加
和
1 行删除
+169
-1
[id].page.tsx
pages/projectInfo/caseArticle/[id].page.tsx
+99
-0
index.tsx
pages/projectInfo/caseArticle/api/index.tsx
+23
-0
bk.png
pages/projectInfo/caseArticle/assets/bk.png
+0
-0
index.module.scss
pages/projectInfo/caseArticle/index.module.scss
+42
-0
index.tsx
pages/projectInfo/components/cases/index.tsx
+5
-1
没有找到文件。
pages/projectInfo/caseArticle/[id].page.tsx
0 → 100644
浏览文件 @
24863734
import
{
RightOutlined
}
from
"@ant-design/icons"
;
import
{
Col
,
Row
,
Space
,
Image
}
from
"antd"
;
import
{
useRouter
}
from
"next/router"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
errImg
from
"~/assets/errImg"
;
import
Layout
from
"~/components/layout"
;
import
newsApi
,
{
Item
}
from
"../components/news/api"
;
import
api
,
{
DetailsResp
}
from
"./api"
;
import
styles
from
"./index.module.scss"
;
export
default
function
CaseArticle
()
{
const
router
=
useRouter
();
const
[
data
,
setData
]
=
useState
<
DetailsResp
|
null
>
(
null
);
const
[
newsList
,
setNewList
]
=
useState
<
Item
[]
>
([]);
//获取案例详情
useEffect
(()
=>
{
const
id
=
Number
(
router
.
query
.
id
);
if
(
id
)
{
api
.
details
({
id
,
})
.
then
((
res
)
=>
{
setData
(
res
.
result
||
null
);
});
}
},
[
router
]);
//获取新闻列表
useEffect
(()
=>
{
newsApi
.
listNewsPage
({
pageNo
:
1
,
pageSize
:
5
}).
then
(
res
=>
{
setNewList
(
res
.
result
?.
list
||
[])
})
})
return
(
<
Layout
layoutStyle=
{
{
backgroundColor
:
"#fff"
}
}
>
<
div
style=
{
{
paddingTop
:
29
}
}
>
<
Row
justify=
"space-between"
>
<
Col
flex=
"auto"
>
<
div
className=
{
styles
.
font1
}
>
{
data
?.
caseTitle
}
</
div
>
<
div
className=
{
styles
.
font2
}
style=
{
{
marginTop
:
18
,
marginBottom
:
41
}
}
>
{
data
?.
createTime
}
·
{
data
?.
caseAuthor
}
</
div
>
<
div
dangerouslySetInnerHTML=
{
{
__html
:
data
?.
caseContents
||
""
}
}
></
div
>
</
Col
>
<
Col
>
<
div
className=
{
styles
.
newsBox
}
>
<
Row
className=
{
styles
.
font4
}
align=
"middle"
style=
{
{
paddingTop
:
24
,
paddingLeft
:
24
}
}
>
行业新闻
<
RightOutlined
style=
{
{
fontSize
:
16
,
marginLeft
:
15
}
}
/>
</
Row
>
<
Row
gutter=
{
10
}
style=
{
{
marginTop
:
18
}
}
>
<
Col
span=
{
24
}
>
{
newsList
.
map
(
item
=>
{
return
(
<
Row
justify=
"space-between"
align=
"middle"
>
<
Col
className=
{
`${styles.font3} ${styles.ellipse2}`
}
style=
{
{
width
:
217
,
padding
:
"13px 0 17px 20px"
}
}
>
{
item
.
newsTitle
}
</
Col
>
<
Col
style=
{
{
paddingRight
:
16
}
}
>
<
Image
src=
{
item
.
surfaceImg
}
width=
{
90
}
height=
{
60
}
preview=
{
false
}
fallback=
{
errImg
}
style=
{
{
borderRadius
:
6
}
}
></
Image
>
</
Col
>
</
Row
>
);
})
}
</
Col
>
</
Row
>
</
div
>
</
Col
>
</
Row
>
</
div
>
</
Layout
>
);
}
pages/projectInfo/caseArticle/api/index.tsx
0 → 100644
浏览文件 @
24863734
import
request
,
{
Response
}
from
"~/api/request"
;
export
interface
DetailsParams
{
id
:
number
;
}
export
interface
DetailsResp
{
id
:
number
;
caseTitle
?:
string
;
caseAuthor
?:
string
;
userAccountId
?:
number
;
surfaceImg
?:
string
;
caseContents
?:
string
;
createTime
?:
string
;
updateTime
?:
string
;
}
export
default
{
//案例详情
details
(
params
:
DetailsParams
):
Promise
<
Response
<
DetailsResp
>>
{
return
request
(
"/release/industry-case/details"
,
"get"
,
params
);
},
};
pages/projectInfo/caseArticle/assets/bk.png
0 → 100644
浏览文件 @
24863734
7.9 KB
pages/projectInfo/caseArticle/index.module.scss
0 → 100644
浏览文件 @
24863734
@import
"~/styles/mixins.scss"
;
.font1
{
font-size
:
36px
;
font-family
:
MicrosoftYaHeiUI-Bold
,
MicrosoftYaHeiUI
;
font-weight
:
bold
;
color
:
#000000
;
line-height
:
50px
;
}
.font2
{
font-size
:
12px
;
font-family
:
MicrosoftYaHei
;
color
:
#333333
;
line-height
:
16px
;
}
.font3
{
font-size
:
16px
;
font-family
:
MicrosoftYaHei
;
color
:
#323232
;
line-height
:
21px
;
}
.font4
{
font-size
:
20px
;
font-family
:
MicrosoftYaHeiUI-Bold
,
MicrosoftYaHeiUI
;
font-weight
:
bold
;
color
:
#000000
;
line-height
:
25px
;
}
.newsBox
{
width
:
384px
;
height
:
491px
;
background-image
:
url("./assets/bk.png")
;
background-size
:
100%
100%
;
}
.ellipse2
{
@include
ellipsis
(
2
);
}
pages/projectInfo/components/cases/index.tsx
浏览文件 @
24863734
import
{
Button
}
from
"antd"
;
import
{
useRouter
}
from
"next/router"
;
import
{
useState
,
useEffect
}
from
"react"
;
import
api
,
{
Item
}
from
"./api"
;
import
styles
from
"./index.module.scss"
;
...
...
@@ -20,6 +21,7 @@ export default function Cases() {
});
const
[
count
,
setCount
]
=
useState
(
0
);
const
[
abort
,
setAbort
]
=
useState
<
AbortController
|
null
>
(
null
);
const
Router
=
useRouter
();
useEffect
(()
=>
{
//中断前一次请求
...
...
@@ -51,7 +53,9 @@ export default function Cases() {
<
div
className=
{
styles
.
info
}
>
<
div
className=
{
styles
.
title
}
>
{
item
.
newsTitle
}
</
div
>
</
div
>
<
Button
className=
{
styles
.
btn
}
>
查看案例
</
Button
>
<
Button
className=
{
styles
.
btn
}
onClick=
{
()
=>
Router
.
push
(
'projectInfo/caseArticle/'
+
item
.
id
)
}
>
查看案例
</
Button
>
</
div
>
);
})
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论