Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
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
baiguangyao
mr-julyedu
Commits
f3808f1e
Commit
f3808f1e
authored
Aug 20, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直播见
parent
05868f1d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
src/components/order/payOrder/PayOrder.js
+23
-0
No files found.
src/components/order/payOrder/PayOrder.js
View file @
f3808f1e
...
@@ -47,6 +47,28 @@ export default class PayOrder extends Component {
...
@@ -47,6 +47,28 @@ export default class PayOrder extends Component {
categoryList
:
[],
categoryList
:
[],
}
}
}
}
// 支付成功后,判断并重定向
redirectAfterPay
=
()
=>
{
// status:0成功,1失败
const
status
=
getParam
(
'status'
);
const
type
=
getParam
(
'type'
);
const
oid
=
getParam
(
'oid'
);
const
{
history
}
=
this
.
props
;
if
(
status
||
type
)
{
if
(
parseInt
(
status
,
10
)
===
0
)
{
// type订单类型 0普通订单 1团购 2小团 3砍价 4单集购买 5定金课定金 6定金课尾款
if
(
parseInt
(
type
,
10
)
===
2
)
{
history
.
push
(
`/togroup?id=
${
oid
}
`
);
}
else
{
history
.
push
(
'/purchased'
);
}
}
else
{
Toast
.
info
(
'支付异常'
,
2
);
}
}
}
onChange
=
(
value
)
=>
{
onChange
=
(
value
)
=>
{
this
.
setState
({
this
.
setState
({
payType
:
value
,
payType
:
value
,
...
@@ -178,6 +200,7 @@ export default class PayOrder extends Component {
...
@@ -178,6 +200,7 @@ export default class PayOrder extends Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
redirectAfterPay
()
http
.
post
(
`
${
API
[
'base-api'
]}
/m/order/detail`
,
{
order_id
:
this
.
state
.
orderId
}).
then
((
res
)
=>
{
http
.
post
(
`
${
API
[
'base-api'
]}
/m/order/detail`
,
{
order_id
:
this
.
state
.
orderId
}).
then
((
res
)
=>
{
console
.
log
(
res
);
console
.
log
(
res
);
if
(
res
.
data
.
errno
!==
200
)
{
if
(
res
.
data
.
errno
!==
200
)
{
...
...
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