Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
web-ci-test
Commits
01f1d24c
提交
01f1d24c
authored
5月 30, 2023
作者:
翁进城
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
打包前优化
上级
a07b4ec7
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
47 行增加
和
41 行删除
+47
-41
index.tsx
pages/forum/components/publishMessage/index.tsx
+31
-26
index.page.tsx
pages/forum/index.page.tsx
+16
-15
没有找到文件。
pages/forum/components/publishMessage/index.tsx
浏览文件 @
01f1d24c
...
...
@@ -85,33 +85,38 @@ export default function PublishMessage(props: Props) {
const
onFinish
=
(
values
:
any
)
=>
{
console
.
log
(
values
);
setShowLoad
(
true
);
api
.
publish
({
lat
:
position
?.
position
?.
lat
,
//纬度
lon
:
position
?.
position
?.
lng
,
//经度
title
:
""
,
//标题
description
:
values
.
description
,
//描述
userId
:
userInfo
!
.
id
,
//用户id
mediaVO
:
{
//发布图片
//@ts-ignore
picture
:
fileList
.
filter
((
item
)
=>
item
.
url
).
map
((
item
)
=>
item
.
url
),
},
})
.
then
((
res
)
=>
{
console
.
log
(
"提交结果"
,
res
);
setShowLoad
(
false
);
if
(
res
.
code
===
"200"
)
{
window
.
messageApi
.
success
(
"发布成功"
);
props
.
onCancel
();
props
.
onOk
&&
props
.
onOk
();
setTimeout
(()
=>
{
form
.
resetFields
([
"title"
,
"description"
]);
setFileList
([]);
},
500
);
}
});
if
(
userInfo
)
{
api
.
publish
({
lat
:
position
?.
position
?.
lat
,
//纬度
lon
:
position
?.
position
?.
lng
,
//经度
title
:
""
,
//标题
description
:
values
.
description
,
//描述
userId
:
userInfo
.
id
,
//用户id
mediaVO
:
{
//发布图片
//@ts-ignore
picture
:
fileList
.
filter
((
item
)
=>
item
.
url
)
.
map
((
item
)
=>
item
.
url
),
},
})
.
then
((
res
)
=>
{
console
.
log
(
"提交结果"
,
res
);
setShowLoad
(
false
);
if
(
res
.
code
===
"200"
)
{
window
.
messageApi
.
success
(
"发布成功"
);
props
.
onCancel
();
props
.
onOk
&&
props
.
onOk
();
setTimeout
(()
=>
{
form
.
resetFields
([
"title"
,
"description"
]);
setFileList
([]);
},
500
);
}
});
}
};
return
(
...
...
pages/forum/index.page.tsx
浏览文件 @
01f1d24c
...
...
@@ -16,7 +16,7 @@ import { RightOutlined } from "@ant-design/icons";
import
{
useContext
,
useEffect
,
useState
}
from
"react"
;
import
PublishMessage
from
"./components/publishMessage"
;
import
api
,
{
ByDynamicParams
,
Dynamic
}
from
"./api"
;
import
InfiniteScroll
from
"react-infinite-scroll-component"
import
InfiniteScroll
from
"react-infinite-scroll-component"
;
import
{
UserContext
}
from
"~/lib/userProvider"
;
interface
Item
extends
Dynamic
{
...
...
@@ -82,26 +82,27 @@ export default function Forum() {
//评论内容
const
onComment
=
(
values
:
any
,
id
:
number
,
i
:
number
)
=>
{
api
.
comment
({
content
:
values
.
content
,
dynamicId
:
id
,
userId
:
userInfo
!
.
id
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
===
"200"
)
{
}
});
if
(
userInfo
)
{
api
.
comment
({
content
:
values
.
content
,
dynamicId
:
id
,
userId
:
userInfo
.
id
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
===
"200"
)
{
}
});
}
};
//评论内容
const
onCommentContent
=
()
=>
{
if
(
userInfo
){
}
else
{
if
(
userInfo
)
{
}
else
{
setNeedLogin
(
true
);
}
}
}
;
return
(
<
Layout
>
<
div
className=
{
styles
.
forum
}
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论