Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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
linweijiong
jinfa-admin
Commits
5b6e6d9f
Commit
5b6e6d9f
authored
Dec 07, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:处理订单确认支付结果无法返回列表页
parent
032b8057
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
index.tsx
...stem/orderDetail/components/orderPayResultModal/index.tsx
+14
-11
No files found.
src/pages/orderSystem/orderDetail/components/orderPayResultModal/index.tsx
View file @
5b6e6d9f
...
...
@@ -4,9 +4,8 @@ import { usePageStatus } from '@/hooks/usePageStatus'
import
{
OrderDetailContext
}
from
'../../context'
import
{
PayOutWorkState
}
from
'@/constants'
import
{
PublicApi
}
from
'@/services/api'
import
{
history
,
Link
}
from
'umi'
import
{
history
}
from
'umi'
import
OverflowText
from
'@/components/OverflowText'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
export
interface
OrderPayResultModalProps
{
type
:
'default'
|
'preview'
,
...
...
@@ -17,9 +16,8 @@ const OrderPayResultModal:React.FC<OrderPayResultModalProps> = ({type, currentRe
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
{
id
}
=
usePageStatus
()
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
[
isReady
,
setIsReady
]
=
useState
()
const
[
isReady
,
setIsReady
]
=
useState
<
any
>
()
const
canCtlData
=
data
.
paymentInformationResponses
.
find
(
v
=>
v
.
externalState
===
PayOutWorkState
.
READY_CONFIRM_RESULT
)
||
{}
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderPlatformConfirmedPaymentResultsOrder
)
const
transData
=
canCtlData
.
payOrderUrls
?.
split
(
','
)
||
[]
useEffect
(()
=>
{
...
...
@@ -35,7 +33,7 @@ const OrderPayResultModal:React.FC<OrderPayResultModalProps> = ({type, currentRe
setVisible
(
false
)
}
const
handleConfirm
=
async
(
isReady
)
=>
{
const
handleConfirm
=
(
isReady
)
=>
{
setIsReady
(
isReady
)
const
params
=
{
state
:
isReady
,
...
...
@@ -43,10 +41,15 @@ const OrderPayResultModal:React.FC<OrderPayResultModalProps> = ({type, currentRe
paymentInformationId
:
canCtlData
.
id
}
const
res
=
await
run
(
params
)
if
(
res
&&
res
.
code
===
1000
)
{
history
.
goBack
()
}
PublicApi
.
postOrderPlatformConfirmedPaymentResultsOrder
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setTimeout
(()
=>
{
history
.
goBack
()
},
1000
)
}
else
{
setIsReady
(
null
)
}
})
}
return
(
...
...
@@ -56,8 +59,8 @@ const OrderPayResultModal:React.FC<OrderPayResultModalProps> = ({type, currentRe
onCancel=
{
handleCancel
}
footer=
{
(
type
===
'default'
&&
transData
)
?
<
Space
>
<
Button
onClick=
{
handleCancel
}
>
取消
</
Button
>
<
Button
loading=
{
isReady
===
0
&&
loading
}
onClick=
{
()
=>
handleConfirm
(
0
)
}
type=
'dashed'
>
确认未到账
</
Button
>
<
Button
loading=
{
isReady
===
1
&&
loading
}
onClick=
{
()
=>
handleConfirm
(
1
)
}
type=
'primary'
>
确认到账
</
Button
>
<
Button
loading=
{
isReady
===
0
}
onClick=
{
()
=>
handleConfirm
(
0
)
}
type=
'dashed'
>
确认未到账
</
Button
>
<
Button
loading=
{
isReady
===
1
}
onClick=
{
()
=>
handleConfirm
(
1
)
}
type=
'primary'
>
确认到账
</
Button
>
</
Space
>
:
null
}
>
<
List
...
...
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