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
2fb04c06
Commit
2fb04c06
authored
Mar 16, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
限时免费
parent
29103307
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
65 deletions
+81
-65
src/components/Index/index.js
+57
-21
src/components/Index/index.scss
+9
-9
src/components/detail/btnstatus/index.js
+0
-0
src/components/detail/index.js
+2
-25
src/components/limit-free/index.js
+8
-9
src/components/limit-free/index.scss
+5
-1
No files found.
src/components/Index/index.js
View file @
2fb04c06
...
@@ -13,6 +13,7 @@ import { connect } from "react-redux";
...
@@ -13,6 +13,7 @@ import { connect } from "react-redux";
import
TopSwiper
from
'./TopSwiper'
import
TopSwiper
from
'./TopSwiper'
import
ExpandActiveToast
from
'./expandActiveToast'
import
ExpandActiveToast
from
'./expandActiveToast'
import
CourseBase
from
'@/common/course-base'
import
CourseBase
from
'@/common/course-base'
import
{
switchTab
}
from
"@components/study/myCourses/actions"
// const animateTypes = Swiper.animateTypes
// const animateTypes = Swiper.animateTypes
...
@@ -283,35 +284,31 @@ function CourseList({modules, toDetail}) {
...
@@ -283,35 +284,31 @@ function CourseList({modules, toDetail}) {
<
/div
>
<
/div
>
)
)
const
bottom
=
(
/*
const bottom = (
<div>
<div>
{
item
.
is_buy
{
?
<
a
className
=
"isbuy"
>
已购买
<
/a
>
item.is_limit_free
:
item
.
is_limit_free
? <LimitFree course={item}/>
?
<
Link
to
=
{
`/detail?id=
${
item
.
course_id
}
`
}
>
: item.is_buy
<
p
className
=
{
'course-price'
}
>
? <a className="isbuy">已购买</a>
<
span
className
=
{
'free'
}
>
免费领取
<
/span
>
<
span
className
=
{
'old'
}
>
¥
{
item
.
price
}
<
/span
>
<
/p
>
<
/Link
>
: <p className="course-price">
: <p className="course-price">
<span className="new">¥{item.discounts_price}</span>
<span className="new">¥{item.discounts_price}</span>
<span className="old">¥{item.price}</span>
<span className="old">¥{item.price}</span>
</p>
</p>
}
}
</div>
</div>
)
)
*/
const
status
=
item
.
is_limit_free
?
null
:
(
const
bottom
=
<
Bottom
course
=
{
item
}
/
>
<
div
>
{
item
.
is_bargain
&&
const
status
=
item
.
is_limit_free
?
null
:
<
div
>
<
p
className
=
'course-status'
>
砍价减
{
item
.
bargain_price
}
元
<
/p
>
{
item
.
is_bargain
&&
}
<
p
className
=
'course-status'
>
砍价减
{
item
.
bargain_price
}
元
<
/p
>
{
item
.
is_groupon
&&
}
<
p
className
=
'course-status'
>
拼团价
{
item
.
groupon_price
}
元
<
/p
>
{
item
.
is_groupon
&&
}
<
p
className
=
'course-status'
>
拼团价
{
item
.
groupon_price
}
元
<
/p
>
<
/div
>
}
)
<
/div
>
return
(
return
(
<
Course
<
Course
key
=
{
index
}
key
=
{
index
}
...
@@ -334,6 +331,45 @@ function CourseList({modules, toDetail}) {
...
@@ -334,6 +331,45 @@ function CourseList({modules, toDetail}) {
)
)
}
}
//限时免费
function
LimitFree
({
course
})
{
/*
*
* limit_free_status: 0-未领取 1-已领取 2-已过期
*
* */
switch
(
course
.
limit_free_status
)
{
case
0
:
return
<
Link
to
=
{
`/detail?id=
${
course
.
course_id
}
`
}
>
<
p
className
=
{
'course-price'
}
>
<
span
className
=
{
'free'
}
>
免费领取
<
/span
>
<
span
className
=
{
'old'
}
>
¥
{
course
.
price
}
<
/span
>
<
/p
>
<
/Link
>
case
1
:
return
<
div
className
=
{
'isbuy'
}
>
已领取
<
/div
>
default
:
return
<
p
className
=
"course-price"
>
<
span
className
=
"new"
>
¥
{
course
.
discounts_price
}
<
/span
>
<
span
className
=
"old"
>
¥
{
course
.
price
}
<
/span
>
<
/p
>
}
}
//课程底部
function
Bottom
({
course
}){
if
(
course
.
is_buy
){
if
(
course
.
is_limit_free
&&
course
.
limit_free_status
===
1
){
return
<
div
class
=
{
'isbuy'
}
>
已领取
<
/div
>
}
else
{
return
<
div
className
=
{
'isbuy'
}
>
已购买
<
/div
>
}
}
else
{
return
<
LimitFree
course
=
{
course
}
/
>
}
}
//近期直播
//近期直播
function
ScrollBox
(
props
)
{
function
ScrollBox
(
props
)
{
return
(
return
(
...
...
src/components/Index/index.scss
View file @
2fb04c06
...
@@ -364,17 +364,15 @@
...
@@ -364,17 +364,15 @@
.isbuy
{
.isbuy
{
display
:
inline-block
;
display
:
inline-block
;
margin-top
:
15px
;
margin-top
:
15px
;
width
:
61px
;
color
:
$active
;
height
:
18px
;
font-size
:
15px
;
background-color
:
$bg_active
;
border-radius
:
9px
;
color
:
$white
;
font-size
:
12px
;
text-align
:
center
;
text-align
:
center
;
line-height
:
18px
;
line-height
:
18px
;
font-family
:
PingFang
SC
;
font-weight
:
400
;
}
}
.free
{
.free
{
color
:
$red
;
color
:
$red
;
font-size
:
15px
;
font-size
:
15px
;
}
}
...
@@ -809,10 +807,12 @@
...
@@ -809,10 +807,12 @@
.bottom
{
.bottom
{
margin-top
:
5px
;
margin-top
:
5px
;
span
{
span
{
margin-right
:
5px
;
margin-right
:
5px
;
}
}
span
:nth-child
(
3
)
{
span
:nth-child
(
3
)
{
margin-right
:
0
;
margin-right
:
0
;
}
}
}
}
...
...
src/components/detail/btnstatus/index.js
View file @
2fb04c06
This diff is collapsed.
Click to expand it.
src/components/detail/index.js
View file @
2fb04c06
...
@@ -413,29 +413,6 @@ class Detail extends Component {
...
@@ -413,29 +413,6 @@ class Detail extends Component {
}
}
}
}
// componentWillReceiveProps(nextProps) {
// let _this = this;
// if (nextProps.courseInfo.course_info) {
// let courseInfo = nextProps.courseInfo.course_info;
// if (courseInfo.group_status === 3 || courseInfo.group_status === 4) {
// let endTime = courseInfo.pdd_group_info.groupon_member.end_time;
// let date = endTime * 1000,
// hours = 0,
// minutes = 0,
// seconds = 0;
// setInterval(() => {
// date -= 1000
// hours = `${parseInt(date / (60 * 60 * 1000))}`.padStart(2, 0);
// minutes = `${parseInt((date - hours * 3600000) / 60000)}`.padStart(2, 0);
// seconds = `${parseInt((date - hours * 3600000 - minutes * 60000) / 1000)}`.padStart(2, 0);
// _this.setState({
// countdown: `${hours}:${minutes}:${seconds}`
// });
// }, 1000)
// }
// }
// }
// 加入购物车 type:1 加入购物车,2加入购物车并跳转到购物车页面去支付
// 加入购物车 type:1 加入购物车,2加入购物车并跳转到购物车页面去支付
toCart
=
(
type
)
=>
{
toCart
=
(
type
)
=>
{
const
{
history
,
addCourseToCart
}
=
this
.
props
;
const
{
history
,
addCourseToCart
}
=
this
.
props
;
...
@@ -619,7 +596,7 @@ class Detail extends Component {
...
@@ -619,7 +596,7 @@ class Detail extends Component {
<
/div
>
<
/div
>
}
}
{
{
course_info
.
is_limit_free
course_info
.
is_
baoming
===
0
&&
course_info
.
is_
limit_free
?
?
course_info
.
limit_free_status
==
0
course_info
.
limit_free_status
==
0
?
<
div
className
=
"limit-free"
>
?
<
div
className
=
"limit-free"
>
...
@@ -659,7 +636,7 @@ class Detail extends Component {
...
@@ -659,7 +636,7 @@ class Detail extends Component {
{
{
!
(
course_info
.
is_limit_free
&&
course_info
.
limit_free_status
==
1
)
&&
course_info
.
is_baoming
===
1
&&
course_info
.
is_pay
==
1
&&
course_info
.
contact_type
==
2
&&
course_info
.
course_qq
&&
!
(
course_info
.
is_limit_free
&&
course_info
.
limit_free_status
==
1
)
&&
course_info
.
is_baoming
===
1
&&
course_info
.
is_pay
==
1
&&
course_info
.
contact_type
==
2
&&
course_info
.
course_qq
&&
<
div
className
=
'group'
>
<
div
className
=
'group'
>
请添加班主任微信:
{
course_info
.
course_qq
}
,添加时备注学号:
{
course_info
.
uid
}
请添加班主任微信:
{
course_info
.
course_qq
}
,添加时备注学号:
{
course_info
.
uid
}
<
/div
>
<
/div
>
}
}
...
...
src/components/limit-free/index.js
View file @
2fb04c06
...
@@ -130,11 +130,11 @@ class LimitFree extends Component {
...
@@ -130,11 +130,11 @@ class LimitFree extends Component {
<
div
className
=
"prev-cover"
><
/div
>
<
div
className
=
"prev-cover"
><
/div
>
<
ul
ref
=
{
el
=>
this
.
nav
=
el
}
>
<
ul
ref
=
{
el
=>
this
.
nav
=
el
}
>
{
{
tab
&&
!!
Object
.
keys
(
tab
).
length
&&
Object
.
keys
(
tab
)
.
map
((
item
,
index
)
=>
{
tab
&&
!!
tab
.
length
&&
tab
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
li
key
=
{
index
}
className
=
{
index
===
tabActiveIndex
?
'active'
:
''
}
style
=
{
navItemStyle
}
<
li
key
=
{
index
}
className
=
{
index
===
tabActiveIndex
?
'active'
:
''
}
style
=
{
navItemStyle
}
onClick
=
{
e
=>
this
.
changeTab
(
e
,
index
)}
>
onClick
=
{
e
=>
this
.
changeTab
(
e
,
index
)}
>
<
a
href
=
{
`#category
${
item
}
`
}
target
=
{
'_self'
}
>
{
tab
[
item
]
}
<
/a
>
<
a
href
=
{
`#category
${
item
.
id
}
`
}
target
=
{
'_self'
}
>
{
item
.
category_name
}
<
/a
>
<
/li
>
<
/li
>
)
)
})
})
...
@@ -146,18 +146,18 @@ class LimitFree extends Component {
...
@@ -146,18 +146,18 @@ class LimitFree extends Component {
<
div
className
=
"course-list"
>
<
div
className
=
"course-list"
>
<
ul
>
<
ul
>
{
{
tab
&&
!!
Object
.
keys
(
tab
).
length
&&
Object
.
keys
(
tab
).
map
(
ke
y
=>
{
tab
&&
!!
tab
.
length
&&
tab
.
map
(
categor
y
=>
{
return
(
return
(
<
li
key
=
{
key
}
className
=
{
'category'
}
>
<
li
key
=
{
category
.
id
}
className
=
{
'category'
}
>
<
h2
id
=
{
`category
${
key
}
`
}
>
<
h2
id
=
{
`category
${
category
.
id
}
`
}
>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/time_limited_free/M/category-icon.png"
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/time_limited_free/M/category-icon.png"
alt
=
""
/>
alt
=
""
/>
<
span
>
{
tab
[
key
]
}
<
/span
>
<
span
>
{
category
.
category_name
}
<
/span
>
<
/h2
>
<
/h2
>
<
ul
className
=
{
'courses'
}
>
<
ul
className
=
{
'courses'
}
>
{
{
courses
&&
courses
.
length
&&
courses
.
map
((
item
,
index
)
=>
{
courses
&&
courses
.
length
&&
courses
.
map
((
item
,
index
)
=>
{
if
(
item
.
category_id
!=
key
)
{
if
(
item
.
category_id
!=
category
.
id
)
{
return
null
return
null
}
}
/*
/*
...
@@ -188,8 +188,7 @@ class LimitFree extends Component {
...
@@ -188,8 +188,7 @@ class LimitFree extends Component {
<
span
>
{
d
}
天
{
h
}
时
{
m
}
分后过期
<
/span
>
<
span
>
{
d
}
天
{
h
}
时
{
m
}
分后过期
<
/span
>
<
/div
>
<
/div
>
bottom
=
<
div
className
=
{
'bottom'
}
>
bottom
=
<
div
className
=
{
'bottom'
}
>
<
span
className
=
{
'red'
}
>
限时免费
<
/span
>
<
span
>
已领取
<
/span
>
<
span
className
=
{
'origin-price'
}
>
¥
{
item
.
price0
}
<
/span
>
<
StudyButton
id
=
{
item
.
course_id
}
/
>
<
StudyButton
id
=
{
item
.
course_id
}
/
>
<
/div
>
<
/div
>
break
break
...
...
src/components/limit-free/index.scss
View file @
2fb04c06
...
@@ -51,14 +51,18 @@
...
@@ -51,14 +51,18 @@
&
:
:-
webkit-scrollbar
{
&
:
:-
webkit-scrollbar
{
display
:
none
;
display
:
none
;
}
}
&
li
:nth-last-child
(
1
)
{
margin-right
:
0
;
}
}
}
li
{
li
{
width
:
20%
;
text-align
:
center
;
text-align
:
center
;
height
:
100%
;
height
:
100%
;
line-height
:
39px
;
line-height
:
39px
;
flex-shrink
:
0
;
flex-shrink
:
0
;
margin-right
:
23px
;
&
.active
{
&
.active
{
color
:
#09f
;
color
:
#09f
;
...
...
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