Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
166a8ae3
Commit
166a8ae3
authored
Jul 21, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 收藏管理新增其他几个门户收藏列表
parent
7effb3e1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
393 additions
and
0 deletions
+393
-0
index.tsx
src/pages/systemSetting/collection/index.tsx
+12
-0
logistics.tsx
src/pages/systemSetting/collection/logistics.tsx
+127
-0
process.tsx
src/pages/systemSetting/collection/process.tsx
+127
-0
purchase.tsx
src/pages/systemSetting/collection/purchase.tsx
+127
-0
No files found.
src/pages/systemSetting/collection/index.tsx
View file @
166a8ae3
...
...
@@ -3,6 +3,9 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'
import
Commodity
from
'./commodity'
import
Infomation
from
'./information'
import
Shops
from
'./shops'
import
Purchase
from
'./purchase'
import
Logistics
from
'./logistics'
import
Process
from
'./process'
import
{
Tabs
}
from
'antd'
import
styles
from
'./index.less'
...
...
@@ -39,6 +42,15 @@ const Collection: React.FC<CollectionPropsType> = (props) => {
<
TabPane
tab=
"资讯收藏"
key=
"information"
>
<
Infomation
/>
</
TabPane
>
<
TabPane
tab=
"门户收藏"
key=
"srm"
>
<
Purchase
/>
</
TabPane
>
<
TabPane
tab=
"物流商收藏"
key=
"logistics"
>
<
Logistics
/>
</
TabPane
>
<
TabPane
tab=
"加工商收藏"
key=
"manufacture"
>
<
Process
/>
</
TabPane
>
</
Tabs
>
</
div
>
</
PageHeaderWrapper
>
...
...
src/pages/systemSetting/collection/logistics.tsx
0 → 100644
View file @
166a8ae3
import
React
,
{
useEffect
,
useState
}
from
'react'
import
cx
from
'classnames'
import
{
Pagination
,
message
,
Modal
}
from
'antd'
import
{
StarFilled
}
from
'@ant-design/icons'
import
{
PublicApi
}
from
'@/services/api'
import
{
LOGISTICS_CENTER_URL
}
from
'@/constants'
import
moment
from
'moment'
import
styles
from
'./index.less'
const
Logistics
:
React
.
FC
=
()
=>
{
const
[
list
,
setList
]
=
useState
([])
const
[
current
,
setCurrent
]
=
useState
<
number
>
(
1
)
const
[
pageSize
,
setPageSize
]
=
useState
<
number
>
(
10
)
const
[
totalCount
,
setTotalCount
]
=
useState
<
number
>
(
0
)
useEffect
(()
=>
{
fetchCollectList
()
},
[
current
])
/**
* 获取收藏的资讯列表
*/
const
fetchCollectList
=
()
=>
{
const
param
:
any
=
{
current
,
pageSize
}
PublicApi
.
getTemplateWebMemberLogisticsWebCollectList
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setList
(
res
.
data
.
data
)
setTotalCount
(
res
.
data
.
totalCount
)
}
})
}
const
handleChange
=
(
page
)
=>
{
setCurrent
(
page
)
}
const
linkToDetail
=
(
detail
)
=>
{
if
(
detail
.
status
!==
0
)
{
const
el
=
document
.
createElement
(
'a'
)
el
.
href
=
`
${
LOGISTICS_CENTER_URL
}
/aboutUs/
${
detail
.
id
}
`
;
el
.
target
=
'_blank'
;
el
.
id
=
detail
.
id
if
(
!
document
.
getElementById
(
detail
.
id
))
{
document
.
body
.
appendChild
(
el
);
}
el
.
click
()
}
else
{
message
.
destroy
()
message
.
info
(
"物流商已被冻结"
)
}
}
const
handleCancelCollect
=
(
detail
)
=>
{
Modal
.
confirm
({
centered
:
true
,
className
:
styles
.
mallComfirm
,
content
:
`是否要取消收藏?`
,
onOk
:
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
param
=
{
id
:
detail
.
id
,
status
:
false
}
PublicApi
.
postTemplateWebMemberLogisticsWebCollect
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
// fetchPurchaseList()
fetchCollectList
()
resolve
(
true
)
}
else
{
reject
()
}
}).
catch
(()
=>
{
reject
()
})
})
}
})
}
return
(
<>
<
div
className=
{
styles
.
information_list
}
>
{
list
&&
list
.
map
((
item
,
index
)
=>
(
<
div
className=
{
styles
.
information_list_item
}
key=
{
`information_list_item_${index}`
}
>
<
div
className=
{
cx
(
styles
.
information_list_item_item
,
styles
.
morehalf
)
}
>
<
div
className=
{
styles
.
information_header_info
}
>
<
div
className=
{
styles
.
information_header_info_logo
}
>
<
img
src=
{
item
.
logo
}
/>
</
div
>
<
div
className=
{
styles
.
information_header_info_content
}
>
<
div
className=
{
styles
.
information_header_info_content_name
}
onClick=
{
()
=>
linkToDetail
(
item
)
}
>
<
span
>
{
item
.
memberName
}
</
span
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
information_list_item_item
)
}
>
<
span
className=
{
styles
.
date
}
>
{
moment
(
item
.
createTime
).
format
(
"YYYY-MM-DD HH:mm"
)
}
</
span
>
</
div
>
<
div
className=
{
cx
(
styles
.
information_list_item_item
)
}
onClick=
{
()
=>
handleCancelCollect
(
item
)
}
>
<
div
className=
{
cx
(
styles
.
collection_state
)
}
>
<
StarFilled
/>
<
label
>
收藏
</
label
>
</
div
>
</
div
>
</
div
>
))
}
</
div
>
{
totalCount
>
0
&&
(
<
div
className=
{
styles
.
pagination_wrap
}
>
<
Pagination
showSizeChanger=
{
false
}
current=
{
current
}
total=
{
totalCount
}
pageSize=
{
pageSize
}
onChange=
{
handleChange
}
/>
</
div
>
)
}
</>
)
}
export
default
Logistics
src/pages/systemSetting/collection/process.tsx
0 → 100644
View file @
166a8ae3
import
React
,
{
useEffect
,
useState
}
from
'react'
import
cx
from
'classnames'
import
{
Pagination
,
message
,
Modal
}
from
'antd'
import
{
StarFilled
}
from
'@ant-design/icons'
import
{
PublicApi
}
from
'@/services/api'
import
{
MANUFACTURE_CENTER_URL
}
from
'@/constants'
import
moment
from
'moment'
import
styles
from
'./index.less'
const
Process
:
React
.
FC
=
()
=>
{
const
[
list
,
setList
]
=
useState
([])
const
[
current
,
setCurrent
]
=
useState
<
number
>
(
1
)
const
[
pageSize
,
setPageSize
]
=
useState
<
number
>
(
10
)
const
[
totalCount
,
setTotalCount
]
=
useState
<
number
>
(
0
)
useEffect
(()
=>
{
fetchCollectList
()
},
[
current
])
/**
* 获取收藏的资讯列表
*/
const
fetchCollectList
=
()
=>
{
const
param
:
any
=
{
current
,
pageSize
}
PublicApi
.
getTemplateWebMemberProcessWebCollectList
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setList
(
res
.
data
.
data
)
setTotalCount
(
res
.
data
.
totalCount
)
}
})
}
const
handleChange
=
(
page
)
=>
{
setCurrent
(
page
)
}
const
linkToDetail
=
(
detail
)
=>
{
if
(
detail
.
status
!==
0
)
{
const
el
=
document
.
createElement
(
'a'
)
el
.
href
=
`
${
MANUFACTURE_CENTER_URL
}
/aboutUs/
${
detail
.
id
}
`
;
el
.
target
=
'_blank'
;
el
.
id
=
detail
.
id
if
(
!
document
.
getElementById
(
detail
.
id
))
{
document
.
body
.
appendChild
(
el
);
}
el
.
click
()
}
else
{
message
.
destroy
()
message
.
info
(
"加工商已被冻结"
)
}
}
const
handleCancelCollect
=
(
detail
)
=>
{
Modal
.
confirm
({
centered
:
true
,
className
:
styles
.
mallComfirm
,
content
:
`是否要取消收藏?`
,
onOk
:
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
param
=
{
id
:
detail
.
id
,
status
:
false
}
PublicApi
.
postTemplateWebMemberProcessWebCollect
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
// fetchPurchaseList()
fetchCollectList
()
resolve
(
true
)
}
else
{
reject
()
}
}).
catch
(()
=>
{
reject
()
})
})
}
})
}
return
(
<>
<
div
className=
{
styles
.
information_list
}
>
{
list
&&
list
.
map
((
item
,
index
)
=>
(
<
div
className=
{
styles
.
information_list_item
}
key=
{
`information_list_item_${index}`
}
>
<
div
className=
{
cx
(
styles
.
information_list_item_item
,
styles
.
morehalf
)
}
>
<
div
className=
{
styles
.
information_header_info
}
>
<
div
className=
{
styles
.
information_header_info_logo
}
>
<
img
src=
{
item
.
logo
}
/>
</
div
>
<
div
className=
{
styles
.
information_header_info_content
}
>
<
div
className=
{
styles
.
information_header_info_content_name
}
onClick=
{
()
=>
linkToDetail
(
item
)
}
>
<
span
>
{
item
.
memberName
}
</
span
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
information_list_item_item
)
}
>
<
span
className=
{
styles
.
date
}
>
{
moment
(
item
.
createTime
).
format
(
"YYYY-MM-DD HH:mm"
)
}
</
span
>
</
div
>
<
div
className=
{
cx
(
styles
.
information_list_item_item
)
}
onClick=
{
()
=>
handleCancelCollect
(
item
)
}
>
<
div
className=
{
cx
(
styles
.
collection_state
)
}
>
<
StarFilled
/>
<
label
>
收藏
</
label
>
</
div
>
</
div
>
</
div
>
))
}
</
div
>
{
totalCount
>
0
&&
(
<
div
className=
{
styles
.
pagination_wrap
}
>
<
Pagination
showSizeChanger=
{
false
}
current=
{
current
}
total=
{
totalCount
}
pageSize=
{
pageSize
}
onChange=
{
handleChange
}
/>
</
div
>
)
}
</>
)
}
export
default
Process
src/pages/systemSetting/collection/purchase.tsx
0 → 100644
View file @
166a8ae3
import
React
,
{
useEffect
,
useState
}
from
'react'
import
cx
from
'classnames'
import
{
Pagination
,
message
,
Modal
}
from
'antd'
import
{
StarFilled
}
from
'@ant-design/icons'
import
{
PublicApi
}
from
'@/services/api'
import
{
SRM_CENTER_URL
}
from
'@/constants'
import
moment
from
'moment'
import
styles
from
'./index.less'
const
Purchase
:
React
.
FC
=
()
=>
{
const
[
list
,
setList
]
=
useState
([])
const
[
current
,
setCurrent
]
=
useState
<
number
>
(
1
)
const
[
pageSize
,
setPageSize
]
=
useState
<
number
>
(
10
)
const
[
totalCount
,
setTotalCount
]
=
useState
<
number
>
(
0
)
useEffect
(()
=>
{
fetchCollectPurchaseList
()
},
[
current
])
/**
* 获取收藏的资讯列表
*/
const
fetchCollectPurchaseList
=
()
=>
{
const
param
:
any
=
{
current
,
pageSize
}
PublicApi
.
getTemplateWebMemberPurchaseWebCollectList
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setList
(
res
.
data
.
data
)
setTotalCount
(
res
.
data
.
totalCount
)
}
})
}
const
handleChange
=
(
page
)
=>
{
setCurrent
(
page
)
}
const
linkToDetail
=
(
detail
)
=>
{
if
(
detail
.
status
!==
0
)
{
const
el
=
document
.
createElement
(
'a'
)
el
.
href
=
`
${
SRM_CENTER_URL
}
/shopIndex/
${
detail
.
id
}
`
;
el
.
target
=
'_blank'
;
el
.
id
=
detail
.
id
if
(
!
document
.
getElementById
(
detail
.
id
))
{
document
.
body
.
appendChild
(
el
);
}
el
.
click
()
}
else
{
message
.
destroy
()
message
.
info
(
"该门户已被冻结"
)
}
}
const
handleCancelCollect
=
(
detail
)
=>
{
Modal
.
confirm
({
centered
:
true
,
className
:
styles
.
mallComfirm
,
content
:
`是否要取消收藏?`
,
onOk
:
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
param
=
{
id
:
detail
.
id
,
status
:
false
}
PublicApi
.
postTemplateWebMemberPurchaseWebCollect
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
// fetchPurchaseList()
fetchCollectPurchaseList
()
resolve
(
true
)
}
else
{
reject
()
}
}).
catch
(()
=>
{
reject
()
})
})
}
})
}
return
(
<>
<
div
className=
{
styles
.
information_list
}
>
{
list
&&
list
.
map
((
item
,
index
)
=>
(
<
div
className=
{
styles
.
information_list_item
}
key=
{
`information_list_item_${index}`
}
>
<
div
className=
{
cx
(
styles
.
information_list_item_item
,
styles
.
morehalf
)
}
>
<
div
className=
{
styles
.
information_header_info
}
>
<
div
className=
{
styles
.
information_header_info_logo
}
>
<
img
src=
{
item
.
logo
}
/>
</
div
>
<
div
className=
{
styles
.
information_header_info_content
}
>
<
div
className=
{
styles
.
information_header_info_content_name
}
onClick=
{
()
=>
linkToDetail
(
item
)
}
>
<
span
>
{
item
.
memberName
}
</
span
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
information_list_item_item
)
}
>
<
span
className=
{
styles
.
date
}
>
{
moment
(
item
.
createTime
).
format
(
"YYYY-MM-DD HH:mm"
)
}
</
span
>
</
div
>
<
div
className=
{
cx
(
styles
.
information_list_item_item
)
}
onClick=
{
()
=>
handleCancelCollect
(
item
)
}
>
<
div
className=
{
cx
(
styles
.
collection_state
)
}
>
<
StarFilled
/>
<
label
>
收藏
</
label
>
</
div
>
</
div
>
</
div
>
))
}
</
div
>
{
totalCount
>
0
&&
(
<
div
className=
{
styles
.
pagination_wrap
}
>
<
Pagination
showSizeChanger=
{
false
}
current=
{
current
}
total=
{
totalCount
}
pageSize=
{
pageSize
}
onChange=
{
handleChange
}
/>
</
div
>
)
}
</>
)
}
export
default
Purchase
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment