From 5e168417a5270bef925163986fc4c5d73880949e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 19 Aug 2019 16:30:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E5=93=81=E8=AF=BE=E7=A8=8B=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/modals/Jointheclass.js | 13 ++- .../modules/paths/PathDetail/DetailTop.css | 2 +- .../src/modules/paths/PathDetail/DetailTop.js | 57 ++++++----- .../modules/paths/PathDetail/OpenCourse.js | 99 +++++++++++++++++++ .../paths/PathDetail/PathDetailIndex.js | 27 +---- public/react/src/modules/tpm/SiderBar.js | 6 +- 6 files changed, 147 insertions(+), 57 deletions(-) create mode 100644 public/react/src/modules/paths/PathDetail/OpenCourse.js diff --git a/public/react/src/modules/modals/Jointheclass.js b/public/react/src/modules/modals/Jointheclass.js index 3d1eeb384..1150e178b 100644 --- a/public/react/src/modules/modals/Jointheclass.js +++ b/public/react/src/modules/modals/Jointheclass.js @@ -55,8 +55,17 @@ class Jointheclass extends Component { width="600px" >
-

是否确认该加入课堂?

-
+

是否确认该加入课堂?

+
+ this.modalCancel()}>取消 this.setDownload()}>确认
diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.css b/public/react/src/modules/paths/PathDetail/DetailTop.css index 17fdf3996..488e5569d 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.css +++ b/public/react/src/modules/paths/PathDetail/DetailTop.css @@ -50,7 +50,7 @@ } .ant-modal-title { font-size: 16px; - font-weight: 700!important; + font-weight: 500!important; color: #333; text-align: center; } \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js index 6270ffb06..f405a814d 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.js +++ b/public/react/src/modules/paths/PathDetail/DetailTop.js @@ -5,6 +5,7 @@ import SendPanel from "./sendPanel.js"; import { getImageUrl } from 'educoder'; import axios from 'axios'; import Modals from '../../modals/Modals'; +import OpenCourse from './OpenCourse'; import Jointheclass from '../../modals/Jointheclass' import './DetailTop.css'; @@ -24,18 +25,21 @@ class DetailTop extends Component{ cardsModalsavetype:false, MenuItemskey:1, courseslist:[], - Pathcourseid:undefined + Pathcourseid:undefined, + OpenCourseTypes:false } } componentDidMount(){ let courseslist=[] - this.props.courses.map((item,key)=>{ - if(1===key+1){ - return( - courseslist.push(item) - ) - } - }) + if(this.props.courses!=undefined&&this.props.courses.length!=0){ + this.props.courses.map((item,key)=>{ + if(1===key+1){ + return( + courseslist.push(item) + ) + } + }) + } this.setState({ courseslist:courseslist }) @@ -196,21 +200,28 @@ class DetailTop extends Component{ this.props.getdatasindex() }; + OpenCoursefun=()=>{ + this.setState({ + OpenCourseTypes:true + }) + } + OpenCourseCancel=()=>{ + this.setState({ + OpenCourseTypes:false + }) + } render(){ let{detailInfoList}=this.props; - let{Modalstype,Modalstopval,cardsModalcancel,cardsModalsave,Modalsbottomval,cardsModalsavetype,loadtype}=this.state; + let{Modalstype,Modalstopval,cardsModalcancel,OpenCourseTypes,Modalsbottomval,cardsModalsavetype,loadtype}=this.state; const radioStyle = { display: 'block', height: '30px', lineHeight: '30px', }; - - //
- let menu = ( - {this.props.courses&&this.props.courses.map((item,key)=>{ + {this.props.courses===undefined||this.props.courses.length===0?"":this.props.courses.map((item,key)=>{ return( this.MenuItems(key+1)}> @@ -226,7 +237,7 @@ class DetailTop extends Component{ return( -
+
- this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}> - {/*
*/} + {this.state.yslJointhe===true?this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}>:""} + {this.state.OpenCourseTypes===true?this.OpenCourseCancel()}/>:""} + { detailInfoList && -
+
{detailInfoList.name} @@ -326,7 +338,7 @@ class DetailTop extends Component{ {this.props.courses===undefined?"":detailInfoList.is_creator===true?
- 开课 + this.OpenCoursefun()}>开课 学习统计 @@ -334,8 +346,7 @@ class DetailTop extends Component{
- {/*{this.props.courses===undefined||this.props.courses.length===0?"":
*/} - {this.props.courses===undefined?"":
+ {this.props.courses===undefined||this.props.courses.length===0?"":
  • {this.state.courseslist.map((item,key)=>{ - // course_id: 1309 - // course_identity: 5 - // course_status: {status: 1, time: "进行至第5周,共1642周"} - // first_category_url: "/courses/1309/informs" return(
    @@ -467,7 +474,7 @@ class DetailTop extends Component{ :this.JoinnowCourse(item.course_id)}>立即报名:""} {item.course_status.status===1? - detailInfoList.is_creator===true? + detailInfoList.is_creator===true?this.JoinnowCourse(item.course_id)}> 进入课堂 :item.course_identity<6? 立即学习 diff --git a/public/react/src/modules/paths/PathDetail/OpenCourse.js b/public/react/src/modules/paths/PathDetail/OpenCourse.js new file mode 100644 index 000000000..b64b9e9e7 --- /dev/null +++ b/public/react/src/modules/paths/PathDetail/OpenCourse.js @@ -0,0 +1,99 @@ +import React, { Component } from 'react'; +import { Modal, Radio, Input} from 'antd'; +import axios from 'axios'; +//加入精品课堂 +class OpenCourse extends Component { + + constructor(props) { + super(props); + this.state={ + value:0 + } + } + + componentDidMount() { + // console.log("加入精品课堂"); + // console.log(this.props); + + } + + modalCancel=()=>{ + this.props.OpenCourseCancel(); + }; + + setDownload=()=>{ + let {value}=this.state; + console.log(this.props.match.params.pathId) + + if(value===0){ + window.open(`/courses/${this.props.match.params.pathId}/newgold/0 `); + }else{ + window.open(`/courses/${this.props.match.params.pathId}/newgold/1`); + } + this.props.OpenCourseCancel(); + } + setpathradioChange = e => { + + this.setState({ + value: e.target.value, + }); + }; + + render() { + // console.log("加入精品课堂2"); + //console.log(this.props.Pathcourseid); + const pathradioStyle = { + display: 'block', + height: '30px', + lineHeight: '30px', + color:'#05101A', + textAlign: 'left', + fontSize: '16px' + }; + const pathradioStyles={ + color:'#999999' + } + return( + + + + ) + } +} + +export default OpenCourse; \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 0ee4a3904..4f92e5841 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -81,32 +81,7 @@ class PathDetailIndex extends Component{ cardsModalsave:this.cardsModalsave, user_id:undefined, loadtype:false, - courses:[ - { - course_id: 1309, - first_category_url: "/courses/1309/informs", - start_date: "2019-07-16", // 开始时间 - end_date: "2050-12-31", // 结束时间 - student_count: 112, // 学习人数 - course_identity: 5, // 当前用户在该课堂的身份 - course_status: { - status: 1, // status:0:即将开课 1:进行中 2:已结束 - time: "进行至第5周,共1642周" // time:当前进度 - } - }, - { - course_id: 1319, - first_category_url: "/courses/1319/shixun_homeworks/11549", - start_date:"2019-08-16", - end_date:"2050-12-31", - student_count: 112, - course_identity: 1, - course_status: { - status: 0, - time: "" - } - } - ], + courses:undefined, items: getItems(10) } this.onDragEnd = this.onDragEnd.bind(this); diff --git a/public/react/src/modules/tpm/SiderBar.js b/public/react/src/modules/tpm/SiderBar.js index 11369024d..beab18fdc 100644 --- a/public/react/src/modules/tpm/SiderBar.js +++ b/public/react/src/modules/tpm/SiderBar.js @@ -109,15 +109,15 @@ class SiderBar extends Component { -

    微信扫一扫

    -

    关注公众号

    +

    微信扫一扫

    +

    关注公众号