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
30203adb
Commit
30203adb
authored
Nov 27, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:修改支付页面参数接受
parent
2e1f3cb9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
43 deletions
+40
-43
index.tsx
src/pages/lxMall/order/index.tsx
+1
-1
index.tsx
src/pages/lxMall/pay/components/balance/index.tsx
+6
-6
index.tsx
src/pages/lxMall/pay/components/credit/index.tsx
+6
-7
index.tsx
src/pages/lxMall/pay/components/point/index.tsx
+6
-6
index.tsx
src/pages/lxMall/pay/components/wechat/index.tsx
+2
-3
index.tsx
src/pages/lxMall/pay/index.tsx
+19
-20
No files found.
src/pages/lxMall/order/index.tsx
View file @
30203adb
...
...
@@ -332,7 +332,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
if
(
selectPayWay
.
payType
===
4
)
{
linkToUrl
(
`/pay/result?orderId=
${
data
.
orderId
}
`
)
}
else
{
linkToUrl
(
`/pay?orderId=
${
data
.
orderId
}
&spam_id=
${
spam_id
}
`
)
linkToUrl
(
`/pay?orderId=
${
btoa
(
JSON
.
stringify
({
orderId
:
data
.
orderId
,
memberId
:
orderInfo
.
supplyMembersId
,
memberRoleId
:
orderInfo
.
supplyMembersRoleId
}))
}
`
)
}
}
setConfirmLoading
(
false
)
...
...
src/pages/lxMall/pay/components/balance/index.tsx
View file @
30203adb
...
...
@@ -15,7 +15,7 @@ import styles from './index.less'
interface
BablancePayWayPropsType
{
payInfo
:
GetOrderOrderPayDetailsResponse
,
orderInfo
:
any
,
queryParam
:
any
,
orderId
:
number
,
onChange
:
Function
,
layoutType
?:
LAYOUT_TYPE
,
...
...
@@ -23,7 +23,7 @@ interface BablancePayWayPropsType {
}
const
BablancePayWay
:
React
.
FC
<
BablancePayWayPropsType
>
=
(
props
)
=>
{
const
{
payInfo
,
orderId
,
orderInfo
,
layoutType
,
shopUrlParam
,
onChange
}
=
props
const
{
payInfo
,
orderId
,
queryParam
,
layoutType
,
shopUrlParam
,
onChange
}
=
props
const
[
balanceInfo
,
setBalanceInfo
]
=
useState
<
GetPayAssetAccountGetUserBalanceResponse
>
(
0
)
const
[
securityInfo
,
setSecurityInfo
]
=
useState
<
GetMemberSecurityGetResponse
>
()
const
[
payPassword
,
setPayPassword
]
=
useState
<
string
>
(
''
)
...
...
@@ -36,17 +36,17 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => {
}
useEffect
(()
=>
{
if
(
orderInfo
&&
payInfo
)
{
if
(
queryParam
&&
payInfo
)
{
fetchBalanceInfo
()
fetchSecurity
()
}
},
[
orderInfo
,
payInfo
])
},
[
queryParam
,
payInfo
])
const
fetchBalanceInfo
=
()
=>
{
const
param
:
any
=
{
payType
:
payInfo
.
ruleConfigurationId
,
parentMemberId
:
orderInfo
.
supplyMembers
Id
,
parentMemberRoleId
:
orderInfo
.
supplyMembers
RoleId
parentMemberId
:
queryParam
.
member
Id
,
parentMemberRoleId
:
queryParam
.
member
RoleId
}
PublicApi
.
getPayAssetAccountGetUserBalance
(
param
).
then
(
res
=>
{
...
...
src/pages/lxMall/pay/components/credit/index.tsx
View file @
30203adb
...
...
@@ -15,7 +15,7 @@ import { message, Button, Spin } from 'antd'
interface
CreditPayWayPropsType
{
payInfo
:
GetOrderOrderPayDetailsResponse
,
orderInfo
:
any
,
queryParam
:
any
,
orderId
:
number
,
onChange
:
Function
,
layoutType
?:
LAYOUT_TYPE
,
...
...
@@ -23,9 +23,8 @@ interface CreditPayWayPropsType {
}
const
CreditPayWay
:
React
.
FC
<
CreditPayWayPropsType
>
=
(
props
)
=>
{
const
{
payInfo
,
orderId
,
orderInfo
,
layoutType
,
shopUrlParam
}
=
props
const
{
payInfo
,
orderId
,
queryParam
,
layoutType
,
shopUrlParam
}
=
props
const
[
payPassword
,
setPayPassword
]
=
useState
<
string
>
(
''
)
const
[
type
,
setType
]
=
useState
<
string
>
(
'normal'
)
// normal: 普通;member:会员
const
[
creditInfo
,
setCreditInfo
]
=
useState
<
GetPayCreditGetCreditResponse
>
()
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
<
boolean
>
(
false
)
const
[
securityInfo
,
setSecurityInfo
]
=
useState
<
GetMemberSecurityGetResponse
>
()
...
...
@@ -37,16 +36,16 @@ const CreditPayWay: React.FC<CreditPayWayPropsType> = (props) => {
}
useEffect
(()
=>
{
if
(
orderInfo
)
{
if
(
queryParam
)
{
fetchCreditInfo
()
fetchSecurity
()
}
},
[
orderInfo
])
},
[
queryParam
])
const
fetchCreditInfo
=
()
=>
{
const
param
:
any
=
{
parentMemberId
:
orderInfo
.
supplyMembers
Id
,
parentMemberRoleId
:
orderInfo
.
supplyMembers
RoleId
parentMemberId
:
queryParam
.
member
Id
,
parentMemberRoleId
:
queryParam
.
member
RoleId
}
PublicApi
.
getPayCreditGetCredit
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
...
...
src/pages/lxMall/pay/components/point/index.tsx
View file @
30203adb
...
...
@@ -14,7 +14,7 @@ import styles from './index.less'
interface
PointPayWayPropsType
{
payInfo
:
GetOrderOrderPayDetailsResponse
,
orderInfo
:
any
,
queryParam
:
any
,
orderId
:
number
,
onChange
:
Function
,
layoutType
?:
LAYOUT_TYPE
,
...
...
@@ -22,7 +22,7 @@ interface PointPayWayPropsType {
}
const
PointPayWay
:
React
.
FC
<
PointPayWayPropsType
>
=
(
props
)
=>
{
const
{
payInfo
,
orderId
,
orderInfo
,
layoutType
,
onChange
,
shopUrlParam
}
=
props
const
{
payInfo
,
orderId
,
queryParam
,
layoutType
,
onChange
,
shopUrlParam
}
=
props
const
[
securityInfo
,
setSecurityInfo
]
=
useState
<
GetMemberSecurityGetResponse
>
()
const
[
payPassword
,
setPayPassword
]
=
useState
<
string
>
(
''
)
const
[
pointInfo
,
setPointInfo
]
=
useState
<
GetMemberBusinessLrcRightPointGetResponse
>
()
...
...
@@ -40,16 +40,16 @@ const PointPayWay: React.FC<PointPayWayPropsType> = (props) => {
}
useEffect
(()
=>
{
if
(
orderInfo
)
{
if
(
queryParam
)
{
fetchPointInfo
()
fetchSecurity
()
}
},
[
orderInfo
])
},
[
queryParam
])
const
fetchPointInfo
=
()
=>
{
const
param
:
any
=
{
memberId
:
orderInfo
.
supplyMembers
Id
,
roleId
:
orderInfo
.
supplyMembers
RoleId
memberId
:
queryParam
.
member
Id
,
roleId
:
queryParam
.
member
RoleId
}
PublicApi
.
getMemberBusinessLrcRightPointGet
(
param
).
then
(
res
=>
{
...
...
src/pages/lxMall/pay/components/wechat/index.tsx
View file @
30203adb
...
...
@@ -12,7 +12,6 @@ import { useState } from 'react'
interface
WechatPayWayPropsType
{
payInfo
:
GetOrderOrderPayDetailsResponse
,
orderInfo
:
any
,
orderId
:
number
,
onChange
:
Function
,
layoutType
?:
LAYOUT_TYPE
,
...
...
@@ -20,7 +19,7 @@ interface WechatPayWayPropsType {
}
const
WechatPayWay
:
React
.
FC
<
WechatPayWayPropsType
>
=
(
props
)
=>
{
const
{
payInfo
,
orderId
,
onChange
,
orderInfo
,
layoutType
,
shopUrlParam
}
=
props
const
{
payInfo
,
orderId
,
onChange
,
layoutType
,
shopUrlParam
}
=
props
const
[
wechatPayUrl
,
setWechatPayUrl
]
=
useState
<
any
>
(
''
)
const
[
pageLoading
,
setPageLoading
]
=
useState
<
boolean
>
(
true
)
let
checkCount
=
0
...
...
@@ -64,7 +63,7 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
}
const
checkPayState
=
()
=>
{
if
(
checkCount
<
2
0
)
{
if
(
checkCount
<
2
4
)
{
let
param
=
{
id
:
Number
(
orderId
),
paymentInformationId
:
payInfo
.
paymentInformationId
,
...
...
src/pages/lxMall/pay/index.tsx
View file @
30203adb
...
...
@@ -51,32 +51,32 @@ const getPayTypeTitle = (type) => {
const
PayPage
:
React
.
FC
<
PayPagePropsType
>
=
(
props
)
=>
{
const
{
shopInfo
,
mallInfo
,
layoutType
}
=
props
const
[
payState
,
setPayState
]
=
useState
<
boolean
>
(
false
)
const
{
orderId
,
spam_id
}
=
props
.
location
.
query
const
{
orderId
}
=
props
.
location
.
query
const
[
pageTitle
,
setPageTitle
]
=
useState
<
string
>
()
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
true
)
const
[
payType
]
=
useState
<
string
|
number
>
(
PayWayType
.
bank
)
const
[
payInfo
,
setPayInfo
]
=
useState
<
GetOrderOrderPayDetailsResponse
>
()
const
[
errMsg
,
setErrMsg
]
=
useState
<
string
>
(
''
)
const
OrderStore
=
useLocalStore
(()
=>
store
.
OrderStore
)
const
[
orderInfo
,
setOrderInfo
]
=
useState
<
any
>
({})
const
{
getOrderInfo
}
=
OrderStore
const
[
query
,
setQuery
]
=
useState
<
any
>
({})
useEffect
(()
=>
{
initOrderInfo
()
if
(
orderId
)
{
fetchOrderInfo
()
try
{
let
queryParam
:
any
=
orderId
?
atob
(
orderId
)
:
undefined
queryParam
=
queryParam
?
JSON
.
parse
(
queryParam
)
:
{}
setQuery
(
queryParam
)
}
catch
(
error
)
{
console
.
log
(
error
)
setLoading
(
false
)
}
},
[])
const
initOrderInfo
=
async
()
=>
{
if
(
spam_id
)
{
const
sessionOrderInfo
:
any
=
await
getOrderInfo
(
spam_id
)
setOrderInfo
(
sessionOrderInfo
)
useEffect
(()
=>
{
if
(
query
.
orderId
)
{
fetchOrderInfo
()
}
}
}
,
[
query
])
const
fetchOrderInfo
=
()
=>
{
PublicApi
.
getOrderOrderPayDetails
({
id
:
orderId
}).
then
(
res
=>
{
PublicApi
.
getOrderOrderPayDetails
({
id
:
query
.
orderId
}).
then
(
res
=>
{
message
.
destroy
()
setLoading
(
false
)
if
(
res
.
code
===
1000
)
{
...
...
@@ -91,7 +91,6 @@ const PayPage: React.FC<PayPagePropsType> = (props) => {
}
const
handlePayChangge
=
(
state
,
errMsg
?)
=>
{
console
.
log
(
state
,
"state"
)
setPayState
(
state
)
errMsg
&&
setErrMsg
(
errMsg
)
}
...
...
@@ -103,17 +102,17 @@ const PayPage: React.FC<PayPagePropsType> = (props) => {
switch
(
payInfo
.
paymentChannelsId
)
{
case
PayWayType
.
point
:
return
<
PointPayWay
payInfo=
{
payInfo
}
orderInfo=
{
orderInfo
}
orderId=
{
orderId
}
onChange=
{
(
state
,
errMsg
)
=>
handlePayChangge
(
state
,
errMsg
)
}
{
...
props
}
/>
return
<
PointPayWay
payInfo=
{
payInfo
}
queryParam=
{
query
}
orderId=
{
query
.
orderId
}
onChange=
{
(
state
,
errMsg
)
=>
handlePayChangge
(
state
,
errMsg
)
}
{
...
props
}
/>
case
PayWayType
.
balance
:
return
<
BablancePayWay
payInfo=
{
payInfo
}
orderInfo=
{
orderInfo
}
orderId=
{
orderId
}
onChange=
{
(
state
,
errMsg
)
=>
handlePayChangge
(
state
,
errMsg
)
}
{
...
props
}
/>
return
<
BablancePayWay
payInfo=
{
payInfo
}
queryParam=
{
query
}
orderId=
{
query
.
orderId
}
onChange=
{
(
state
,
errMsg
)
=>
handlePayChangge
(
state
,
errMsg
)
}
{
...
props
}
/>
case
PayWayType
.
credit
:
return
<
CreditPayWay
payInfo=
{
payInfo
}
orderInfo=
{
orderInfo
}
orderId=
{
orderId
}
onChange=
{
(
state
,
errMsg
)
=>
handlePayChangge
(
state
,
errMsg
)
}
{
...
props
}
/>
return
<
CreditPayWay
payInfo=
{
payInfo
}
queryParam=
{
query
}
orderId=
{
query
.
orderId
}
onChange=
{
(
state
,
errMsg
)
=>
handlePayChangge
(
state
,
errMsg
)
}
{
...
props
}
/>
case
PayWayType
.
wechat
:
return
<
WechatPayWay
payInfo=
{
payInfo
}
orderI
nfo=
{
orderInfo
}
orderId=
{
orderId
}
onChange=
{
(
state
,
errMsg
)
=>
handlePayChangge
(
state
,
errMsg
)
}
{
...
props
}
/>
return
<
WechatPayWay
payInfo=
{
payInfo
}
orderI
d=
{
query
.
orderId
}
onChange=
{
(
state
,
errMsg
)
=>
handlePayChangge
(
state
,
errMsg
)
}
{
...
props
}
/>
case
PayWayType
.
bank
:
return
<
BankPayWay
/>
case
PayWayType
.
transfer
:
return
<
TransferPayWay
payInfo=
{
payInfo
}
orderId=
{
orderId
}
onChange=
{
(
state
,
errMsg
)
=>
handlePayChangge
(
state
,
errMsg
)
}
{
...
props
}
/>
return
<
TransferPayWay
payInfo=
{
payInfo
}
orderId=
{
query
.
orderId
}
onChange=
{
(
state
,
errMsg
)
=>
handlePayChangge
(
state
,
errMsg
)
}
{
...
props
}
/>
default
:
return
null
}
...
...
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