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
shenshaokai
jinfa-platform
Commits
88f9d246
Commit
88f9d246
authored
Mar 18, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 订单线下支付线上确认方式凭证数据格式更改为数组
parent
bceb5830
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
83 deletions
+84
-83
index.tsx
src/pages/transaction/components/orderPayModal/index.tsx
+2
-1
index.tsx
...ages/transaction/components/orderPayResultModal/index.tsx
+82
-82
No files found.
src/pages/transaction/components/orderPayModal/index.tsx
View file @
88f9d246
...
...
@@ -311,7 +311,8 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
}
params
.
payPassword
=
encryptedByAES
(
code
)
}
else
if
(
current
===
1
)
{
params
.
payOrderUrls
=
payOrderUrls
.
join
(
','
)
// params.payOrderUrls = payOrderUrls.join(',')
params
.
payOrderUrls
=
payOrderUrls
}
if
(
!
settleAccountsError
)
{
...
...
src/pages/transaction/components/orderPayResultModal/index.tsx
View file @
88f9d246
import
React
,
{
useState
,
useEffect
,
useContext
,
useRef
}
from
'react'
import
{
Modal
,
List
,
Avatar
,
Button
,
Space
}
from
'antd'
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
import
{
OrderDetailContext
}
from
'../../_public/order/context'
import
{
PayOutWorkState
}
from
'@/constants'
import
{
PublicApi
}
from
'@/services/api'
import
{
history
,
Link
}
from
'umi'
import
OverflowText
from
'@/components/OverflowText'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
ImagePreview
from
'@/components/ImagePreview'
export
interface
OrderPayResultModalProps
{
type
:
'default'
|
'preview'
,
currentRef
:
any
}
const
OrderPayResultModal
:
React
.
FC
<
OrderPayResultModalProps
>
=
({
type
,
currentRef
})
=>
{
const
imgRef
=
useRef
<
any
>
({})
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
{
id
}
=
usePageStatus
()
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
canCtlData
=
data
?.
paymentInformationResponses
.
find
(
v
=>
v
.
externalState
===
PayOutWorkState
.
READY_CONFIRM_RESULT
)
||
{}
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderConfirmedPaymentResultsOrder
)
const
transData
=
canCtlData
.
payOrderUrls
?
canCtlData
.
payOrderUrls
.
split
(
','
)
:
[]
useEffect
(()
=>
{
if
(
currentRef
)
{
currentRef
.
current
=
{
visible
,
setVisible
}
}
},
[])
const
handleCancel
=
()
=>
{
setVisible
(
false
)
}
const
handleConfirm
=
async
(
isReady
)
=>
{
const
params
=
{
state
:
isReady
,
id
:
Number
(
id
),
paymentInformationId
:
canCtlData
.
id
}
const
{
code
}
=
await
run
(
params
)
if
(
code
===
1000
)
{
history
.
goBack
()
}
}
return
(
<
Modal
title=
{
type
===
'default'
?
'确认支付结果'
:
'查看支付结果'
}
visible=
{
visible
}
onCancel=
{
handleCancel
}
confirmLoading=
{
loading
}
footer=
{
(
type
===
'default'
&&
transData
)
?
<
Space
>
<
Button
onClick=
{
handleCancel
}
>
取消
</
Button
>
<
Button
onClick=
{
()
=>
handleConfirm
(
0
)
}
type=
'dashed'
>
确认未到账
</
Button
>
<
Button
onClick=
{
()
=>
handleConfirm
(
1
)
}
type=
'primary'
>
确认到账
</
Button
>
</
Space
>
:
null
}
>
<
List
itemLayout=
"horizontal"
dataSource=
{
transData
||
[]
}
renderItem=
{
(
item
:
string
,
index
:
number
)
=>
(
<
List
.
Item
style=
{
{
fontSize
:
12
}
}
extra=
{
<
Button
type=
'link'
onClick=
{
()
=>
imgRef
.
current
.
toggle
(
index
)
}
>
预览
</
Button
>
}
>
<
OverflowText
style=
{
{
flex
:
'.9'
}
}
>
{
item
}
</
OverflowText
>
<
ImagePreview
src=
{
transData
||
[]
}
currentRef=
{
imgRef
}
/>
</
List
.
Item
>
)
}
/>
</
Modal
>
)
}
OrderPayResultModal
.
defaultProps
=
{}
export
default
OrderPayResultModal
\ No newline at end of file
import
React
,
{
useState
,
useEffect
,
useContext
,
useRef
}
from
'react'
import
{
Modal
,
List
,
Avatar
,
Button
,
Space
}
from
'antd'
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
import
{
OrderDetailContext
}
from
'../../_public/order/context'
import
{
PayOutWorkState
}
from
'@/constants'
import
{
PublicApi
}
from
'@/services/api'
import
{
history
,
Link
}
from
'umi'
import
OverflowText
from
'@/components/OverflowText'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
ImagePreview
from
'@/components/ImagePreview'
export
interface
OrderPayResultModalProps
{
type
:
'default'
|
'preview'
,
currentRef
:
any
}
const
OrderPayResultModal
:
React
.
FC
<
OrderPayResultModalProps
>
=
({
type
,
currentRef
})
=>
{
const
imgRef
=
useRef
<
any
>
({})
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
{
id
}
=
usePageStatus
()
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
canCtlData
=
data
?.
paymentInformationResponses
.
find
(
v
=>
v
.
externalState
===
PayOutWorkState
.
READY_CONFIRM_RESULT
)
||
{}
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderConfirmedPaymentResultsOrder
)
// const transData = canCtlData.payOrderUrls ? canCtlData.payOrderUrls.split(',') : []
const
transData
=
canCtlData
.
payOrderUrls
?
canCtlData
.
payOrderUrls
:
[]
useEffect
(()
=>
{
if
(
currentRef
)
{
currentRef
.
current
=
{
visible
,
setVisible
}
}
},
[])
const
handleCancel
=
()
=>
{
setVisible
(
false
)
}
const
handleConfirm
=
async
(
isReady
)
=>
{
const
params
=
{
state
:
isReady
,
id
:
Number
(
id
),
paymentInformationId
:
canCtlData
.
id
}
const
{
code
}
=
await
run
(
params
)
if
(
code
===
1000
)
{
history
.
goBack
()
}
}
return
(
<
Modal
title=
{
type
===
'default'
?
'确认支付结果'
:
'查看支付结果'
}
visible=
{
visible
}
onCancel=
{
handleCancel
}
confirmLoading=
{
loading
}
footer=
{
(
type
===
'default'
&&
transData
)
?
<
Space
>
<
Button
onClick=
{
handleCancel
}
>
取消
</
Button
>
<
Button
onClick=
{
()
=>
handleConfirm
(
0
)
}
type=
'dashed'
>
确认未到账
</
Button
>
<
Button
onClick=
{
()
=>
handleConfirm
(
1
)
}
type=
'primary'
>
确认到账
</
Button
>
</
Space
>
:
null
}
>
<
List
itemLayout=
"horizontal"
dataSource=
{
transData
||
[]
}
renderItem=
{
(
item
:
string
,
index
:
number
)
=>
(
<
List
.
Item
style=
{
{
fontSize
:
12
}
}
extra=
{
<
Button
type=
'link'
onClick=
{
()
=>
imgRef
.
current
.
toggle
(
index
)
}
>
预览
</
Button
>
}
>
<
OverflowText
style=
{
{
flex
:
'.9'
}
}
>
{
item
}
</
OverflowText
>
<
ImagePreview
src=
{
transData
||
[]
}
currentRef=
{
imgRef
}
/>
</
List
.
Item
>
)
}
/>
</
Modal
>
)
}
OrderPayResultModal
.
defaultProps
=
{}
export
default
OrderPayResultModal
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