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
22d27f71
Commit
22d27f71
authored
Aug 22, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单集购买
parent
6c926cda
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
19 deletions
+5
-19
src/components/detail/single/index.js
+5
-19
No files found.
src/components/detail/single/index.js
View file @
22d27f71
...
@@ -80,25 +80,7 @@ class Single extends Component {
...
@@ -80,25 +80,7 @@ class Single extends Component {
}
}
})
})
}
}
onBridgeReady
=
(
data
)
=>
{
WeixinJSBridge
.
invoke
(
'getBrandWCPayRequest'
,
{
"appId"
:
data
.
appId
,
//公众号名称,由商户传入
"timeStamp"
:
data
.
timeStamp
,
//时间戳,自1970年以来的秒数
"nonceStr"
:
data
.
nonceStr
,
//随机串
"package"
:
data
.
package
,
"signType"
:
data
.
signType
,
//微信签名方式:
"paySign"
:
data
.
paySign
//微信签名
},
function
(
res
)
{
if
(
res
.
err_msg
==
"get_brand_wcpay_request:ok"
)
{
this
.
payCallback
()
}
else
{
alert
(
'支付失败'
)
}
}
)
}
// 微信内部支付
// 微信内部支付
isweixinPay
=
()
=>
{
isweixinPay
=
()
=>
{
let
_this
=
this
;
let
_this
=
this
;
...
@@ -130,6 +112,7 @@ class Single extends Component {
...
@@ -130,6 +112,7 @@ class Single extends Component {
_this
.
intervalPayStatus
=
null
;
_this
.
intervalPayStatus
=
null
;
// 获取课程类型
// 获取课程类型
http
.
get
(
`
${
API
[
'base-api'
]}
/class_order_status/
${
getParam
(
'oid'
)}
`
).
then
((
res
)
=>
{
http
.
get
(
`
${
API
[
'base-api'
]}
/class_order_status/
${
getParam
(
'oid'
)}
`
).
then
((
res
)
=>
{
Toast
.
info
(
Number
(
res
.
data
.
data
.
errno
));
if
(
Number
(
res
.
data
.
data
.
errno
)
===
200
)
{
if
(
Number
(
res
.
data
.
data
.
errno
)
===
200
)
{
// 正常购买单集成功
// 正常购买单集成功
this
.
setState
({
this
.
setState
({
...
@@ -186,6 +169,7 @@ class Single extends Component {
...
@@ -186,6 +169,7 @@ class Single extends Component {
// 支付完成之后获取状态
// 支付完成之后获取状态
payCallback
=
()
=>
{
payCallback
=
()
=>
{
const
_this
=
this
;
const
_this
=
this
;
if
(
getParam
(
'oid'
))
{
_this
.
intervalPayStatus
=
setInterval
(
function
()
{
_this
.
intervalPayStatus
=
setInterval
(
function
()
{
http
.
get
(
`
${
API
[
'base-api'
]}
/m/orderState/oid/
${
getParam
(
'oid'
)}
`
).
then
(
res
=>
{
http
.
get
(
`
${
API
[
'base-api'
]}
/m/orderState/oid/
${
getParam
(
'oid'
)}
`
).
then
(
res
=>
{
if
(
res
.
data
.
errno
===
401
)
{
if
(
res
.
data
.
errno
===
401
)
{
...
@@ -224,6 +208,8 @@ class Single extends Component {
...
@@ -224,6 +208,8 @@ class Single extends Component {
},
1000
)
},
1000
)
}
}
}
// 特价购买全集
// 特价购买全集
toBuyAll
=
()
=>
{
toBuyAll
=
()
=>
{
...
...
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