Commit 94c04b63 by xuzhenghua

课程详情也

parents 9f604fde dffb8342
......@@ -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)
}
......
......@@ -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}
/>
}
{/*
* 砍价
......
......@@ -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() {
......
......@@ -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,48 +108,53 @@ 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">
<img className="python-study__subject-icon" src={item.icon} alt="" />
{
item.is_unlock == 1 && item.complete == 1 &&
<i className="python-study__subject-status" data-status="complete"></i>
}
{
item.is_unlock == 1 && item.complete == 0 &&
<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>
<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 &&
<i className="python-study__subject-status" data-status="complete"></i>
}
{
item.is_must == 1 &&
<span className="python-study__subject-tag">必做练习</span>
item.is_unlock == 1 && item.complete == 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">{item.name}</h2>
{
item.is_must == 1 &&
<span className="python-study__subject-tag">必做练习</span>
}
</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>
)
})
......
......@@ -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: 11px 0 13px;
margin: 18px 0 15px;
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
......@@ -237,6 +237,6 @@ export default [
},
{
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