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
0fcc93d2
Commit
0fcc93d2
authored
Aug 22, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.julyedu.com:baiguangyao/mr-julyedu
parents
34642a5e
1b615bcc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
130 additions
and
97 deletions
+130
-97
src/components/detail/audition/index.scss
+1
-1
src/components/detail/index.js
+77
-6
src/components/detail/single/index.js
+26
-86
src/components/detail/single/index.scss
+1
-1
src/components/detail/single/singleSuccess.js
+0
-0
src/components/order/payOrder/PayOrder.js
+4
-0
src/components/search/searchHead.js
+18
-3
src/components/search/search_header.scss
+3
-0
No files found.
src/components/detail/audition/index.scss
View file @
0fcc93d2
...
...
@@ -6,7 +6,7 @@
right
:
0
;
bottom
:
0
;
background-color
:
rgba
(
0
,
0
,
0
,
.6
);
z-index
:
2
;
z-index
:
15
;
.content
{
width
:
300px
;
...
...
src/components/detail/index.js
View file @
0fcc93d2
...
...
@@ -7,6 +7,7 @@ import {HeaderBar, CallApp} from '../../common'
import
ShareRank
from
"./shareRank"
import
Audition
from
"./audition"
import
Single
from
"./single"
import
SingleSuccess
from
'./single/singleSuccess'
;
import
BtnStatus
from
"./btnstatus"
import
Carouselw
from
"./carousel"
import
{
connect
}
from
"react-redux"
...
...
@@ -25,7 +26,10 @@ class Detail extends Component {
isbuy
:
0
,
isvip
:
0
,
auditionBox
:
false
,
singleBox
:
false
,
singleType
:
1
,
shareRank
:
false
,
singMess
:
''
,
barInfo
:
''
,
...
...
@@ -39,6 +43,45 @@ class Detail extends Component {
componentDidMount
()
{
this
.
fetchCourseInfo
();
const
{
location
:
{
state
=
{}
}
}
=
this
.
props
;
if
(
state
.
oid
)
{
this
.
check
(
state
.
oid
);
}
}
// 判断支付是否成功
check
=
(
oid
)
=>
{
http
.
get
(
`
${
API
[
'base-api'
]}
/class_order_status/
${
oid
}
`
).
then
((
res
)
=>
{
if
(
Number
(
res
.
data
.
data
.
errno
)
===
200
)
{
// 正常购买单集成功
this
.
setState
({
singleType
:
6
,
})
}
else
if
(
Number
(
res
.
data
.
data
.
errno
)
===
201
)
{
// 0元参团
this
.
setState
({
singleType
:
4
,
})
}
else
if
(
Number
(
res
.
data
.
data
.
errno
)
===
202
)
{
// 0元购
this
.
setState
({
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
,
})
}
else
{
Toast
.
info
(
res
.
data
.
data
.
msg
,
2
)
}
})
}
fetchCourseInfo
=
()
=>
{
...
...
@@ -88,6 +131,7 @@ class Detail extends Component {
}
// 点击子组件单集购买按钮
toSingleset
=
(
item
)
=>
{
console
.
log
(
this
.
props
);
const
{
user
}
=
this
.
props
const
uid
=
user
&&
user
.
data
&&
user
.
data
.
uid
if
(
!
uid
)
{
...
...
@@ -95,8 +139,9 @@ class Detail extends Component {
}
else
{
this
.
setState
({
singleBox
:
true
,
singleType
:
1
,
singMess
:
item
})
})
;
}
}
...
...
@@ -207,11 +252,17 @@ class Detail extends Component {
// 自组件传给父组件的boxHide
boxHide
=
(
val
)
=>
{
this
.
setState
({
auditionBox
:
val
,
singleBox
:
val
})
this
.
setState
({
auditionBox
:
val
,
singleBox
:
val
,
singleType
:
1
})
this
.
props
.
history
.
push
(
`/detail?id=
${
getParam
(
'id'
)}
`
);
}
render
()
{
const
{
course
:
{
course_info
=
{}
},
barInfo
}
=
this
.
state
;
const
{
course
:
{
course_info
=
{}
},
barInfo
,
singleBox
,
singleType
}
=
this
.
state
;
console
.
log
(
course_info
);
let
courseInfo
=
''
,
service
=
''
,
...
...
@@ -225,8 +276,14 @@ class Detail extends Component {
}
// }
const
{
share
,
countdown
,
list
,
outList
}
=
this
.
state
;
const
href
=
this
.
props
.
location
&&
this
.
props
.
location
.
state
?
this
.
props
.
location
.
state
.
href
:
undefined
;
let
href
=
this
.
props
.
location
&&
this
.
props
.
location
.
state
?
this
.
props
.
location
.
state
.
href
:
undefined
;
const
{
location
:
{
state
=
{}}
}
=
this
.
props
;
if
(
state
.
oid
)
{
href
=
'/classify'
}
return
(
<
div
>
<
div
className
=
'detail-box'
>
<
HeaderBar
title
=
'课程详情'
...
...
@@ -302,15 +359,28 @@ class Detail extends Component {
<
Audition
auditionBox
=
{
this
.
state
.
auditionBox
}
boxHide
=
{
this
.
boxHide
}
/
>
{
/*单集购买弹窗*/
}
{
singleBox
&&
<
Single
singleType
=
{
this
.
state
.
singleType
}
singleBox
=
{
this
.
state
.
singleBox
}
boxHide
=
{
this
.
boxHide
}
data
=
{
this
.
state
.
singMess
}
vcourseId
=
{
course_info
.
v_course_id
}
videoId
=
{
this
.
state
.
singMess
.
video_id
}
title
=
{
course_info
.
course_title
}
/
>
check
=
{
this
.
check
}
/>
}
{
/* 单集购买成功弹窗 */
}
{
singleType
!=
1
&&
<
SingleSuccess
boxHide
=
{
this
.
boxHide
}
data
=
{
this
.
state
.
singMess
}
singleType
=
{
singleType
}
videoId
=
{
this
.
state
.
singMess
.
video_id
}
/
>
}
{
/*分享赚钱*/
}
{
course_info
.
is_dist
&&
...
...
@@ -376,6 +446,7 @@ class Detail extends Component {
)
:
null
}
<
/div
>
<
/div
>
)
}
...
...
src/components/detail/single/index.js
View file @
0fcc93d2
...
...
@@ -12,7 +12,7 @@ class Single extends Component {
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
status
:
1
,
//
status: 1,
orderId
:
''
,
nowPrice
:
''
,
laterPrice
:
''
,
...
...
@@ -22,17 +22,26 @@ class Single extends Component {
endTime
:
''
,
groupOrderId
:
''
,
payType
:
'0'
,
// 1支付宝 0微信
// singleBox: false,
showSingleBox
:
false
,
}
}
componentDidMount
()
{
if
(
getParam
(
'is_class'
)
===
1
||
getParam
(
'weixinpay'
))
{
this
.
payCallback
()
}
if
(
browser
.
isWeixin
)
{
this
.
isweixinPay
()
}
// if (getParam('is_class') === 1 || getParam('weixinpay')) {
// console.log(0);
// this.payCallback()
// }
// if (browser.isWeixin) {
// this.isweixinPay()
// }
}
componentWillReceiveProps
(
nextProps
,
nextContext
)
{
// console.log(nextProps);
// this.setState({
// singleBox: nextProps.singleBox
// })
}
// 选择支付方式
...
...
@@ -73,9 +82,11 @@ class Single extends Component {
}
// 支付宝支付
alipayPay
=
(
orderId
)
=>
{
const
courseId
=
getParam
(
'id'
);
http
.
get
(
`
${
API
[
'base-api'
]}
/pay/alipay/wap_charge_new/oid/
${
orderId
}
`
).
then
((
res
)
=>
{
if
(
res
.
data
.
errno
===
0
)
{
window
.
location
=
res
.
data
.
data
.
url
;
courseId
&&
window
.
localStorage
.
setItem
(
'payCourse'
,
courseId
);
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
)
}
...
...
@@ -306,14 +317,15 @@ class Single extends Component {
})
},
1000
)
}
const
{
singleType
}
=
this
.
props
;
console
.
log
(
this
.
state
.
singleBox
);
return
(
<
div
>
{
this
.
props
.
singleBox
&&
<
div
className
=
'popup-box'
>
{
this
.
state
.
status
===
1
&&
singleType
===
1
&&
<
div
className
=
'content singleset-payment'
>
<
div
className
=
'price-box'
>
<
span
>
实付款:
<
/span
>
...
...
@@ -347,83 +359,11 @@ class Single extends Component {
<
div
className
=
'btn btn-18B4ED'
onClick
=
{
this
.
toBuy
}
>
确认购买
<
/div
>
<
/div
>
}
<
/div
>
}
{
showSingleBox
&&
<
div
className
=
'popup-box'
>
{
this
.
state
.
status
===
2
&&
<
div
className
=
'content payment-success'
>
<
div
className
=
"header"
>
<
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
>
<
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
>
<
/div
>
}
{
this
.
state
.
status
===
3
&&
<
div
className
=
'content zero'
>
<
div
className
=
"header"
>
<
i
className
=
'iconfont icondanseshixintubiao-5'
><
/i
>
<
span
>
购买成功
<
/span
>
<
/div
>
<
div
className
=
"dec"
>
·
恭喜您获得
0
元拼团购买剩余课时的机会。
<
/div
>
<
div
className
=
'btn btn-FF4000'
onClick
=
{
this
.
zerogroupBuy
}
>
0
元参团
<
/div
>
<
/div
>
}
{
this
.
state
.
status
===
4
&&
<
div
className
=
'content zero'
>
<
div
className
=
"header"
>
<
i
className
=
'iconfont icondanseshixintubiao-5'
><
/i
>
<
span
>
购买成功
<
/span
>
<
/div
>
<
div
className
=
"dec"
>
·
恭喜您获得
0
元购买剩余课时的机会。
<
/div
>
<
div
className
=
'btn btn-FF4000'
onClick
=
{
this
.
zerobuyReceive
}
>
0
元购
<
/div
>
<
/div
>
}
{
this
.
state
.
status
===
6
&&
<
div
className
=
'content zero'
>
<
div
className
=
"header"
>
<
i
className
=
'iconfont icondanseshixintubiao-5'
><
/i
>
<
span
>
购买成功
<
/span
>
<
/div
>
<
Link
to
=
{
`/play/video?id=
${
this
.
props
.
vcourseId
}
&video_id=
${
this
.
props
.
data
.
video_id
}
`
}
className
=
'btn btn-18B4ED'
>
去学习
<
/Link
>
<
/div
>
}
{
this
.
state
.
status
===
7
&&
<
div
className
=
'content group'
>
<
div
className
=
"header"
>
<
i
className
=
'iconfont icondanseshixintubiao-5'
><
/i
>
<
span
>
参团成功
<
/span
>
<
/div
>
<
div
className
=
'group-img'
>
<
img
src
=
{
this
.
props
.
user
.
data
.
avatar
}
alt
=
""
/>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/images/weekend/train7/ellipsis.png"
alt
=
""
/>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/images/weekend/train7/ellipsis.png"
alt
=
""
/>
<
/div
>
<
div
className
=
'btn-l btn-FF4000'
onClick
=
{
this
.
toGroup
}
>
剩余
{
String
(
this
.
state
.
hour
).
padStart
(
2
,
0
)}
:
{
String
(
this
.
state
.
min
).
padStart
(
2
,
0
)}
:
{
String
(
this
.
state
.
sec
).
padStart
(
2
,
0
)}
邀请好友参团
<
/div
>
<
/div
>
}
<
i
onClick
=
{
this
.
colse
}
className
=
{
'iconfont iconiconfront-2 close'
}
><
/i
>
<
/div
>
}
<
/div
>
);
...
...
src/components/detail/single/index.scss
View file @
0fcc93d2
...
...
@@ -5,7 +5,7 @@
right
:
0
;
bottom
:
0
;
background-color
:
rgba
(
0
,
0
,
0
,
.6
);
z-index
:
2
;
z-index
:
5
;
.content
{
width
:
300px
;
...
...
src/components/detail/single/singleSuccess.js
0 → 100644
View file @
0fcc93d2
This diff is collapsed.
Click to expand it.
src/components/order/payOrder/PayOrder.js
View file @
0fcc93d2
...
...
@@ -58,6 +58,10 @@ export default class PayOrder extends Component {
// type订单类型 0普通订单 1团购 2小团 3砍价 4单集购买 5定金课定金 6定金课尾款
if
(
parseInt
(
type
,
10
)
===
2
)
{
history
.
push
(
`/togroup?id=
${
oid
}
`
);
}
else
if
(
parseInt
(
type
,
10
)
===
4
)
{
courseId
&&
window
.
localStorage
.
setItem
(
'payCourse'
,
courseId
);
const
courseId
=
window
.
localStorage
.
getItem
(
'payCourse'
)
courseId
&&
history
.
push
(
`/detail?id=
${
courseId
}
`
,{
oid
});
}
else
{
history
.
push
(
'/purchased'
);
}
...
...
src/components/search/searchHead.js
View file @
0fcc93d2
import
React
,
{
PureComponent
}
from
'react'
import
{
SearchBar
}
from
'antd-mobile'
import
{
withRouter
}
from
'react-router-dom'
import
classnames
from
'classnames'
;
import
'./search_header.scss'
class
SearchHead
extends
PureComponent
{
state
=
{
isFocus
:
false
}
returnPage
=
()
=>
{
this
.
props
.
history
.
go
(
-
1
)
...
...
@@ -24,8 +29,16 @@ class SearchHead extends PureComponent {
value
&&
localStorage
.
setItem
(
'searchHistory'
,
JSON
.
stringify
([...
searchHistory
,
value
]))
}
changeFontColor
=
(
isFocus
)
=>
{
this
.
setState
({
isFocus
});
}
render
()
{
const
{
isFocus
}
=
this
.
state
;
const
cls
=
classnames
(
'submit-btn'
,
{
'submit-btn--active'
:
isFocus
})
console
.
log
(
isFocus
);
return
(
<
div
className
=
"search-head"
>
...
...
@@ -41,11 +54,13 @@ class SearchHead extends PureComponent {
ref
=
"search"
focus
=
{
true
}
onChange
=
{
this
.
props
.
handleChange
}
placeholder
=
"搜索课程"
/>
placeholder
=
"搜索课程"
onFocus
=
{()
=>
this
.
changeFontColor
(
true
)}
onBlur
=
{()
=>
this
.
changeFontColor
(
false
)}
/
>
<
/div
>
<
div
className
=
"right right-btn"
onClick
=
{
this
.
search
}
>
<
div
className
=
"submit-btn"
>
搜索
<
/div
>
<
div
className
=
{
cls
}
>
搜索
<
/div
>
<
/div
>
<
/div
>
)
...
...
src/components/search/search_header.scss
View file @
0fcc93d2
...
...
@@ -66,6 +66,9 @@
font-size
:
$font_14
;
color
:
$color_333
;
}
.submit-btn--active
{
color
:
$active
;
}
}
}
...
...
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