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
7fc8b8b1
Commit
7fc8b8b1
authored
Aug 23, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.julyedu.com:baiguangyao/mr-julyedu
parents
b02c4e5a
3a55b0b0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
164 deletions
+11
-164
src/components/detail/index.js
+7
-4
src/components/detail/single/singleSuccess.js
+4
-159
src/components/passport/login/index.js
+0
-1
No files found.
src/components/detail/index.js
View file @
7fc8b8b1
...
...
@@ -18,8 +18,6 @@ import {compose, bindActionCreators} from "redux";
class
Detail
extends
Component
{
courseId
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
...
...
@@ -37,7 +35,10 @@ class Detail extends Component {
countdown
:
'00:00:00'
,
outList
:
[],
list
:
[],
course
:
{}
course
:
{},
nowPrice
:
0
,
laterPrice
:
0
,
}
}
...
...
@@ -525,10 +526,12 @@ class Detail extends Component {
{
singleType
!=
1
&&
<
SingleSuccess
boxHide
=
{
this
.
boxHide
}
boxHide
=
{
this
.
boxHide
}
data
=
{
this
.
state
.
singMess
}
singleType
=
{
singleType
}
videoId
=
{
this
.
state
.
singMess
.
video_id
}
nowPrice
=
{
this
.
state
.
nowPrice
}
laterPrice
=
{
this
.
state
.
laterPrice
}
payCallBack
=
{
this
.
payCallBack
}
/
>
}
...
...
src/components/detail/single/singleSuccess.js
View file @
7fc8b8b1
...
...
@@ -27,14 +27,7 @@ class Single extends Component {
}
componentDidMount
()
{
// if (getParam('is_class') === 1 || getParam('weixinpay')) {
// console.log(0);
// this.payCallback()
// // this.props.payCallback();
// }
// if (browser.isWeixin) {
// this.isweixinPay()
// }
}
componentWillReceiveProps
(
nextProps
,
nextContext
)
{
...
...
@@ -93,154 +86,6 @@ class Single extends Component {
})
}
// 微信内部支付
isweixinPay
=
()
=>
{
let
_this
=
this
;
let
weixin_code
=
getParam
(
'code'
)
if
(
weixin_code
)
{
if
(
!
getParam
(
'oid'
))
{
return
}
else
{
// this.props.weixinPay(weixin_code)
http
.
get
(
`
${
API
[
'base-api'
]}
/pay/wxpay/pub_charge/oid/
${
getParam
(
'oid'
)}
/code/
${
weixin_code
}
`
).
then
((
res
)
=>
{
if
(
res
.
data
.
errno
===
0
)
{
const
data
=
res
.
data
.
data
;
function
onBridgeReady
()
{
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"
)
{
Toast
.
info
(
'支付成功'
,
2
);
_this
.
intervalPayStatus
=
setInterval
(
function
()
{
http
.
get
(
`
${
API
[
'base-api'
]}
/m/orderState/oid/
${
getParam
(
'oid'
)}
`
).
then
(
res
=>
{
if
(
res
.
data
.
errno
===
401
)
{
clearInterval
(
_this
.
intervalPayStatus
);
_this
.
intervalPayStatus
=
null
;
// 获取课程类型
http
.
get
(
`
${
API
[
'base-api'
]}
/class_order_status/
${
getParam
(
'oid'
)}
`
).
then
((
res
)
=>
{
let
singleType
,
nowPrice
,
laterPrice
;
if
(
Number
(
res
.
data
.
data
.
errno
)
===
200
)
{
// 正常购买单集成功
// _this.setState({
// singleType: 6
// })
singleType
=
6
;
}
else
if
(
Number
(
res
.
data
.
data
.
errno
)
===
201
)
{
// 0元参团
// _this.setState({
// singleType: 4,
// })
singleType
=
4
;
}
else
if
(
Number
(
res
.
data
.
data
.
errno
)
===
202
)
{
// 0元购
// _this.setState({
// singleType: 3,
// })
singleType
=
3
;
}
else
if
(
Number
(
res
.
data
.
data
.
errno
)
===
203
)
{
// 三天内特价
// _this.setState({
// nowPrice: res.data.data.data.now_price,
// laterPrice: res.data.data.data.three_day_later_price,
// singleType: 2,
// })
singleType
=
2
;
nowPrice
=
res
.
data
.
data
.
data
.
now_price
;
laterPrice
=
res
.
data
.
data
.
data
.
three_day_later_price
;
}
else
{
Toast
.
info
(
res
.
data
.
data
.
msg
,
2
)
return
;
}
_this
.
props
.
payCallBack
(
singleType
,
nowPrice
,
laterPrice
);
})
}
})
},
1000
)
}
else
{
alert
(
'支付失败'
)
}
}
)
}
if
(
typeof
WeixinJSBridge
==
"undefined"
)
{
if
(
document
.
addEventListener
)
{
document
.
addEventListener
(
'WeixinJSBridgeReady'
,
onBridgeReady
,
false
)
}
else
if
(
document
.
attachEvent
)
{
document
.
attachEvent
(
'WeixinJSBridgeReady'
,
onBridgeReady
)
document
.
attachEvent
(
'onWeixinJSBridgeReady'
,
onBridgeReady
)
}
}
else
{
onBridgeReady
()
}
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
)
}
})
}
}
}
// 支付完成之后获取状态
payCallback
=
()
=>
{
const
_this
=
this
;
if
(
getParam
(
'oid'
))
{
_this
.
intervalPayStatus
=
setInterval
(
function
()
{
http
.
get
(
`
${
API
[
'base-api'
]}
/m/orderState/oid/
${
getParam
(
'oid'
)}
`
).
then
(
res
=>
{
if
(
res
.
data
.
errno
===
401
)
{
clearInterval
(
_this
.
intervalPayStatus
);
_this
.
intervalPayStatus
=
null
;
// 获取课程类型
http
.
get
(
`
${
API
[
'base-api'
]}
/class_order_status/
${
getParam
(
'oid'
)}
`
).
then
((
res
)
=>
{
let
singleType
,
nowPrice
,
laterPrice
;
if
(
Number
(
res
.
data
.
data
.
errno
)
===
200
)
{
// 正常购买单集成功
// _this.setState({
// singleType: 6
// })
singleType
=
6
;
}
else
if
(
Number
(
res
.
data
.
data
.
errno
)
===
201
)
{
// 0元参团
// _this.setState({
// singleType: 4,
// })
singleType
=
4
;
}
else
if
(
Number
(
res
.
data
.
data
.
errno
)
===
202
)
{
// 0元购
// _this.setState({
// singleType: 3,
// })
singleType
=
3
;
}
else
if
(
Number
(
res
.
data
.
data
.
errno
)
===
203
)
{
// 三天内特价
// _this.setState({
// nowPrice: res.data.data.data.now_price,
// laterPrice: res.data.data.data.three_day_later_price,
// singleType: 2,
// })
singleType
=
2
;
nowPrice
=
res
.
data
.
data
.
data
.
now_price
;
laterPrice
=
res
.
data
.
data
.
data
.
three_day_later_price
;
}
else
{
Toast
.
info
(
res
.
data
.
data
.
msg
,
2
)
return
;
}
_this
.
props
.
payCallBack
(
singleType
,
nowPrice
,
laterPrice
);
})
}
})
},
1000
)
}
}
// 特价购买全集
toBuyAll
=
()
=>
{
...
...
@@ -337,10 +182,10 @@ class Single extends Component {
<
i
className
=
'iconfont icondanseshixintubiao-5'
><
/i
>
<
span
>
购买成功
<
/span
>
<
/div
>
<
div
className
=
"dec"
>
·
3
天内购买全集,可直接抵扣该集费用,
{
this
.
state
.
nowPrice
}
元购买。
<
/div
>
<
div
className
=
"dec"
>
·
超过
3
天,按照未
够集数
/
全部集数等比例计费,
{
this
.
state
.
laterPrice
}
元购买全集。
<
/div
>
<
div
className
=
"dec"
>
·
3
天内购买全集,可直接抵扣该集费用,
{
this
.
props
.
nowPrice
}
元购买。
<
/div
>
<
div
className
=
"dec"
>
·
超过
3
天,按照未
购集数
/
全部集数等比例计费,
{
this
.
props
.
laterPrice
}
元购买全集。
<
/div
>
<
Link
to
=
{
`/play/video?id=
${
this
.
props
.
vcourseId
}
&video_id=
${
this
.
props
.
data
.
video_id
}
`
}
className
=
'btn btn-18B4ED'
>
开始学习
<
/Link
>
<
div
className
=
'btn btn-FF4000'
onclick
=
{
this
.
toBuyAll
()}
>
¥
{
this
.
state
.
nowPrice
}
购买全集
<
div
className
=
'btn btn-FF4000'
onclick
=
{
this
.
toBuyAll
()}
>
¥
{
this
.
props
.
nowPrice
}
购买全集
<
/div
>
<
/div
>
}
...
...
src/components/passport/login/index.js
View file @
7fc8b8b1
...
...
@@ -40,7 +40,6 @@ class Login extends Component {
window
.
location
.
assign
(
`
${
API
[
"passport-api"
]}
/mob/qqlogin?redirect_url=
${
encodeURIComponent
(
redirectURI
)}
`
);
break
;
default
:
alert
(
item
.
url
);
window
.
location
.
assign
(
item
.
url
)
}
...
...
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