Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
cf95e53f
提交
cf95e53f
authored
5月 30, 2023
作者:
18928357778
浏览文件
操作
浏览文件
下载
差异文件
合并代码
上级
4c051160
00daecb9
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
216 行增加
和
128 行删除
+216
-128
index.tsx
components/NavHeader/index.tsx
+1
-5
index.tsx
components/filter/index.tsx
+67
-57
index.tsx
components/loginModal/index.tsx
+1
-1
userProvider.tsx
lib/userProvider.tsx
+8
-6
index.tsx
pages/forum/api/index.tsx
+15
-4
index.page.tsx
pages/forum/index.page.tsx
+106
-38
index.tsx
pages/projectInfo/components/bids/index.tsx
+4
-2
index.ts
pages/projectInfo/components/requirements/api/index.ts
+1
-1
index.module.scss
pages/projectInfo/components/requirements/index.module.scss
+1
-0
index.tsx
pages/projectInfo/components/requirements/index.tsx
+12
-14
没有找到文件。
components/NavHeader/index.tsx
浏览文件 @
cf95e53f
...
@@ -75,11 +75,7 @@ export default function NavHeader() {
...
@@ -75,11 +75,7 @@ export default function NavHeader() {
if
(
!
userInfo
)
{
if
(
!
userInfo
)
{
setOpenLoginModal
(
true
);
setOpenLoginModal
(
true
);
}
else
{
}
else
{
if
(
userInfo
.
companyAuthStatus
)
{
setOpenPublishModal
(
true
);
setOpenPublishModal
(
true
);
}
else
{
router
.
push
(
"/certification"
);
}
}
}
}
}
...
...
components/filter/index.tsx
浏览文件 @
cf95e53f
...
@@ -3,8 +3,8 @@ import { FilterOptionResp, RegionResp } from "./api";
...
@@ -3,8 +3,8 @@ import { FilterOptionResp, RegionResp } from "./api";
import
ResultItem
from
"./compoents/resultItem"
;
import
ResultItem
from
"./compoents/resultItem"
;
import
RegionItem
from
"./compoents/regionItem"
;
import
RegionItem
from
"./compoents/regionItem"
;
import
styles
from
"./index.module.scss"
;
import
styles
from
"./index.module.scss"
;
import
{
useEffect
,
useState
,
forwardRef
,
useImperativeHandle
}
from
"react"
;
import
React
,
{
useEffect
,
useState
,
forwardRef
,
useImperativeHandle
,
Ref
}
from
"react"
;
import
{
useRouter
}
from
'next/router'
import
{
useRouter
}
from
"next/router"
;
import
BrandItem
from
"./compoents/brandItem"
;
import
BrandItem
from
"./compoents/brandItem"
;
import
ModelItem
from
"./compoents/modelItem"
;
import
ModelItem
from
"./compoents/modelItem"
;
import
PartItem
from
"./compoents/partItem"
;
import
PartItem
from
"./compoents/partItem"
;
...
@@ -60,65 +60,74 @@ type Props = {
...
@@ -60,65 +60,74 @@ type Props = {
)
=>
void
;
//筛选条件更改事件
)
=>
void
;
//筛选条件更改事件
};
};
const
idArr
=
[
"brandId"
,
"categoryId"
,
"modelId"
,
"partsId"
,
"productCategoryId"
,
"qualityId"
,
"industryId"
,
"appTypeId"
]
const
idArr
=
[
const
nameArr
:
any
=
{
"brandId"
,
brandId
:
{
"categoryId"
,
type
:
"brandId"
,
"modelId"
,
typeObj
:
"brand"
,
"partsId"
,
typeName
:
"品牌:"
,
"productCategoryId"
,
"qualityId"
,
"industryId"
,
"appTypeId"
,
];
const
nameArr
:
any
=
{
brandId
:
{
type
:
"brandId"
,
typeObj
:
"brand"
,
typeName
:
"品牌:"
,
},
},
// districtId: {
// districtId: {
// type:"districtId",
// type:"districtId",
// typeObj:"region",
// typeObj:"region",
// typeName:"地域:",
// typeName:"地域:",
// },
// },
modelId
:
{
modelId
:
{
type
:
"modelId"
,
type
:
"modelId"
,
typeObj
:
"model"
,
typeObj
:
"model"
,
typeName
:
"型号:"
,
typeName
:
"型号:"
,
},
},
partsId
:
{
partsId
:
{
type
:
"partsId"
,
type
:
"partsId"
,
typeObj
:
"part"
,
typeObj
:
"part"
,
typeName
:
"部件:"
,
typeName
:
"部件:"
,
},
},
productCategoryId
:
{
productCategoryId
:
{
type
:
"productCategoryId"
,
type
:
"productCategoryId"
,
typeObj
:
"category"
,
typeObj
:
"category"
,
typeName
:
"类目:"
,
typeName
:
"类目:"
,
},
},
qualityId
:
{
qualityId
:
{
type
:
"qualityId"
,
type
:
"qualityId"
,
typeObj
:
"quality"
,
typeObj
:
"quality"
,
typeName
:
"成色:"
,
typeName
:
"成色:"
,
},
},
industryId
:
{
industryId
:
{
type
:
"industryId"
,
type
:
"industryId"
,
typeObj
:
"industryId"
,
typeObj
:
"industryId"
,
typeName
:
"行业:"
,
typeName
:
"行业:"
,
},
},
appTypeId
:
{
appTypeId
:
{
type
:
"appTypeId"
,
type
:
"appTypeId"
,
typeObj
:
"appTypeId"
,
typeObj
:
"appTypeId"
,
typeName
:
"应用:"
,
typeName
:
"应用:"
,
},
},
categoryId
:
{
categoryId
:
{
type
:
"categoryId"
,
type
:
"categoryId"
,
typeObj
:
"categoryId"
,
typeObj
:
"categoryId"
,
typeName
:
"类目:"
,
typeName
:
"类目:"
,
},
},
}
}
;
const
Filter
=
forwardRef
((
props
:
Props
,
ref
)
=>
{
const
Filter
=
(
props
:
Props
,
ref
:
Ref
<
any
>
)
=>
{
const
router
=
useRouter
();
const
router
=
useRouter
();
useImperativeHandle
(
ref
,
()
=>
({
useImperativeHandle
(
ref
,
()
=>
({
idArr
:
idArr
,
idArr
:
idArr
,
clearRouter
:
clearRouter
clearRouter
:
clearRouter
,
}))
}))
;
const
[
result
,
setResult
]
=
useState
<
FilterResult
>
({});
const
[
result
,
setResult
]
=
useState
<
FilterResult
>
({});
const
onChange
=
(
item
:
FilterOptionResp
,
type
:
string
)
=>
{
const
onChange
=
(
item
:
FilterOptionResp
,
type
:
string
)
=>
{
clearRouter
()
clearRouter
()
;
let
data
:
{
[
key
:
string
]:
FilterOptionResp
}
=
{};
let
data
:
{
[
key
:
string
]:
FilterOptionResp
}
=
{};
data
[
type
]
=
item
;
data
[
type
]
=
item
;
...
@@ -139,25 +148,28 @@ const nameArr:any = {
...
@@ -139,25 +148,28 @@ const nameArr:any = {
});
});
},
[
result
]);
},
[
result
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
let
queryVal
=
JSON
.
parse
(
JSON
.
stringify
(
router
.
query
));
let
queryVal
=
JSON
.
parse
(
JSON
.
stringify
(
router
.
query
));
if
(
Object
.
keys
(
router
.
query
).
length
)
{
if
(
Object
.
keys
(
router
.
query
).
length
)
{
for
(
const
key
in
queryVal
)
{
for
(
const
key
in
queryVal
)
{
if
(
idArr
.
includes
(
key
))
{
if
(
idArr
.
includes
(
key
))
{
onChange
({
id
:
queryVal
[
key
],
name
:
nameArr
[
key
].
typeName
+
queryVal
.
name
},
nameArr
[
key
].
typeObj
)
onChange
(
}
{
id
:
queryVal
[
key
],
name
:
nameArr
[
key
].
typeName
+
queryVal
.
name
},
nameArr
[
key
].
typeObj
);
}
}
}
}
}
},
[
router
])
},
[
router
]);
const
clearRouter
=
()
=>
{
const
clearRouter
=
()
=>
{
if
(
Object
.
keys
(
router
.
query
).
length
)
{
if
(
Object
.
keys
(
router
.
query
).
length
)
{
router
.
query
=
{}
router
.
query
=
{}
;
router
.
replace
(
router
.
pathname
)
router
.
replace
(
router
.
pathname
)
;
}
}
}
}
;
const
onDel
=
(
key
:
string
)
=>
{
const
onDel
=
(
key
:
string
)
=>
{
clearRouter
()
clearRouter
()
;
//@ts-ignore
//@ts-ignore
delete
result
[
key
];
delete
result
[
key
];
setResult
({
setResult
({
...
@@ -236,7 +248,6 @@ const nameArr:any = {
...
@@ -236,7 +248,6 @@ const nameArr:any = {
</
div
>
</
div
>
</>
</>
);
);
}
};
)
export
default
Filter
export
default
forwardRef
(
Filter
);
\ No newline at end of file
components/loginModal/index.tsx
浏览文件 @
cf95e53f
...
@@ -67,7 +67,7 @@ export default function LoginModal(props: Props) {
...
@@ -67,7 +67,7 @@ export default function LoginModal(props: Props) {
window
.
localStorage
.
setItem
(
"token"
,
res
.
result
.
token
);
window
.
localStorage
.
setItem
(
"token"
,
res
.
result
.
token
);
api
.
userInfo
().
then
((
res
)
=>
{
api
.
userInfo
().
then
((
res
)
=>
{
setUserInfo
(
res
.
result
||
""
);
setUserInfo
(
res
.
result
);
window
.
messageApi
.
success
(
"登录成功"
);
window
.
messageApi
.
success
(
"登录成功"
);
props
.
onCancel
();
props
.
onCancel
();
});
});
...
...
lib/userProvider.tsx
浏览文件 @
cf95e53f
...
@@ -10,8 +10,8 @@ import api, { UserInfoResp } from "~/api";
...
@@ -10,8 +10,8 @@ import api, { UserInfoResp } from "~/api";
export
const
UserContext
=
createContext
<
{
export
const
UserContext
=
createContext
<
{
testLogin
:
()
=>
void
;
testLogin
:
()
=>
void
;
logout
:
()
=>
void
;
logout
:
()
=>
void
;
userInfo
:
UserInfoResp
|
null
|
""
;
userInfo
:
UserInfoResp
|
null
|
undefined
;
setUserInfo
:
Dispatch
<
SetStateAction
<
UserInfoResp
|
null
|
""
>>
;
setUserInfo
:
Dispatch
<
SetStateAction
<
UserInfoResp
|
null
|
undefined
>>
;
needLogin
:
Boolean
;
needLogin
:
Boolean
;
setNeedLogin
:
Dispatch
<
SetStateAction
<
Boolean
>>
;
setNeedLogin
:
Dispatch
<
SetStateAction
<
Boolean
>>
;
}
>
({
}
>
({
...
@@ -27,12 +27,14 @@ type Props = {
...
@@ -27,12 +27,14 @@ type Props = {
children
:
React
.
ReactNode
;
children
:
React
.
ReactNode
;
};
};
const
UserProvider
=
({
children
}:
Props
)
=>
{
const
UserProvider
=
({
children
}:
Props
)
=>
{
const
[
userInfo
,
setUserInfo
]
=
useState
<
UserInfoResp
|
null
|
''
>
(
null
);
const
[
userInfo
,
setUserInfo
]
=
useState
<
UserInfoResp
|
null
|
undefined
>
(
null
);
const
[
needLogin
,
setNeedLogin
]
=
useState
<
Boolean
>
(
false
);
//用于通知登录modal需要打开
const
[
needLogin
,
setNeedLogin
]
=
useState
<
Boolean
>
(
false
);
//用于通知登录modal需要打开
useEffect
(()
=>
{
useEffect
(()
=>
{
try
{
try
{
setUserInfo
(
JSON
.
parse
(
window
.
localStorage
.
getItem
(
"userInfo"
)
||
""
));
setUserInfo
(
JSON
.
parse
(
window
.
localStorage
.
getItem
(
"userInfo"
)
||
""
)
||
undefined
);
}
catch
(
e
)
{}
}
catch
(
e
)
{}
},
[]);
},
[]);
...
@@ -48,7 +50,7 @@ const UserProvider = ({ children }: Props) => {
...
@@ -48,7 +50,7 @@ const UserProvider = ({ children }: Props) => {
if
(
res
.
code
==
"200"
)
{
if
(
res
.
code
==
"200"
)
{
window
.
localStorage
.
setItem
(
"token"
,
res
.
result
?.
token
||
""
);
window
.
localStorage
.
setItem
(
"token"
,
res
.
result
?.
token
||
""
);
api
.
userInfo
().
then
((
res
)
=>
{
api
.
userInfo
().
then
((
res
)
=>
{
setUserInfo
(
res
.
result
||
''
);
setUserInfo
(
res
.
result
||
undefined
);
});
});
}
}
});
});
...
@@ -57,7 +59,7 @@ const UserProvider = ({ children }: Props) => {
...
@@ -57,7 +59,7 @@ const UserProvider = ({ children }: Props) => {
//登出
//登出
function
logout
()
{
function
logout
()
{
localStorage
.
setItem
(
"token"
,
""
);
localStorage
.
setItem
(
"token"
,
""
);
setUserInfo
(
''
);
setUserInfo
(
undefined
);
}
}
return
(
return
(
...
...
pages/forum/api/index.tsx
浏览文件 @
cf95e53f
...
@@ -40,10 +40,9 @@ export interface CommentParams {
...
@@ -40,10 +40,9 @@ export interface CommentParams {
content
:
string
;
//评论内容
content
:
string
;
//评论内容
dynamicId
:
number
;
//动态id
dynamicId
:
number
;
//动态id
parentId
?:
number
;
//父级评论
parentId
?:
number
;
//父级评论
userId
:
number
;
//用户id
}
}
export
interface
ByDynamic
Params
{
export
interface
ByDynamic
Resp
{
id
:
number
;
id
:
number
;
dynamicId
:
number
;
dynamicId
:
number
;
parentId
:
number
;
parentId
:
number
;
...
@@ -51,7 +50,12 @@ export interface ByDynamicParams {
...
@@ -51,7 +50,12 @@ export interface ByDynamicParams {
content
:
string
;
content
:
string
;
likesCount
:
number
;
likesCount
:
number
;
createTime
:
string
;
createTime
:
string
;
children
:
ByDynamicParams
[];
children
:
ByDynamicResp
[];
userBaseInfoVO
:
{
id
:
number
,
nickName
:
string
,
userImg
:
string
}
}
}
export
default
{
export
default
{
...
@@ -70,7 +74,14 @@ export default {
...
@@ -70,7 +74,14 @@ export default {
},
},
//根据动态查看评论
//根据动态查看评论
byDynamic
(
params
:
{
dynamicId
:
number
}):
Promise
<
Response
<
Array
<
ByDynamicParams
>>>
{
byDynamic
(
params
:
{
dynamicId
:
number
;
}):
Promise
<
Response
<
Array
<
ByDynamicResp
>>>
{
return
request
(
"/release/dynamic/byDynamic"
,
"get"
,
params
);
return
request
(
"/release/dynamic/byDynamic"
,
"get"
,
params
);
},
},
//点赞或取消点赞
likeOrCancel
(
params
:
{
dynamicId
:
number
})
{
return
request
(
"/release/dynamic/likeOrCancel"
,
"get"
,
params
);
},
};
};
pages/forum/index.page.tsx
浏览文件 @
cf95e53f
...
@@ -15,14 +15,15 @@ import errImg from "~/assets/errImg";
...
@@ -15,14 +15,15 @@ import errImg from "~/assets/errImg";
import
{
RightOutlined
}
from
"@ant-design/icons"
;
import
{
RightOutlined
}
from
"@ant-design/icons"
;
import
{
useContext
,
useEffect
,
useState
}
from
"react"
;
import
{
useContext
,
useEffect
,
useState
}
from
"react"
;
import
PublishMessage
from
"./components/publishMessage"
;
import
PublishMessage
from
"./components/publishMessage"
;
import
api
,
{
ByDynamic
Params
,
Dynamic
}
from
"./api"
;
import
api
,
{
ByDynamic
Resp
,
Dynamic
}
from
"./api"
;
import
InfiniteScroll
from
"react-infinite-scroll-component"
;
import
InfiniteScroll
from
"react-infinite-scroll-component"
;
import
{
UserContext
}
from
"~/lib/userProvider"
;
import
{
UserContext
}
from
"~/lib/userProvider"
;
import
moment
from
"moment"
;
interface
Item
extends
Dynamic
{
interface
Item
extends
Dynamic
{
openComment
?:
boolean
;
//是否开启评论
openComment
?:
boolean
;
//是否开启评论
showCommentAll
?:
boolean
;
//是否展示全部评论
showCommentAll
?:
boolean
;
//是否展示全部评论
commentList
?:
Array
<
ByDynamic
Params
>
;
commentList
?:
Array
<
ByDynamic
Resp
>
;
//评论列表
}
}
export
default
function
Forum
()
{
export
default
function
Forum
()
{
...
@@ -34,6 +35,7 @@ export default function Forum() {
...
@@ -34,6 +35,7 @@ export default function Forum() {
});
});
const
[
count
,
setCount
]
=
useState
(
0
);
//动态总数
const
[
count
,
setCount
]
=
useState
(
0
);
//动态总数
const
{
userInfo
,
setNeedLogin
}
=
useContext
(
UserContext
);
const
{
userInfo
,
setNeedLogin
}
=
useContext
(
UserContext
);
const
[
form
]
=
Form
.
useForm
();
//评论区的form
useEffect
(()
=>
{
useEffect
(()
=>
{
api
api
...
@@ -78,27 +80,74 @@ export default function Forum() {
...
@@ -78,27 +80,74 @@ export default function Forum() {
item
.
openComment
=
!
item
.
openComment
;
item
.
openComment
=
!
item
.
openComment
;
const
temp
=
[...
list
];
const
temp
=
[...
list
];
setList
(
temp
);
setList
(
temp
);
getCommentList
(
item
);
};
};
//评论内容
//获取评论列表
const
onComment
=
(
values
:
any
,
id
:
number
,
i
:
number
)
=>
{
const
getCommentList
=
(
item
:
Item
)
=>
{
api
.
byDynamic
({
dynamicId
:
item
.
id
,
})
.
then
((
res
)
=>
{
if
(
res
?.
code
===
"200"
)
{
item
.
commentList
=
res
.
result
||
[];
}
const
temp
=
[...
list
];
setList
(
temp
);
});
};
//展示所有评论
const
showCommentAll
=
(
item
:
Item
)
=>
{
item
.
showCommentAll
=
true
;
const
temp
=
[...
list
];
setList
(
temp
);
};
//评论内容
const
onComment
=
(
values
:
any
,
item
:
Item
)
=>
{
if
(
userInfo
)
{
if
(
userInfo
)
{
api
api
.
comment
({
.
comment
({
content
:
values
.
content
,
content
:
values
.
content
,
dynamicId
:
id
,
dynamicId
:
item
.
id
,
userId
:
userInfo
.
id
,
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
code
===
"200"
)
{
if
(
res
.
code
===
"200"
)
{
window
.
messageApi
.
success
(
"评论成功"
);
window
.
messageApi
.
success
(
"评论成功"
);
form
.
resetFields
([
"content"
]);
item
.
commentCount
+=
1
;
getCommentList
(
item
);
}
}
});
});
}
else
{
}
else
{
setNeedLogin
(
true
);
setNeedLogin
(
true
);
}
}
};
};
//点赞或取消
const
onLike
=
(
item
:
Item
)
=>
{
if
(
userInfo
)
{
api
.
likeOrCancel
({
dynamicId
:
item
.
id
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
===
"200"
)
{
item
.
likes
=
!
item
.
likes
;
if
(
item
.
likes
)
{
item
.
likesCount
++
;
}
else
{
item
.
likesCount
--
;
}
const
temp
=
[...
list
];
setList
(
temp
);
}
});
}
};
return
(
return
(
<
Layout
>
<
Layout
>
<
div
className=
{
styles
.
forum
}
>
<
div
className=
{
styles
.
forum
}
>
...
@@ -169,7 +218,10 @@ export default function Forum() {
...
@@ -169,7 +218,10 @@ export default function Forum() {
></
div
>
></
div
>
{
item
.
commentCount
}
评论
{
item
.
commentCount
}
评论
</
div
>
</
div
>
<
div
className=
{
styles
.
ctrlsItem
}
>
<
div
className=
{
styles
.
ctrlsItem
}
onClick=
{
()
=>
onLike
(
item
)
}
>
<
div
<
div
className=
{
`${styles.ctrlsItemIcon} ${
className=
{
`${styles.ctrlsItemIcon} ${
styles.iconPraise
styles.iconPraise
...
@@ -183,8 +235,9 @@ export default function Forum() {
...
@@ -183,8 +235,9 @@ export default function Forum() {
{
item
.
openComment
&&
(
{
item
.
openComment
&&
(
<
div
className=
{
styles
.
commentWrap
}
>
<
div
className=
{
styles
.
commentWrap
}
>
<
Form
<
Form
form=
{
form
}
onFinish=
{
(
values
)
=>
{
onFinish=
{
(
values
)
=>
{
onComment
(
values
,
item
.
id
,
i
);
onComment
(
values
,
item
);
}
}
}
}
>
>
<
Form
.
Item
<
Form
.
Item
...
@@ -213,38 +266,53 @@ export default function Forum() {
...
@@ -213,38 +266,53 @@ export default function Forum() {
</
Form
>
</
Form
>
<
div
className=
{
styles
.
comments
}
>
<
div
className=
{
styles
.
comments
}
>
<
div
className=
{
styles
.
commentItem
}
>
{
/* 判断是否展示所有评论 */
}
<
div
className=
{
styles
.
commentHeadImg
}
></
div
>
{
item
.
commentList
<
div
className=
{
styles
.
info
}
>
?.
filter
((
comment
,
i
)
=>
{
<
div
className=
{
styles
.
nameWrap
}
>
if
(
item
.
showCommentAll
)
{
<
div
className=
{
styles
.
commentName
}
>
return
true
;
无人机爱好者111:
}
else
{
<
div
className=
{
styles
.
date
}
>
05-16
</
div
>
if
(
i
<
2
)
{
</
div
>
return
true
;
<
div
className=
{
styles
.
commentContent
}
>
}
无人机记录生活
}
})
.
map
((
comment
)
=>
{
return
(
<
div
key=
{
comment
.
id
}
className=
{
styles
.
commentItem
}
>
<
div
className=
{
styles
.
commentHeadImg
}
>
<
Image
src=
{
comment
.
userBaseInfoVO
?.
userImg
}
></
Image
>
</
div
>
<
div
className=
{
styles
.
info
}
>
<
div
className=
{
styles
.
nameWrap
}
>
<
div
className=
{
styles
.
commentName
}
>
{
comment
.
userBaseInfoVO
?.
nickName
}
:
<
div
className=
{
styles
.
date
}
>
{
moment
(
comment
.
createTime
).
format
(
"YYYY-MM-DD"
)
}
</
div
>
</
div
>
<
div
className=
{
styles
.
commentContent
}
>
{
comment
.
content
}
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
);
</
div
>
})
}
</
div
>
<
div
className=
{
styles
.
commentItem
}
>
<
div
className=
{
styles
.
commentHeadImg
}
></
div
>
<
div
className=
{
styles
.
info
}
>
<
div
className=
{
styles
.
nameWrap
}
>
<
div
className=
{
styles
.
commentName
}
>
无人机爱好者111:
<
div
className=
{
styles
.
date
}
>
05-16
</
div
>
</
div
>
<
div
className=
{
styles
.
commentContent
}
>
无人机记录生活
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
{
!
item
.
showCommentAll
&&
(
{
!
item
.
showCommentAll
&&
item
.
commentCount
>
2
&&
(
<
div
className=
{
styles
.
showAll
}
>
<
div
查看全部15条评论
className=
{
styles
.
showAll
}
onClick=
{
()
=>
showCommentAll
(
item
)
}
>
查看全部
{
item
.
commentCount
}
条评论
<
RightOutlined
size=
{
14
}
/>
<
RightOutlined
size=
{
14
}
/>
</
div
>
</
div
>
)
}
)
}
...
...
pages/projectInfo/components/bids/index.tsx
浏览文件 @
cf95e53f
...
@@ -22,13 +22,14 @@ export default function Bids(props: Props) {
...
@@ -22,13 +22,14 @@ export default function Bids(props: Props) {
const
[
count
,
setCount
]
=
useState
(
0
);
const
[
count
,
setCount
]
=
useState
(
0
);
const
[
abort
,
setAbort
]
=
useState
<
AbortController
|
null
>
(
null
);
const
[
abort
,
setAbort
]
=
useState
<
AbortController
|
null
>
(
null
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
{
userInfo
,
setNeedLogin
}
=
useContext
(
UserContext
);
const
{
userInfo
,
setNeedLogin
}
=
useContext
(
UserContext
);
const
[
reload
,
setReload
]
=
useState
(
false
);
useEffect
(()
=>
{
useEffect
(()
=>
{
//中断前一次请求
//中断前一次请求
abort
?.
abort
();
abort
?.
abort
();
setAbort
(
new
AbortController
());
setAbort
(
new
AbortController
());
},
[
pageParams
,
props
.
params
]);
},
[
pageParams
,
props
.
params
,
reload
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
abort
)
{
if
(
!
abort
)
{
...
@@ -70,6 +71,7 @@ export default function Bids(props: Props) {
...
@@ -70,6 +71,7 @@ export default function Bids(props: Props) {
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
code
===
"200"
)
{
if
(
res
.
code
===
"200"
)
{
window
.
messageApi
.
success
(
"申请成功"
);
window
.
messageApi
.
success
(
"申请成功"
);
setReload
(
!
reload
);
}
}
});
});
}
else
{
}
else
{
...
...
pages/projectInfo/components/requirements/api/index.ts
浏览文件 @
cf95e53f
...
@@ -24,6 +24,7 @@ export interface Item {
...
@@ -24,6 +24,7 @@ export interface Item {
publishName
:
string
;
publishName
:
string
;
publishPhone
:
string
;
publishPhone
:
string
;
requireDescription
:
string
;
requireDescription
:
string
;
requirementTypeName
:
string
;
solved
?:
0
|
1
;
solved
?:
0
|
1
;
createTime
:
string
;
createTime
:
string
;
updateTime
?:
string
;
updateTime
?:
string
;
...
@@ -31,7 +32,6 @@ export interface Item {
...
@@ -31,7 +32,6 @@ export interface Item {
export
interface
SolveRequireParams
{
export
interface
SolveRequireParams
{
requirementsInfoId
:
number
,
//需求id
requirementsInfoId
:
number
,
//需求id
userAccountId
:
number
//用户id
}
}
...
...
pages/projectInfo/components/requirements/index.module.scss
浏览文件 @
cf95e53f
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
}
}
.desc
{
.desc
{
width
:
fit-content
;
font-size
:
14px
;
font-size
:
14px
;
font-family
:
MicrosoftYaHei
;
font-family
:
MicrosoftYaHei
;
color
:
RGBA
(
135
,
135
,
135
,
0
.4
);
color
:
RGBA
(
135
,
135
,
135
,
0
.4
);
...
...
pages/projectInfo/components/requirements/index.tsx
浏览文件 @
cf95e53f
import
{
Button
,
Empty
,
Pagination
,
Popconfirm
,
Spin
}
from
"antd"
;
import
{
Button
,
Empty
,
Pagination
,
Popconfirm
,
Spin
,
Tooltip
}
from
"antd"
;
import
router
from
"next/router"
;
import
router
from
"next/router"
;
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
React
,
{
useState
,
useEffect
,
useContext
}
from
"react"
;
import
{
UserContext
}
from
"~/lib/userProvider"
;
import
api
,
{
Item
}
from
"./api"
;
import
api
,
{
Item
}
from
"./api"
;
import
styles
from
"./index.module.scss"
;
import
styles
from
"./index.module.scss"
;
...
@@ -22,12 +23,8 @@ export default function Requirements(props: Props) {
...
@@ -22,12 +23,8 @@ export default function Requirements(props: Props) {
});
});
const
[
count
,
setCount
]
=
useState
(
0
);
const
[
count
,
setCount
]
=
useState
(
0
);
const
[
abort
,
setAbort
]
=
useState
<
AbortController
|
null
>
(
null
);
const
[
abort
,
setAbort
]
=
useState
<
AbortController
|
null
>
(
null
);
const
[
userId
,
setUserId
]
=
useState
(
-
1
);
const
[
reload
,
setReload
]
=
useState
(
false
);
const
[
reload
,
setReload
]
=
useState
(
false
);
const
{
userInfo
}
=
useContext
(
UserContext
);
useEffect
(()
=>
{
setUserId
(
Number
(
window
.
localStorage
.
getItem
(
"userId"
)
||
-
1
));
},
[]);
useEffect
(()
=>
{
useEffect
(()
=>
{
//中断前一次请求
//中断前一次请求
...
@@ -72,7 +69,6 @@ export default function Requirements(props: Props) {
...
@@ -72,7 +69,6 @@ export default function Requirements(props: Props) {
api
api
.
solveRequire
({
.
solveRequire
({
requirementsInfoId
:
item
.
id
,
requirementsInfoId
:
item
.
id
,
userAccountId
:
userId
,
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
code
===
"200"
)
{
if
(
res
.
code
===
"200"
)
{
...
@@ -94,14 +90,16 @@ export default function Requirements(props: Props) {
...
@@ -94,14 +90,16 @@ export default function Requirements(props: Props) {
<
div
className=
{
styles
.
logo
}
></
div
>
<
div
className=
{
styles
.
logo
}
></
div
>
<
div
className=
{
styles
.
info
}
>
<
div
className=
{
styles
.
info
}
>
<
div
className=
{
styles
.
title
}
>
<
div
className=
{
styles
.
title
}
>
项目需求:
{
item
.
require
Description
}
项目需求:
{
item
.
require
mentTypeName
}
</
div
>
</
div
>
{
/*
<div className={styles.desc}>
<
Tooltip
placement=
"top"
title=
{
item
.
requireDescription
}
>
具体需求:{item.requireDescription}
<
div
className=
{
styles
.
desc
}
>
</div> */
}
具体需求:
{
item
.
requireDescription
}
</
div
>
</
Tooltip
>
</
div
>
</
div
>
{
item
.
userAccountId
===
userI
d
?
(
{
userInfo
&&
item
.
userAccountId
===
userInfo
.
i
d
?
(
<
Popconfirm
<
Popconfirm
title=
"提示"
title=
"提示"
description=
"确认该需求已经解决了吗?"
description=
"确认该需求已经解决了吗?"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论