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
924ec0e0
Commit
924ec0e0
authored
Dec 15, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改结算支付订单相同导致服务支付
parent
f41c8893
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
index.tsx
...balance/accountsPayable/components/GetCodeModal/index.tsx
+13
-5
index.tsx
src/pages/balance/accountsPayable/settlementList/index.tsx
+11
-3
No files found.
src/pages/balance/accountsPayable/components/GetCodeModal/index.tsx
View file @
924ec0e0
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
use
Effect
,
use
State
}
from
'react'
;
import
{
Button
,
Input
,
message
,
Modal
}
from
'antd'
;
import
{
Button
,
Input
,
message
,
Modal
}
from
'antd'
;
import
styles
from
'./index.less'
import
styles
from
'./index.less'
import
useCountDown
from
'@/utils/hooks'
;
import
useCountDown
from
'@/utils/hooks'
;
...
@@ -13,11 +13,13 @@ interface Iprops {
...
@@ -13,11 +13,13 @@ interface Iprops {
// onResendCode: () => void,
// onResendCode: () => void,
/** 商户订单号 */
/** 商户订单号 */
tradeCode
:
string
tradeCode
:
string
onClose
?:
()
=>
void
onClose
?:
()
=>
void
,
/** 时间戳随机码 */
randomCode
:
string
}
}
const
GetCodeModal
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
GetCodeModal
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
{
title
=
'验证码'
,
onOk
,
visible
,
tradeCode
,
onClose
}
=
props
;
const
{
title
=
'验证码'
,
onOk
,
visible
,
tradeCode
,
onClose
,
randomCode
}
=
props
;
const
[
code
,
setCode
]
=
useState
<
string
>
(
""
);
const
[
code
,
setCode
]
=
useState
<
string
>
(
""
);
const
{
text
,
isActive
,
start
}
=
useCountDown
({
const
{
text
,
isActive
,
start
}
=
useCountDown
({
maxTime
:
60
,
maxTime
:
60
,
...
@@ -35,13 +37,19 @@ const GetCodeModal: React.FC<Iprops> = (props: Iprops) => {
...
@@ -35,13 +37,19 @@ const GetCodeModal: React.FC<Iprops> = (props: Iprops) => {
onOk
?.(
code
)
onOk
?.(
code
)
}
}
useEffect
(()
=>
{
if
(
visible
)
{
start
();
}
},
[
visible
])
const
handleChange
=
(
e
)
=>
{
const
handleChange
=
(
e
)
=>
{
setCode
(
e
.
target
.
value
);
setCode
(
e
.
target
.
value
);
}
}
const
handleSendCode
=
async
()
=>
{
const
handleSendCode
=
async
()
=>
{
const
{
code
,
data
}
=
await
getPayEAccountAllInPayReSendPayCode
({
const
{
code
,
data
}
=
await
getPayEAccountAllInPayReSendPayCode
({
tradeCode
:
tradeCode
tradeCode
:
`
${
tradeCode
}
-
${
randomCode
}
`
})
})
if
(
code
===
1000
)
{
if
(
code
===
1000
)
{
start
();
start
();
...
@@ -70,7 +78,7 @@ const GetCodeModal: React.FC<Iprops> = (props: Iprops) => {
...
@@ -70,7 +78,7 @@ const GetCodeModal: React.FC<Iprops> = (props: Iprops) => {
</
div
>
</
div
>
<
Button
disabled=
{
isActive
}
onClick=
{
handleSendCode
}
>
{
text
}
</
Button
>
<
Button
disabled=
{
isActive
}
onClick=
{
handleSendCode
}
>
{
text
}
</
Button
>
</
div
>
</
div
>
<
div
className=
{
styles
.
tips
}
>
已将验证码发送到您尾号为2800的手机号
</
div
>
{
/* <div className={styles.tips}>已将验证码发送到您尾号为2800的手机号</div> */
}
</
div
>
</
div
>
</
Modal
>
</
Modal
>
)
)
...
...
src/pages/balance/accountsPayable/settlementList/index.tsx
View file @
924ec0e0
...
@@ -54,6 +54,11 @@ const SettlementList = () => {
...
@@ -54,6 +54,11 @@ const SettlementList = () => {
const
[
files
,
setFiles
]
=
useState
([]);
const
[
files
,
setFiles
]
=
useState
([]);
const
[
qrcodeUrl
,
setQrcodeUrl
]
=
useState
<
string
>
(
""
);
const
[
qrcodeUrl
,
setQrcodeUrl
]
=
useState
<
string
>
(
""
);
const
[
currentUniversalPay
,
setCurrentUniversalPay
]
=
useState
<
UniversalPay
|
null
>
(
null
);
const
[
currentUniversalPay
,
setCurrentUniversalPay
]
=
useState
<
UniversalPay
|
null
>
(
null
);
/**
* 时间戳做随机码,
* 这里有个场景就是当我付款时,点微信支付等,然后取消了付款,再次点付款(微信支付),此时通联那边会认为这个支付订单会重复了,所以需要虚构一个随机码去标识一下
* */
const
[
randomCode
,
setRandomCode
]
=
useState
<
string
>
(
""
);
/** 轮询请求支付状态 */
/** 轮询请求支付状态 */
const
{
cycleCancel
,
cycleStart
,
result
}
=
useCycleRequest
({
offsetTime
:
3
,
endCount
:
10
});
const
{
cycleCancel
,
cycleStart
,
result
}
=
useCycleRequest
({
offsetTime
:
3
,
endCount
:
10
});
...
@@ -163,14 +168,16 @@ const SettlementList = () => {
...
@@ -163,14 +168,16 @@ const SettlementList = () => {
const
channel
=
params
.
payChannel
;
const
channel
=
params
.
payChannel
;
try
{
try
{
setUniversalPayLoading
(
true
)
setUniversalPayLoading
(
true
)
// TODO 加一个随机数
const
{
data
,
code
,
message
:
msg
}
=
await
postSettleAccountsMemberSettlementCommunicationPay
({
const
{
data
,
code
,
message
:
msg
}
=
await
postSettleAccountsMemberSettlementCommunicationPay
({
id
:
itemInfo
.
id
,
id
:
itemInfo
.
id
,
payChannelType
:
params
.
payChannel
,
payChannelType
:
params
.
payChannel
,
})
}
,
{
ctlType
:
'none'
}
)
if
(
code
!==
1000
)
{
if
(
code
!==
1000
)
{
message
.
error
(
msg
);
message
.
error
(
msg
);
return
;
return
;
}
}
setRandomCode
(
""
+
new
Date
().
valueOf
());
setCurrentUniversalPay
(
channel
as
UniversalPay
);
setCurrentUniversalPay
(
channel
as
UniversalPay
);
if
([
UNIVERSAL_PAY_WECHAT
,
UNIVERSAL_PAY_ALIPAY
].
includes
(
channel
))
{
if
([
UNIVERSAL_PAY_WECHAT
,
UNIVERSAL_PAY_ALIPAY
].
includes
(
channel
))
{
message
.
loading
({
message
.
loading
({
...
@@ -201,13 +208,14 @@ const SettlementList = () => {
...
@@ -201,13 +208,14 @@ const SettlementList = () => {
/** 轮询接口 */
/** 轮询接口 */
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
modals
.
qrcodeModal
)
{
if
(
modals
.
qrcodeModal
)
{
cycleStart
(
postSettleAccountsMemberSettlementCommunicationPayResult
,
{
settlementNo
:
itemInfo
.
settlementNo
});
cycleStart
(
postSettleAccountsMemberSettlementCommunicationPayResult
,
{
settlementNo
:
`
${
itemInfo
.
settlementNo
}
-
${
randomCode
}
`
});
}
}
},
[
modals
])
},
[
modals
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
result
&&
result
.
code
===
1000
&&
result
.
data
)
{
if
(
result
&&
result
.
code
===
1000
&&
result
.
data
)
{
message
.
success
(
'支付成功'
)
message
.
success
(
'支付成功'
)
handleClose
(
'qrcodeModal'
);
cycleCancel
();
cycleCancel
();
formActions
.
submit
();
formActions
.
submit
();
}
}
...
@@ -304,7 +312,7 @@ const SettlementList = () => {
...
@@ -304,7 +312,7 @@ const SettlementList = () => {
onOk=
{
handleCompleteSmsCode
}
onOk=
{
handleCompleteSmsCode
}
tradeCode=
{
itemInfo
?.
settlementNo
}
tradeCode=
{
itemInfo
?.
settlementNo
}
onClose=
{
()
=>
handleClose
(
'smsCodeModal'
)
}
onClose=
{
()
=>
handleClose
(
'smsCodeModal'
)
}
randomCode=
{
randomCode
}
/>
/>
</
PageHeaderWrapper
>
</
PageHeaderWrapper
>
)
)
...
...
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