Commit 94c04b63 by xuzhenghua

课程详情也

parents 9f604fde dffb8342
...@@ -65,19 +65,16 @@ class ToGroup extends Component { ...@@ -65,19 +65,16 @@ class ToGroup extends Component {
if (res.data.data.is_success === 0) { if (res.data.data.is_success === 0) {
let date = res.data.data.end_time * 1000, let date = res.data.data.end_time * 1000,
day = 0,
hours = 0, hours = 0,
minutes = 0, minutes = 0,
seconds = 0; seconds = 0;
setInterval(() => { setInterval(() => {
date -= 1000 date -= 1000
day = `${parseInt(date / (3600000 * 24))}`.padStart(2, 0); hours = `${parseInt(date / (60 * 60 * 1000))}`.padStart(2, 0);
hours = `${parseInt((date- day * 3600000 * 24)/3600000)}`.padStart(2, 0); minutes = `${parseInt((date - hours * 3600000) / 60000)}`.padStart(2, 0);
minutes = `${parseInt((date - day * 3600000 * 24 - hours * 3600000) / 60000)}`.padStart(2, 0); seconds = `${parseInt((date - hours * 3600000 - minutes * 60000) / 1000)}`.padStart(2, 0);
seconds = `${parseInt((date - day * 3600000 * 24 - hours * 3600000 - minutes * 60000) / 1000)}`.padStart(2, 0);
this.setState({ this.setState({
// countdown: `${day}:${hours}:${minutes}:${seconds}` countdown: `${hours}:${minutes}:${seconds}`
countdown: `${day}${hours}${minutes}分`
}); });
}, 1000) }, 1000)
} }
......
...@@ -345,19 +345,16 @@ class Detail extends Component { ...@@ -345,19 +345,16 @@ class Detail extends Component {
if (course_info.group_status === 3 || course_info.group_status === 4) { if (course_info.group_status === 3 || course_info.group_status === 4) {
let endTime = course_info.pdd_group_info.groupon_member.end_time; let endTime = course_info.pdd_group_info.groupon_member.end_time;
let date = endTime * 1000, let date = endTime * 1000,
day = 0,
hours = 0, hours = 0,
minutes = 0, minutes = 0,
seconds = 0; seconds = 0;
setInterval(() => { setInterval(() => {
date -= 1000 date -= 1000
day = `${parseInt(date / (3600000 * 24))}`.padStart(2, 0); hours = `${parseInt(date / (60 * 60 * 1000))}`.padStart(2, 0);
hours = `${parseInt((date- day * 3600000 * 24)/3600000)}`.padStart(2, 0); minutes = `${parseInt((date - hours * 3600000) / 60000)}`.padStart(2, 0);
minutes = `${parseInt((date - day * 3600000 * 24 - hours * 3600000) / 60000)}`.padStart(2, 0); seconds = `${parseInt((date - hours * 3600000 - minutes * 60000) / 1000)}`.padStart(2, 0);
seconds = `${parseInt((date - day * 3600000 * 24 - hours * 3600000 - minutes * 60000) / 1000)}`.padStart(2, 0);
this.setState({ this.setState({
// countdown: `${day}:${hours}:${minutes}:${seconds}` countdown: `${hours}:${minutes}:${seconds}`
countdown: `${day}${hours}${minutes}分`
}); });
}, 1000) }, 1000)
} }
...@@ -704,15 +701,15 @@ class Detail extends Component { ...@@ -704,15 +701,15 @@ class Detail extends Component {
*/ */
} }
{/*双十一期间不需要显示 不要删除*/} {/*双十一期间不需要显示 不要删除*/}
{/*{*/} {
{/*isCent && !course_info.is_aist && (course_info.group_status === 3 || course_info.group_status === 4) &&*/} isCent && !course_info.is_aist && (course_info.group_status === 3 || course_info.group_status === 4) &&
{/*<Group*/} <Group
{/*courseInfo={course_info}*/} courseInfo={course_info}
{/*history={this.props.history}*/} history={this.props.history}
{/*countdown={countdown}*/} countdown={countdown}
{/*invitedFriends={this.invitedFriends}*/} invitedFriends={this.invitedFriends}
{/*/>*/} />
{/*}*/} }
{/* {/*
* 砍价 * 砍价
......
...@@ -12,7 +12,7 @@ class Python extends Component { ...@@ -12,7 +12,7 @@ class Python extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
isPay: 1, isPay: 0,
} }
} }
...@@ -22,17 +22,17 @@ class Python extends Component { ...@@ -22,17 +22,17 @@ class Python extends Component {
fetchCourseInfo = () => { fetchCourseInfo = () => {
const id = getParam('id'); const id = getParam('id');
// http.get(`${API.home}/m/course/detail/${id}`).then((res) => { http.get(`${API.home}/m/course/detail/${id}`).then((res) => {
// const {data, code} = res.data; const {data, code} = res.data;
// if (code === 200) { if (code === 200) {
//
// this.setState({ this.setState({
// // TODO // TODO
// // isPay: data.course_info.is_pay // isPay: data.course_info.is_pay
// isPay: 1 isPay: 1
// }) })
// } }
// }); });
} }
render() { render() {
......
...@@ -2,6 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,6 +2,7 @@ import React, { Component } from 'react';
import {Accordion, Toast} from 'antd-mobile'; import {Accordion, Toast} from 'antd-mobile';
import { HeaderBar } from '@/common'; import { HeaderBar } from '@/common';
import { http,getParam } from '@/utils'; import { http,getParam } from '@/utils';
import {Link} from "react-router-dom";
import './index.scss'; import './index.scss';
import {connect} from "react-redux"; import {connect} from "react-redux";
...@@ -94,11 +95,11 @@ class PythonStudy extends Component { ...@@ -94,11 +95,11 @@ class PythonStudy extends Component {
syllabus && syllabus.length>0 && syllabus.map((syllabusItem,index)=>{ syllabus && syllabus.length>0 && syllabus.map((syllabusItem,index)=>{
let header = `第${this.Change(syllabusItem.stage)}阶段:${syllabusItem.name}` let header = `第${this.Change(syllabusItem.stage)}阶段:${syllabusItem.name}`
return( 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)=> { syllabusItem.lessons && syllabusItem.lessons.length>0 && syllabusItem.lessons.map((lessonsItem,index)=> {
return( return(
<div> <div key={index}>
<h2 className="python-study__pass"> <h2 className="python-study__pass">
{lessonsItem.shut} {lessonsItem.name} {lessonsItem.shut} {lessonsItem.name}
{ {
...@@ -107,10 +108,31 @@ class PythonStudy extends Component { ...@@ -107,10 +108,31 @@ class PythonStudy extends Component {
} }
</h2> </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)=> { lessonsItem.questions && lessonsItem.questions.length>0 && lessonsItem.questions.map((item,index)=> {
return ( 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="" /> <img className="python-study__subject-icon" src={item.icon} alt="" />
{ {
item.is_unlock == 1 && item.complete == 1 && item.is_unlock == 1 && item.complete == 1 &&
...@@ -121,34 +143,18 @@ class PythonStudy extends Component { ...@@ -121,34 +143,18 @@ class PythonStudy extends Component {
<i className="python-study__subject-status" data-status="lock"></i> <i className="python-study__subject-status" data-status="lock"></i>
} }
<div className="python-study__subject-content"> <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 && item.is_must == 1 &&
<span className="python-study__subject-tag">必做练习</span> <span className="python-study__subject-tag">必做练习</span>
} }
</div> </div>
</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> </div>
) )
}) })
......
...@@ -6,6 +6,17 @@ ...@@ -6,6 +6,17 @@
color: #333; color: #333;
background-color: #CFDBE5; 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 { html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am-accordion-content .am-accordion-content-box::after {
display: none; display: none;
...@@ -18,6 +29,7 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am- ...@@ -18,6 +29,7 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am-
.python-study { .python-study {
height: 100%; height: 100%;
background-color: #F4F5F6; background-color: #F4F5F6;
padding-bottom: 15px;
} }
.python-study__header { .python-study__header {
...@@ -51,7 +63,6 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am- ...@@ -51,7 +63,6 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am-
} }
.python-study__progress { .python-study__progress {
height: 66px;
padding: 0 12px; padding: 0 12px;
} }
...@@ -65,7 +76,7 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am- ...@@ -65,7 +76,7 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am-
.python-study__progress-bar { .python-study__progress-bar {
position: relative; position: relative;
height: 3px; height: 3px;
margin: 11px 0 13px; margin: 18px 0 15px;
border-radius: 2px; border-radius: 2px;
background-color: rgba(207,219,229,.6); background-color: rgba(207,219,229,.6);
...@@ -174,9 +185,12 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am- ...@@ -174,9 +185,12 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am-
height: 100%; height: 100%;
margin-left: 55px; margin-left: 55px;
padding: 0 33px 0 12px; padding: 0 33px 0 12px;
position: relative;
} }
.python-study__subject-title { .python-study__subject-title {
max-width: 220px;
width: 228px;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
line-height: 18px; line-height: 18px;
...@@ -191,9 +205,11 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am- ...@@ -191,9 +205,11 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am-
padding: 0 4px; padding: 0 4px;
border-radius: 2px; border-radius: 2px;
font-size: 12px; font-size: 12px;
color: rgba(82,92,101,.1); color: #525C65;
line-height: 18px; line-height: 18px;
background-color: rgba(82,92,101,.1); background-color: rgba(82,92,101,.1);
position: absolute;
bottom: 0;
} }
.python-study__button { .python-study__button {
...@@ -208,4 +224,5 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am- ...@@ -208,4 +224,5 @@ html:not([data-scale]) .am-accordion.python-study__stage .am-accordion-item .am-
color: #fff; color: #fff;
text-align: center; text-align: center;
background-color: #1A9BFC; background-color: #1A9BFC;
z-index: 1;
} }
\ No newline at end of file
...@@ -237,6 +237,6 @@ export default [ ...@@ -237,6 +237,6 @@ export default [
}, },
{ {
path: '/pythonStudy', path: '/pythonStudy',
component: loadable(() => import('@/components/pythonStudy')) component: loadable(() => import('@/components/python/pythonStudy'))
}, },
] ]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment