From 5d8f27e1248e73ed9372cdf8ec89979e0117f5e4 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Sat, 20 Jul 2019 21:52:09 +0800
Subject: [PATCH 01/10] =?UTF-8?q?=E5=BB=B6=E6=97=B6=E6=8F=90=E7=A4=BA?=
=?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/courses/exercise/Exercisestatisticalresulttabel.js | 3 ++-
.../react/src/modules/courses/exercise/Exercisetablesmubu.js | 3 ++-
.../shixunHomework/Shixunworkdetails/ShixunCustomsPass.js | 3 ++-
.../shixunHomework/shixunreport/OfficialAcademicTranscript.js | 3 ++-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresulttabel.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresulttabel.js
index 2a04e1978..7f221ee55 100644
--- a/public/react/src/modules/courses/exercise/Exercisestatisticalresulttabel.js
+++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresulttabel.js
@@ -141,7 +141,8 @@ class OfficialAcademicTranscript extends Component {
border-radius: 12px;
color: rgba(221,23,23,1);
display: inline-block;
- line-height: 24px;
+ line-height: 24px;
+ text-align: center;
}
.tasknameboxs{
diff --git a/public/react/src/modules/courses/exercise/Exercisetablesmubu.js b/public/react/src/modules/courses/exercise/Exercisetablesmubu.js
index 2a7bc3f13..6a62db36c 100644
--- a/public/react/src/modules/courses/exercise/Exercisetablesmubu.js
+++ b/public/react/src/modules/courses/exercise/Exercisetablesmubu.js
@@ -100,7 +100,8 @@ class Exercisetablesmubus extends Component {
border-radius: 12px;
color: rgba(221,23,23,1);
display: inline-block;
- line-height: 24px;
+ line-height: 24px;
+ text-align: center;
}
.tasknameboxs{
diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js
index 8d3fcabb6..10ec2e40f 100644
--- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js
+++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js
@@ -153,7 +153,8 @@ class ShixunCustomsPass extends Component {
border-radius: 12px;
color: rgba(221,23,23,1);
display: inline-block;
- line-height: 24px;
+ line-height: 24px;
+ text-align: center;
}
.ant-table-tbody > tr > td{
font-size:14px;
diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js
index f0a7ff941..c7c3b67e4 100644
--- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js
+++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js
@@ -142,7 +142,8 @@ class OfficialAcademicTranscript extends Component {
border-radius: 12px;
color: rgba(221,23,23,1);
display: inline-block;
- line-height: 24px;
+ line-height: 24px;
+ text-align: center;
}
.tasknameboxs{
From fea89bedad3d5ce666586639fc306dbb65794ca7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Sat, 20 Jul 2019 22:02:47 +0800
Subject: [PATCH 02/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../shixunHomework/Listofworksstudentone.js | 25 +++++++++++++++----
.../shixunHomework/ShixunHomeworkPage.js | 1 +
.../shixunHomework/ShixunStudentWork.js | 18 +++++++++++++
.../shixunHomework/Trainingjobsetting.js | 17 +++++++++++++
.../shixunHomework/Workquestionandanswer.js | 18 +++++++++++++
5 files changed, 74 insertions(+), 5 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index 0b3c1b338..4ddc71bd0 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -899,6 +899,7 @@ class Listofworksstudentone extends Component {
)
},
],
+ yslpros:false,
}
// console.log("902");
// console.log("902");
@@ -912,15 +913,26 @@ class Listofworksstudentone extends Component {
}
componentWillReceiveProps(nextProps) {
- console.log("+++++++++913");
- console.log("+++++++++915");
- console.log("+++++++++916");
- console.log(nextProps);
- console.log(this.props)
+ // console.log("+++++++++916");
+ // console.log(nextProps);
+ // console.log(this.props)
+ // console.log(this.props.isAdmin());
+ if (nextProps.code_review != this.props.code_review) {
+ if (nextProps.code_review !== undefined) {
+ console.log("diaoyonglwangluo1");
+ if(this.props.isAdmin() === true){
+ this.tearchar();
+ }else{
+ this.student();
+ }
+ }
+ }
}
componentDidMount() {
console.log("componentDidMount");
+
+ console.log(this.props.isAdmin());
if(this.props.isAdmin() === true){
this.tearchar();
// console.log("909");
@@ -2217,6 +2229,9 @@ class Listofworksstudentone extends Component {
confirmysl(url){
axios.get(url).then((response) => {
+ if(response === undefined){
+ return
+ }
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
index bc20bb254..2996c794d 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
@@ -32,6 +32,7 @@ class ShixunHomeworkPage extends Component {
visible: false,
showmodel:false,
child:undefined,
+ yslpros:false,
}
}
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
index ad71fc6a4..fb0c44adf 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
@@ -81,6 +81,21 @@ class ShixunStudentWork extends Component {
this.props.triggerRef(this);
this.getTrainingjobsettings();
}
+ componentWillReceiveProps(nextProps) {
+ // console.log("+++++++++916");
+ // console.log(nextProps);
+ // console.log(this.props)
+ // console.log(this.props.isAdmin());
+ if (nextProps.code_review != this.props.code_review) {
+ if (nextProps.code_review !== undefined) {
+ console.log("diaoyonglwangluo1");
+ this.getTrainingjobsettings();
+ }
+ }
+
+ }
+
+
getTrainingjobsettings=()=>{
this.getupdata();
this.getTrainingjobsetting();
@@ -523,6 +538,9 @@ class ShixunStudentWork extends Component {
confirmysl(url){
axios.get(url).then((response) => {
+ if(response === undefined){
+ return
+ }
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
index 16d5e2a04..3809940e2 100644
--- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
+++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
@@ -141,6 +141,20 @@ class Trainingjobsetting extends Component {
+ }
+ componentWillReceiveProps(nextProps) {
+ // console.log("+++++++++916");
+ // console.log(nextProps);
+ // console.log(this.props)
+ // console.log(this.props.isAdmin());
+ if (nextProps.code_review != this.props.code_review) {
+ if (nextProps.code_review !== undefined) {
+ console.log("diaoyonglwangluo4");
+ this.getTrainingjobsetting()
+
+ }
+ }
+
}
// 获取数据地方
@@ -1744,6 +1758,9 @@ class Trainingjobsetting extends Component {
confirmysl(url){
axios.get(url).then((response) => {
+ if(response === undefined){
+ return
+ }
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
index a65346770..46f4835de 100644
--- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
+++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
@@ -94,6 +94,21 @@ class Workquestionandanswer extends Component {
shixuntypes: type[3]
})
}
+ componentWillReceiveProps(nextProps) {
+ // console.log("+++++++++916");
+ // console.log(nextProps);
+ // console.log(this.props)
+ // console.log(this.props.isAdmin());
+ if (nextProps.code_review != this.props.code_review) {
+ if (nextProps.code_review !== undefined) {
+ console.log("diaoyonglwangluo2");
+ var homeworkid = this.props.match.params.homeworkid;
+ // console.log(homeworkid)
+ this.Gettitleinformation(homeworkid)
+ }
+ }
+
+ }
isupdatas = () => {
var homeworkid = this.props.match.params.homeworkid;
@@ -333,6 +348,9 @@ class Workquestionandanswer extends Component {
confirmysl(url){
axios.get(url).then((response) => {
+ if(response === undefined){
+ return
+ }
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
From 15545fab0f64aa7ea78398d1cc6767d6a1942eef Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Sat, 20 Jul 2019 22:09:15 +0800
Subject: [PATCH 03/10] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E9=87=8D=E6=96=B0?=
=?UTF-8?q?=E6=B8=B2=E6=9F=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/courses/css/Courses.css | 4 ++--
.../src/modules/user/account/AccountCertification.js | 8 +++++---
.../src/modules/user/modal/RealNameCertificationModal.js | 6 +-----
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css
index 5766c571c..8b768aa88 100644
--- a/public/react/src/modules/courses/css/Courses.css
+++ b/public/react/src/modules/courses/css/Courses.css
@@ -801,10 +801,10 @@ a.white-btn.use_scope-btn:hover{
position: absolute;
}
-.ant-input{
+.ant-input,.ant-input .ant-input-suffix{
background-color: #fafafa!important;
}
-.ant-input:focus{
+.ant-input:focus,.ant-input:focus .ant-input-suffix{
background-color:#ffffff!important;
}
diff --git a/public/react/src/modules/user/account/AccountCertification.js b/public/react/src/modules/user/account/AccountCertification.js
index bd5c0ce10..c72778ced 100644
--- a/public/react/src/modules/user/account/AccountCertification.js
+++ b/public/react/src/modules/user/account/AccountCertification.js
@@ -16,7 +16,7 @@ class AccountCertification extends Component {
showRealNameCertificationModal = (index) => {
this.setState({
- certification:index
+ certification:index,
})
this.realNameCertificationModal.setVisible(true)
}
@@ -25,9 +25,11 @@ class AccountCertification extends Component {
let {basicInfo} = this.props;
return (
-
this.realNameCertificationModal = form} certification={certification}
- >
+ >:
this.realNameCertificationModal = form} certification={certification}
+ >}
-
认证信息
-
-
-
实名认证
-
有些课程需要实名认证才能加入哟,还能获得500金币的奖励~
-
- {
- basicInfo && basicInfo.authentication =="uncertified" ?
- this.showRealNameCertificationModal(1)} >立即认证:
- basicInfo && basicInfo.authentication =="applying" ? 待审核:
- 已认证
- }
-
-
-
-
-
职业认证
-
教师认证完毕之后,可创建课堂、发布实训、免金币查看所有实训答案..
-
- {
- basicInfo && basicInfo.professional_certification =="uncertified" ?
- this.showRealNameCertificationModal(2)} >立即认证:
- basicInfo && basicInfo.professional_certification =="applying" ? 待审核:
- 已认证
- }
-
-
-
-
-
* 我们确保你所提供的信息均处于严格保密状态,不会泄露
-
- );
- }
-}
-
-export default AccountCertification;
+import React, { Component } from 'react';
+// import { Button } from 'antd'
+import { WordsBtn, getImageUrl } from 'educoder';
+import RealNameCertificationModal from '../modal/RealNameCertificationModal'
+import '../../courses/css/Courses.css'
+import {CNotificationHOC} from '../../courses/common/CNotificationHOC'
+
+
+class AccountCertification extends Component {
+ constructor(props){
+ super(props);
+ this.state={
+ certification:1
+ }
+ }
+
+ showRealNameCertificationModal = (index) => {
+ this.setState({
+ certification:index,
+ })
+ this.realNameCertificationModal.setVisible(true)
+ }
+ render() {
+ let {certification}=this.state
+ let {basicInfo} = this.props;
+ return (
+
+ {this.state.certification===1?
this.realNameCertificationModal = form} certification={certification}
+ >:""}
+
+ {this.state.certification===2?
this.realNameCertificationModal = form} certification={certification}
+ >:""}
+
+
+
认证信息
+
+
+
实名认证
+
有些课程需要实名认证才能加入哟,还能获得500金币的奖励~
+
+ {
+ basicInfo && basicInfo.authentication =="uncertified" ?
+ this.showRealNameCertificationModal(1)} >立即认证:
+ basicInfo && basicInfo.authentication =="applying" ? 待审核:
+ 已认证
+ }
+
+
+
+
+
职业认证
+
教师认证完毕之后,可创建课堂、发布实训、免金币查看所有实训答案..
+
+ {
+ basicInfo && basicInfo.professional_certification =="uncertified" ?
+ this.showRealNameCertificationModal(2)} >立即认证:
+ basicInfo && basicInfo.professional_certification =="applying" ? 待审核:
+ 已认证
+ }
+
+
+
+
+
* 我们确保你所提供的信息均处于严格保密状态,不会泄露
+
+ );
+ }
+}
+
+export default AccountCertification;
From 98c45b524a9087a938ca2aea0d1657fc3ab124a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 20 Jul 2019 22:27:06 +0800
Subject: [PATCH 06/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/courses/shixunHomework/Listofworksstudentone.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index 4ddc71bd0..82aa2eb7a 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -2536,7 +2536,7 @@ class Listofworksstudentone extends Component {
-
没有数据可以显示.!
+
没有数据可以显示!
From 8d8ee7351010a8c47aac641ae4ecf9631047ab3f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Sat, 20 Jul 2019 22:28:10 +0800
Subject: [PATCH 07/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/shixunHomework/Listofworksstudentone.js | 6 +++---
.../courses/shixunHomework/ShixunHomeworkPage.js | 10 +++++-----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index 4ddc71bd0..c23b9b674 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -932,7 +932,7 @@ class Listofworksstudentone extends Component {
componentDidMount() {
console.log("componentDidMount");
- console.log(this.props.isAdmin());
+ // console.log(this.props.isAdmin());
if(this.props.isAdmin() === true){
this.tearchar();
// console.log("909");
@@ -1109,7 +1109,7 @@ class Listofworksstudentone extends Component {
})
} else {
- console.log(teacherdata)
+ // console.log(teacherdata)
if (teacherdata.id !== undefined || teacherdata.id !== null || teacherdata.id !== "") {
// console.log("seacthdata设置数据1")
// console.log(this.state.teacherdata )
@@ -1611,7 +1611,7 @@ class Listofworksstudentone extends Component {
let columns = this.state.columns;
var columns2=[];
if (teacherdata !== undefined) {
- console.log("1588");
+ // console.log("1588");
for (var i = 0; i < student_works.length; i++) {
var timedata = moment(student_works[i].update_time).format('YYYY-MM-DD HH:mm');
datalist.push({
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
index fc8fba188..1dd814856 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
@@ -54,9 +54,9 @@ class ShixunHomeworkPage extends Component {
}
Getdataback = (jobsettingsdata, teacherdata) => {
- console.log("56");
- console.log(jobsettingsdata);
- console.log(teacherdata);
+ // console.log("56");
+ // console.log(jobsettingsdata);
+ // console.log(teacherdata);
this.setState({
jobsettingsdata: jobsettingsdata,
@@ -72,13 +72,13 @@ class ShixunHomeworkPage extends Component {
// let sum = []
// sum.push(type[1])
// console.log("componentDidMountcomponentDidMount");
- console.log(type);
+ // console.log(type);
this.setState({
tab: type[1],
})
let querys = this.props.location.pathname;
const types = querys.split('/');
- console.log(types);
+ // console.log(types);
this.setState({
shixuntypes: types[3]
})
From e51192ed5f41f206ffdec4f469467970ec91808c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 20 Jul 2019 22:38:19 +0800
Subject: [PATCH 08/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/user/usersInfo/InfosCourse.js | 406 +++++++++---------
1 file changed, 204 insertions(+), 202 deletions(-)
diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js
index 109a4d7b9..e27513963 100644
--- a/public/react/src/modules/user/usersInfo/InfosCourse.js
+++ b/public/react/src/modules/user/usersInfo/InfosCourse.js
@@ -1,203 +1,205 @@
-import React, { Component } from 'react';
-import { SnackbarHOC } from 'educoder';
-import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
-import {Tooltip,Menu,Pagination,Spin} from 'antd';
-import Loadable from 'react-loadable';
-import Loading from '../../../Loading';
-import axios from 'axios';
-import NoneData from '../../courses/coursesPublic/NoneData'
-import {getImageUrl} from 'educoder';
-import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
-import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
-import "./usersInfo.css"
-import Create from './publicCreatNew'
-
-class InfosCourse extends Component{
- constructor(props){
- super(props);
- this.state={
- category:undefined,
- status:undefined,
- page:1,
- per_page:16,
-
- totalCount:undefined,
- data:undefined,
- isSpin:false
- }
- }
-
- componentDidMount=()=>{
- this.setState({
- isSpin:true
- })
- let{category,status,page}=this.state;
- this.getCourses(category,status,page);
- }
-
- getCourses=(category,status,page)=>{
- let url=`/users/${this.props.match.params.username}/courses.json`;
- axios.get((url),{params:{
- category,
- status,
- page,
- per_page: this.props.is_current && category && page ==1?17:16
- }}).then((result)=>{
- if(result){
- this.setState({
- totalCount:result.data.count,
- data:result.data,
- isSpin:false
- })
- }
- }).catch((error)=>{
- console.log(error);
- })
- }
-
- //切换种类
- changeCategory=(cate)=>{
- this.setState({
- category:cate,
- page:1,
- isSpin:true
- })
- let{status}=this.state;
- this.getCourses(cate,status,1);
- }
- //切换状态
- changeStatus=(status)=>{
- this.setState({
- status:status,
- page:1,
- isSpin:true
- })
- let{category}=this.state;
- this.getCourses(category,status,1);
- }
- //切换页数
- changePage=(page)=>{
- this.setState({
- page,
- isSpin:true
- })
- let{category,status}=this.state;
- this.getCourses(category,status,page);
- }
-
- // 进入课堂
- turnToCourses=(url,flag)=>{
- if(flag){
- this.props.history.push(url);
- }
- }
-
- render(){
- let{
- category,
- status,
- page,
- data,
- totalCount,
- isSpin
- } = this.state;
- let isStudent = this.props.isStudent();
- let is_current=this.props.is_current;
- return(
-
-
-
- {
- is_current &&
-
- }
-
- 共参与{totalCount}个{category?category=="manage"?"发布":"学习":"课堂"}
- 时间最新
-
-
- {
- !isStudent && page == 1 && !category && is_current &&
-
- }
- {
- (!data || data.courses.length==0) && (isStudent || category) &&
- }
- {
- data && data.courses && data.courses.map((item,key)=>{
- return(
-
this.turnToCourses(`${item.first_category_url}`,item.can_visited)} style={{"cursor": "pointer"}}>
- {
- item.is_public == 1 &&
-
-
-
- 公开
-
- }
- {
- item.can_visited ==false?
-
-
-
非成员不能访问
-
:""
- }
-
-
-
- {item.name}
-
-
-
{item.teacher && item.teacher.real_name}
-
{item.teacher && item.teacher.school_name}
-
-
-
- {
- item.members_count > 0 &&
-
-
- {item.members_count}
-
- }
- {
- item.homework_commons_count > 0 &&
-
-
- {item.homework_commons_count}
-
- }
- {
- item.attachments_count > 0 &&
-
-
- {item.attachments_count}
-
- }
-
-
-
- )
- })
- }
-
- {
- totalCount > 15 &&
-
- }
-
-
- )
- }
-}
+import React, { Component } from 'react';
+import { SnackbarHOC } from 'educoder';
+import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
+import {Tooltip,Menu,Pagination,Spin} from 'antd';
+import Loadable from 'react-loadable';
+import Loading from '../../../Loading';
+import axios from 'axios';
+import NoneData from '../../courses/coursesPublic/NoneData'
+import {getImageUrl} from 'educoder';
+import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
+import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
+import "./usersInfo.css"
+import Create from './publicCreatNew'
+
+class InfosCourse extends Component{
+ constructor(props){
+ super(props);
+ this.state={
+ category:undefined,
+ status:undefined,
+ page:1,
+ per_page:16,
+
+ totalCount:undefined,
+ data:undefined,
+ isSpin:false
+ }
+ }
+
+ componentDidMount=()=>{
+ this.setState({
+ isSpin:true
+ })
+ let{category,status,page}=this.state;
+ this.getCourses(category,status,page);
+ }
+
+ getCourses=(category,status,page)=>{
+ let url=`/users/${this.props.match.params.username}/courses.json`;
+ axios.get((url),{params:{
+ category,
+ status,
+ page,
+ per_page: this.props.is_current && category && page ==1?17:16
+ }}).then((result)=>{
+ if(result){
+ this.setState({
+ totalCount:result.data.count,
+ data:result.data,
+ isSpin:false
+ })
+ }
+ }).catch((error)=>{
+ console.log(error);
+ })
+ }
+
+ //切换种类
+ changeCategory=(cate)=>{
+ this.setState({
+ category:cate,
+ page:1,
+ isSpin:true
+ })
+ let{status}=this.state;
+ this.getCourses(cate,status,1);
+ }
+ //切换状态
+ changeStatus=(status)=>{
+ this.setState({
+ status:status,
+ page:1,
+ isSpin:true
+ })
+ let{category}=this.state;
+ this.getCourses(category,status,1);
+ }
+ //切换页数
+ changePage=(page)=>{
+ this.setState({
+ page,
+ isSpin:true
+ })
+ let{category,status}=this.state;
+ this.getCourses(category,status,page);
+ }
+
+ // 进入课堂
+ turnToCourses=(url,flag)=>{
+ if(flag){
+ this.props.history.push(url);
+ }
+ }
+
+ render(){
+ let{
+ category,
+ status,
+ page,
+ data,
+ totalCount,
+ isSpin
+ } = this.state;
+ let isStudent = this.props.isStudent();
+ let is_current=this.props.is_current;
+
+ console.log(this.props.current_user&&this.props.current_user.user_identity==="学生")
+ return(
+
+
+
+ {
+ is_current &&
+
+ }
+
+ 共参与{totalCount}个{category?category=="manage"?"发布":"学习":"课堂"}
+ 时间最新
+
+
+ {
+ !isStudent && page == 1 && !category && is_current &&
+ this.props.current_user&&this.props.current_user.user_identity==="学生"?"":
+ }
+ {
+ (!data || data.courses.length==0) && (isStudent || category) &&
+ }
+ {
+ data && data.courses && data.courses.map((item,key)=>{
+ return(
+
this.turnToCourses(`${item.first_category_url}`,item.can_visited)} style={{"cursor": "pointer"}}>
+ {
+ item.is_public == 1 &&
+
+
+
+ 公开
+
+ }
+ {
+ item.can_visited ==false?
+
+
+
非成员不能访问
+
:""
+ }
+
+
+
+ {item.name}
+
+
+
{item.teacher && item.teacher.real_name}
+
{item.teacher && item.teacher.school_name}
+
+
+
+ {
+ item.members_count > 0 &&
+
+
+ {item.members_count}
+
+ }
+ {
+ item.homework_commons_count > 0 &&
+
+
+ {item.homework_commons_count}
+
+ }
+ {
+ item.attachments_count > 0 &&
+
+
+ {item.attachments_count}
+
+ }
+
+
+
+ )
+ })
+ }
+
+ {
+ totalCount > 15 &&
+
+ }
+
+
+ )
+ }
+}
export default InfosCourse;
\ No newline at end of file
From 70a65eec18c4e7dff33fde151c684687c28cf776 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 20 Jul 2019 22:39:52 +0800
Subject: [PATCH 09/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/user/usersInfo/InfosCourse.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js
index e27513963..d4c82ad2f 100644
--- a/public/react/src/modules/user/usersInfo/InfosCourse.js
+++ b/public/react/src/modules/user/usersInfo/InfosCourse.js
@@ -104,7 +104,7 @@ class InfosCourse extends Component{
let isStudent = this.props.isStudent();
let is_current=this.props.is_current;
- console.log(this.props.current_user&&this.props.current_user.user_identity==="学生")
+ // console.log(this.props.current_user&&this.props.current_user.user_identity==="学生")
return(
From 9d02a4b189f26ff5fd934cde53013a605af7b422 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 20 Jul 2019 22:58:05 +0800
Subject: [PATCH 10/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/courses/shixunHomework/ShixunhomeWorkItem.js | 2 +-
public/react/src/modules/user/usersInfo/InfosCourse.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
index e026ad622..e87af8ec4 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
@@ -373,7 +373,7 @@ class ShixunhomeWorkItem extends Component{
width:192px !important;
}
.homepagePostSettingbox{
- width:121px !important;
+ width:139px !important;
}
`
}
diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js
index d4c82ad2f..146316111 100644
--- a/public/react/src/modules/user/usersInfo/InfosCourse.js
+++ b/public/react/src/modules/user/usersInfo/InfosCourse.js
@@ -104,7 +104,7 @@ class InfosCourse extends Component{
let isStudent = this.props.isStudent();
let is_current=this.props.is_current;
- // console.log(this.props.current_user&&this.props.current_user.user_identity==="学生")
+ console.log(this.props.current_user&&this.props.current_user.user_identity==="学生")
return(