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
98f84208
Commit
98f84208
authored
Mar 06, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
限时免费
parent
4ec71ac5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
14 deletions
+80
-14
src/components/limit-free/index.js
+31
-7
src/components/limit-free/index.scss
+49
-7
No files found.
src/components/limit-free/index.js
View file @
98f84208
...
@@ -8,9 +8,10 @@ import VList from '@/common/v-list-base'
...
@@ -8,9 +8,10 @@ import VList from '@/common/v-list-base'
class
LimitFree
extends
Component
{
class
LimitFree
extends
Component
{
nav
state
=
{
state
=
{
tabs
:
new
Array
(
5
).
fill
(
'a'
).
map
((
item
,
i
)
=>
({
tabs
:
new
Array
(
10
).
fill
(
'a'
).
map
((
item
,
i
)
=>
({
title
:
String
.
fromCharCode
(
97
+
i
)
title
:
`
${
i
+
1
}
th Tab`
})),
})),
courses
:
[
courses
:
[
{
{
...
@@ -37,29 +38,51 @@ class LimitFree extends Component {
...
@@ -37,29 +38,51 @@ class LimitFree extends Component {
price
:
99
,
price
:
99
,
price1
:
199
,
price1
:
199
,
},
},
]
],
navItemStyle
:
{}
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
initializeNav
()
}
}
handleClick
=
id
=>
{
handleClick
=
id
=>
{
}
}
initializeNav
=
()
=>
{
const
{
tabs
}
=
this
.
state
const
navItemNum
=
5
const
navItemLen
=
tabs
.
length
console
.
log
(
getComputedStyle
(
this
.
nav
).
paddingLeft
)
if
(
navItemLen
<=
navItemNum
){
return
}
}
render
()
{
render
()
{
const
{
tabs
,
courses
}
=
this
.
state
const
{
tabs
,
courses
,
navItemStyle
}
=
this
.
state
return
(
return
(
<
div
className
=
'limit-free'
>
<
div
className
=
'limit-free'
>
<
HeaderBar
arrow
=
{
true
}
title
=
{
'限时免费'
}
><
/HeaderBar
>
<
HeaderBar
arrow
=
{
true
}
title
=
{
'限时免费'
}
><
/HeaderBar
>
<
div
className
=
"banner"
>
<
div
className
=
"banner"
>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/time_limited_free/M/banner.png"
alt
=
""
/>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/time_limited_free/M/banner.png"
alt
=
""
/>
<
/div
>
<
/div
>
<
nav
>
<
nav
ref
=
{
el
=>
this
.
nav
=
el
}
>
<
div
className
=
"prev-cover"
><
/div
>
<
ul
>
<
ul
>
<
li
><
/li
>
{
tabs
&&
!!
tabs
.
length
&&
tabs
.
map
((
item
,
index
)
=>
{
return
(
<
li
key
=
{
index
}
className
=
{
index
===
0
?
'active'
:
''
}
style
=
{
navItemStyle
}
>
{
item
.
title
}
<
/li
>
)
})
}
<
/ul
>
<
/ul
>
<
div
className
=
"next-cover"
><
/div
>
<
/nav
>
<
/nav
>
<
WhiteSpace
/>
<
WhiteSpace
/>
<
div
className
=
"course-list"
>
<
div
className
=
"course-list"
>
...
@@ -107,6 +130,7 @@ class LimitFree extends Component {
...
@@ -107,6 +130,7 @@ class LimitFree extends Component {
<
VList
img
=
{
item
.
img
}
<
VList
img
=
{
item
.
img
}
handleClick
=
{
this
.
handleClick
}
handleClick
=
{
this
.
handleClick
}
info
=
{
info
}
info
=
{
info
}
key
=
{
index
}
/
>
/
>
)
)
})
})
...
...
src/components/limit-free/index.scss
View file @
98f84208
...
@@ -2,11 +2,59 @@
...
@@ -2,11 +2,59 @@
background
:
#F9F9FB
;
background
:
#F9F9FB
;
.banner
{
.banner
{
font-size
:
0
;
img
{
img
{
width
:
100%
;
width
:
100%
;
}
}
}
}
nav
{
position
:
relative
;
display
:
flex
;
align-items
:
center
;
height
:
39px
;
padding
:
0
18px
;
background
:
#fff
;
.prev-cover
,
.next-cover
{
position
:
absolute
;
top
:
0
;
width
:
44px
;
height
:
39px
;
}
.prev-cover
{
left
:
0
;
background
:
linear-gradient
(
90deg
,
rgba
(
255
,
255
,
255
,
1
)
,
rgba
(
255
,
255
,
255
,
0
));
}
.next-cover
{
right
:
0
;
background
:
linear-gradient
(
90deg
,
rgba
(
255
,
255
,
255
,
0
)
,
rgba
(
255
,
255
,
255
,
1
));
}
ul
{
width
:
100%
;
height
:
100%
;
display
:
flex
;
align-items
:
center
;
}
li
{
margin-right
:
23px
;
text-align
:
center
;
height
:
100%
;
line-height
:
39px
;
&
.active
{
color
:
#09f
;
border-bottom
:
1px
solid
#09f
;
}
}
}
.course-list
{
.course-list
{
border-top
:
1px
solid
transparent
;
border-top
:
1px
solid
transparent
;
padding
:
0
12px
;
padding
:
0
12px
;
...
@@ -14,7 +62,7 @@
...
@@ -14,7 +62,7 @@
}
}
.courses
li
:nth-last-child
(
1
)
{
.courses
li
:nth-last-child
(
1
)
{
margin-bottom
:
0
;
margin-bottom
:
0
;
}
}
...
@@ -46,8 +94,6 @@
...
@@ -46,8 +94,6 @@
}
}
.info
{
.info
{
//position: relative;
//width: 100%;
display
:
flex
;
display
:
flex
;
flex-wrap
:
wrap
;
flex-wrap
:
wrap
;
align-items
:
flex-start
;
align-items
:
flex-start
;
...
@@ -79,10 +125,6 @@
...
@@ -79,10 +125,6 @@
}
}
.bottom
{
.bottom
{
//position: absolute;
//left: 0;
//bottom: 0;
//width: 100%;
align-self
:
flex-end
;
align-self
:
flex-end
;
}
}
}
}
...
...
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