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
94c04b63
Commit
94c04b63
authored
Nov 19, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Plain Diff
课程详情也
parents
9f604fde
dffb8342
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
61 deletions
+79
-61
src/components/detail/group/togroup.js
+4
-7
src/components/detail/index.js
+13
-16
src/components/python/index.js
+12
-12
src/components/python/pythonStudy/index.js
+28
-22
src/components/python/pythonStudy/index.scss
+21
-3
src/router/router-config.js
+1
-1
No files found.
src/components/detail/group/togroup.js
View file @
94c04b63
...
...
@@ -65,19 +65,16 @@ class ToGroup extends Component {
if
(
res
.
data
.
data
.
is_success
===
0
)
{
let
date
=
res
.
data
.
data
.
end_time
*
1000
,
day
=
0
,
hours
=
0
,
minutes
=
0
,
seconds
=
0
;
setInterval
(()
=>
{
date
-=
1000
day
=
`
${
parseInt
(
date
/
(
3600000
*
24
))}
`
.
padStart
(
2
,
0
);
hours
=
`
${
parseInt
((
date
-
day
*
3600000
*
24
)
/
3600000
)}
`
.
padStart
(
2
,
0
);
minutes
=
`
${
parseInt
((
date
-
day
*
3600000
*
24
-
hours
*
3600000
)
/
60000
)}
`
.
padStart
(
2
,
0
);
seconds
=
`
${
parseInt
((
date
-
day
*
3600000
*
24
-
hours
*
3600000
-
minutes
*
60000
)
/
1000
)}
`
.
padStart
(
2
,
0
);
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: `${day}:${hours}:${minutes}:${seconds}`
countdown
:
`
${
day
}
天
${
hours
}
时
${
minutes
}
分`
countdown
:
`
${
hours
}
:
${
minutes
}
:
${
seconds
}
`
});
},
1000
)
}
...
...
src/components/detail/index.js
View file @
94c04b63
...
...
@@ -345,19 +345,16 @@ class Detail extends Component {
if
(
course_info
.
group_status
===
3
||
course_info
.
group_status
===
4
)
{
let
endTime
=
course_info
.
pdd_group_info
.
groupon_member
.
end_time
;
let
date
=
endTime
*
1000
,
day
=
0
,
hours
=
0
,
minutes
=
0
,
seconds
=
0
;
setInterval
(()
=>
{
date
-=
1000
day
=
`
${
parseInt
(
date
/
(
3600000
*
24
))}
`
.
padStart
(
2
,
0
);
hours
=
`
${
parseInt
((
date
-
day
*
3600000
*
24
)
/
3600000
)}
`
.
padStart
(
2
,
0
);
minutes
=
`
${
parseInt
((
date
-
day
*
3600000
*
24
-
hours
*
3600000
)
/
60000
)}
`
.
padStart
(
2
,
0
);
seconds
=
`
${
parseInt
((
date
-
day
*
3600000
*
24
-
hours
*
3600000
-
minutes
*
60000
)
/
1000
)}
`
.
padStart
(
2
,
0
);
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: `${day}:${hours}:${minutes}:${seconds}`
countdown
:
`
${
day
}
天
${
hours
}
时
${
minutes
}
分`
countdown
:
`
${
hours
}
:
${
minutes
}
:
${
seconds
}
`
});
},
1000
)
}
...
...
@@ -704,15 +701,15 @@ class Detail extends Component {
*/
}
{
/*双十一期间不需要显示 不要删除*/
}
{
/*{*/
}
{
/*isCent && !course_info.is_aist && (course_info.group_status === 3 || course_info.group_status === 4) &&*/
}
{
/*<Group*/
}
{
/*courseInfo={course_info}*/
}
{
/*history={this.props.history}*/
}
{
/*countdown={countdown}*/
}
{
/*invitedFriends={this.invitedFriends}*/
}
{
/*/>*/
}
{
/*}*/
}
{
isCent
&&
!
course_info
.
is_aist
&&
(
course_info
.
group_status
===
3
||
course_info
.
group_status
===
4
)
&&
<
Group
courseInfo
=
{
course_info
}
history
=
{
this
.
props
.
history
}
countdown
=
{
countdown
}
invitedFriends
=
{
this
.
invitedFriends
}
/
>
}
{
/*
* 砍价
...
...
src/components/python/index.js
View file @
94c04b63
...
...
@@ -12,7 +12,7 @@ class Python extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
isPay
:
1
,
isPay
:
0
,
}
}
...
...
@@ -22,17 +22,17 @@ class Python extends Component {
fetchCourseInfo
=
()
=>
{
const
id
=
getParam
(
'id'
);
//
http.get(`${API.home}/m/course/detail/${id}`).then((res) => {
//
const {data, code} = res.data;
//
if (code === 200) {
//
//
this.setState({
//
// TODO
//
// isPay: data.course_info.is_pay
//
isPay: 1
//
})
//
}
//
});
http
.
get
(
`
${
API
.
home
}
/m/course/detail/
${
id
}
`
).
then
((
res
)
=>
{
const
{
data
,
code
}
=
res
.
data
;
if
(
code
===
200
)
{
this
.
setState
({
// TODO
// isPay: data.course_info.is_pay
isPay
:
1
})
}
});
}
render
()
{
...
...
src/components/python/pythonStudy/index.js
View file @
94c04b63
...
...
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
import
{
Accordion
,
Toast
}
from
'antd-mobile'
;
import
{
HeaderBar
}
from
'@/common'
;
import
{
http
,
getParam
}
from
'@/utils'
;
import
{
Link
}
from
"react-router-dom"
;
import
'./index.scss'
;
import
{
connect
}
from
"react-redux"
;
...
...
@@ -94,11 +95,11 @@ class PythonStudy extends Component {
syllabus
&&
syllabus
.
length
>
0
&&
syllabus
.
map
((
syllabusItem
,
index
)
=>
{
let
header
=
`第
${
this
.
Change
(
syllabusItem
.
stage
)}
阶段:
${
syllabusItem
.
name
}
`
return
(
<
Accordion
.
Panel
header
=
{
header
}
className
=
"pad"
>
<
Accordion
.
Panel
header
=
{
header
}
className
=
"pad"
key
=
{
index
}
>
{
syllabusItem
.
lessons
&&
syllabusItem
.
lessons
.
length
>
0
&&
syllabusItem
.
lessons
.
map
((
lessonsItem
,
index
)
=>
{
return
(
<
div
>
<
div
key
=
{
index
}
>
<
h2
className
=
"python-study__pass"
>
第
{
lessonsItem
.
shut
}
关
{
lessonsItem
.
name
}
{
...
...
@@ -107,10 +108,31 @@ class PythonStudy extends Component {
}
<
/h2
>
<
Link
to
=
{
`/test/pythonStudy/
${
lessonsItem
.
video_id
}
`
}
>
<
div
className
=
"python-study__subject"
style
=
{{
opacity
:
lessonsItem
.
info
.
is_unlock
==
0
?
"0.6"
:
"1"
}}
key
=
{
index
}
>
<
img
className
=
"python-study__subject-icon"
src
=
{
lessonsItem
.
info
.
img_url
}
alt
=
""
/>
{
lessonsItem
.
info
.
is_unlock
==
1
&&
lessonsItem
.
info
.
complete
==
1
&&
<
i
className
=
"python-study__subject-status"
data
-
status
=
"complete"
><
/i
>
}
{
lessonsItem
.
info
.
is_unlock
==
0
&&
<
i
className
=
"python-study__subject-status"
data
-
status
=
"lock"
><
/i
>
}
<
div
className
=
"python-study__subject-content"
>
<
h2
className
=
"python-study__subject-title text-overflow-1"
>
{
lessonsItem
.
info
.
name
}
<
/h2
>
<
/div
>
<
/div
>
<
/Link
>
{
lessonsItem
.
questions
&&
lessonsItem
.
questions
.
length
>
0
&&
lessonsItem
.
questions
.
map
((
item
,
index
)
=>
{
return
(
<
div
className
=
"python-study__subject"
>
<
Link
to
=
{
`/test/pythonHomeWork?id=
${
item
.
id
}
`
}
key
=
{
index
}
>
<
div
className
=
"python-study__subject"
style
=
{{
opacity
:
item
.
is_unlock
==
0
?
"0.6"
:
"1"
}}
>
<
img
className
=
"python-study__subject-icon"
src
=
{
item
.
icon
}
alt
=
""
/>
{
item
.
is_unlock
==
1
&&
item
.
complete
==
1
&&
...
...
@@ -121,34 +143,18 @@ class PythonStudy extends Component {
<
i
className
=
"python-study__subject-status"
data
-
status
=
"lock"
><
/i
>
}
<
div
className
=
"python-study__subject-content"
>
<
h2
className
=
"python-study__subject-title
"
>
{
item
.
name
}
<
/h2
>
<
h2
className
=
"python-study__subject-title text-overflow-1
"
>
{
item
.
name
}
<
/h2
>
{
item
.
is_must
==
1
&&
<
span
className
=
"python-study__subject-tag"
>
必做练习
<
/span
>
}
<
/div
>
<
/div
>
<
/Link
>
)
})
}
{
/*<div className="python-study__subject">*/
}
{
/*<i className="python-study__subject-icon"></i>*/
}
{
/*<i className="python-study__subject-status" data-status="complete"></i>*/
}
{
/*<div className="python-study__subject-content">*/
}
{
/*<h2 className="python-study__subject-title">基础练习基基础练习基础练习基础练习基础练习</h2>*/
}
{
/*<span className="python-study__subject-tag">必做练习</span>*/
}
{
/*</div>*/
}
{
/*</div>*/
}
{
/*<div className="python-study__subject" data-status="lock">*/
}
{
/*<i className="python-study__subject-icon"></i>*/
}
{
/*<i className="python-study__subject-status" data-status="lock"></i>*/
}
{
/*<div className="python-study__subject-content" >*/
}
{
/*<h2 className="python-study__subject-title" data-status="lock">基础练习基基础练习基础练习基础练习基础练习</h2>*/
}
{
/*<span className="python-study__subject-tag">必做练习</span>*/
}
{
/*</div>*/
}
{
/*</div>*/
}
<
/div
>
)
})
...
...
src/components/python/pythonStudy/index.scss
View file @
94c04b63
...
...
@@ -6,6 +6,17 @@
color
:
#333
;
background-color
:
#CFDBE5
;
}
.am-accordion.python-study__stage
.am-accordion-item
{
margin-top
:
15px
;
.am-accordion-content
{
padding-bottom
:
10px
;
}
}
.am-accordion.python-study__stage
{
.am-accordion-item
:first-child
{
margin-top
:
0
;
}
}
html
:not
([
data-scale
])
.am-accordion.python-study__stage
.am-accordion-item
.am-accordion-content
.am-accordion-content-box
::after
{
display
:
none
;
...
...
@@ -18,6 +29,7 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am-
.python-study
{
height
:
100%
;
background-color
:
#F4F5F6
;
padding-bottom
:
15px
;
}
.python-study__header
{
...
...
@@ -51,7 +63,6 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am-
}
.python-study__progress
{
height
:
66px
;
padding
:
0
12px
;
}
...
...
@@ -65,7 +76,7 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am-
.python-study__progress-bar
{
position
:
relative
;
height
:
3px
;
margin
:
1
1px
0
13
px
;
margin
:
1
8px
0
15
px
;
border-radius
:
2px
;
background-color
:
rgba
(
207
,
219
,
229
,.
6
);
...
...
@@ -174,9 +185,12 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am-
height
:
100%
;
margin-left
:
55px
;
padding
:
0
33px
0
12px
;
position
:
relative
;
}
.python-study__subject-title
{
max-width
:
220px
;
width
:
228px
;
font-size
:
14px
;
color
:
#333
;
line-height
:
18px
;
...
...
@@ -191,9 +205,11 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am-
padding
:
0
4px
;
border-radius
:
2px
;
font-size
:
12px
;
color
:
rgba
(
82
,
92
,
101
,.
1
)
;
color
:
#525C65
;
line-height
:
18px
;
background-color
:
rgba
(
82
,
92
,
101
,.
1
);
position
:
absolute
;
bottom
:
0
;
}
.python-study__button
{
...
...
@@ -208,4 +224,5 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am-
color
:
#fff
;
text-align
:
center
;
background-color
:
#1A9BFC
;
z-index
:
1
;
}
\ No newline at end of file
src/router/router-config.js
View file @
94c04b63
...
...
@@ -237,6 +237,6 @@ export default [
},
{
path
:
'/pythonStudy'
,
component
:
loadable
(()
=>
import
(
'@/components/pythonStudy'
))
component
:
loadable
(()
=>
import
(
'@/components/python
/python
Study'
))
},
]
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