diff --git a/public/react/src/modules/courses/Video/Video.js b/public/react/src/modules/courses/Video/Video.js
index 181c082ae..56ad1a60c 100644
--- a/public/react/src/modules/courses/Video/Video.js
+++ b/public/react/src/modules/courses/Video/Video.js
@@ -191,15 +191,21 @@ class Video extends Component {
const CourseId = this.props.match.params.coursesId;
const VID = this.props.match.params.videoId;
- const login = this.props.user && this.props.user.login;
+ let login = this.props && this.props.user&&this.props.user.login;;
+
const _inputValue = videoId && this.getCopyText(videoId.file_url, videoId.cover_url);
- const { admin, is_teacher, business, user_id } = this.props.user;
+ // const { admin, is_teacher, business, user_id } = this.props && this.props.user;
+ let admin = this.props && this.props.user&&this.props.user.admin;;
+ let business = this.props && this.props.user&&this.props.user.business;;
+ let user_id = this.props && this.props.user&&this.props.user.user_id;;
+
+
const { videos, upload, uploadVideo, videoData, changePage, pageSize, page } = this.props;
const operation = admin || business;
- const { course_identity } = this.props.coursedata;
+ const { course_identity } = this.props && this.props.coursedata;
const flagMove = parseInt(course_identity) < 5;
return (
@@ -245,7 +251,7 @@ class Video extends Component {
{
videos.map((item, key) => {
diff --git a/public/react/src/modules/courses/Video/VideoIndex.js b/public/react/src/modules/courses/Video/VideoIndex.js
index fe52b17dc..e4fd369ce 100644
--- a/public/react/src/modules/courses/Video/VideoIndex.js
+++ b/public/react/src/modules/courses/Video/VideoIndex.js
@@ -1,7 +1,7 @@
-import React,{ Component } from "react";
-import { WordsBtn,on, trigger ,publicSearchs} from 'educoder';
+import React, {Component} from "react";
+import {WordsBtn, on, trigger, publicSearchs} from 'educoder';
-import { Menu, Spin } from 'antd';
+import {Menu, Spin} from 'antd';
import axios from 'axios';
import Videos from './Video';
@@ -12,289 +12,292 @@ import Videostatistics from '../videostatistics/Videostatistics';
import './video.css';
import '../css/Courses.css';
import '../publicNav/nav.css';
+
const PAGE_SIZE = 15;
const LIVE_PAGE_SIZE = 10;
const $ = window.$;
-function getRight(){
- var right = parseInt($(".-task-sidebar").css("right"));
- return right===0?0:right;
+function getRight() {
+ var right = parseInt($(".-task-sidebar").css("right"));
+ return right === 0 ? 0 : right;
}
-class VideoIndex extends Component{
- constructor(props){
- super(props);
- this.state={
- page:1,
- upload:false,
- videos:undefined,
- videoData:undefined,
- otherLinkVisible:false,
- type:"video",
- isSpining:false,
- lives:undefined,
- liveData:undefined,
+class VideoIndex extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ page: 1,
+ upload: false,
+ videos: undefined,
+ videoData: undefined,
+ otherLinkVisible: false,
+ type: "video",
+ isSpining: false,
- liveId:undefined,
+ lives: undefined,
+ liveData: undefined,
- liveVisible:false,
- statistics:false,
+ liveId: undefined,
- }
- }
+ liveVisible: false,
+ statistics: false,
- checkType=(type,page)=>{
- this.setState({
- type,
- isSpining:true
- })
- if(type === "video"){
- this.getList(page);
- }else{
- this.getLiveList(page);
- }
- }
+ }
+ }
- componentDidMount=()=>{
- const { search } = this.props.location;
- const { page } = this.state;
- if(search && search === "?open=live"){
- this.setState({
- type:"live"
- })
- this.checkType("live",page);
- }else{
- if(search === "?open=new"){
- this.setState({
- upload:true
- })
- }
- this.checkType("video",page);
- }
- }
- componentDidUpdate = (prevProps) => {
- if(this.props.match.params.videoId !== prevProps.match.params.videoId ){
- this.setState({
- upload:false
- })
- const { page } = this.state;
- this.checkType("video",page);
- }
- }
- // 获取直播列表
- getLiveList=(page)=>{
- const CourseId=this.props.match.params.coursesId;
- const url = `/courses/${CourseId}/live_links.json`;
- axios.get(url,{
- params:{
- page,
- limit:LIVE_PAGE_SIZE
- }
- }).then(result=>{
- if(result){
- this.setState({
- liveData:result.data,
- lives:result.data.lives,
- isSpining:false,
- })
- }
- }).catch(error=>{
- console.log(error);
- })
- }
+ checkType = (type, page) => {
+ this.setState({
+ type,
+ isSpining: true
+ })
+ if (type === "video") {
+ this.getList(page);
+ } else {
+ this.getLiveList(page);
+ }
+ }
- // 获取视频列表
- getList=(page)=>{
- const { coursesId , videoId }=this.props.match.params;
- const fetchUrl = `/courses/${coursesId}/course_videos.json`;
- axios.get(fetchUrl, {
- params: {
- page,
- limit: PAGE_SIZE,
- category_id:videoId
- }
- })
- .then((response) => {
- if(response){
- this.setState({
- videos:response.data.videos,
- videoData:response.data,
- isSpining:false
- })
- }
- }).catch((error) => {
- console.log(error);
- })
- }
+ componentDidMount = () => {
+ const {search} = this.props.location;
+ const {page} = this.state;
+ if (search && search === "?open=live") {
+ this.setState({
+ type: "live"
+ })
+ this.checkType("live", page);
+ } else {
+ if (search === "?open=new") {
+ this.setState({
+ upload: true
+ })
+ }
+ this.checkType("video", page);
+ }
+ }
+ componentDidUpdate = (prevProps) => {
+ if (this.props.match.params.videoId !== prevProps.match.params.videoId) {
+ this.setState({
+ upload: false
+ })
+ const {page} = this.state;
+ this.checkType("video", page);
+ }
+ }
+ // 获取直播列表
+ getLiveList = (page) => {
+ const CourseId = this.props.match.params.coursesId;
+ const url = `/courses/${CourseId}/live_links.json`;
+ axios.get(url, {
+ params: {
+ page,
+ limit: LIVE_PAGE_SIZE
+ }
+ }).then(result => {
+ if (result) {
+ this.setState({
+ liveData: result.data,
+ lives: result.data.lives,
+ isSpining: false,
+ })
+ }
+ }).catch(error => {
+ console.log(error);
+ })
+ }
- changeType=(e)=>{
- this.setState({
- type:e.key,
- upload:false,
- page:1
- })
- this.checkType(e.key,1);
- }
+ // 获取视频列表
+ getList = (page) => {
+ const {coursesId, videoId} = this.props.match.params;
+ const fetchUrl = `/courses/${coursesId}/course_videos.json`;
+ axios.get(fetchUrl, {
+ params: {
+ page,
+ limit: PAGE_SIZE,
+ category_id: videoId
+ }
+ })
+ .then((response) => {
+ if (response) {
+ this.setState({
+ videos: response.data.videos,
+ videoData: response.data,
+ isSpining: false
+ })
+ }
+ }).catch((error) => {
+ console.log(error);
+ })
+ }
- changePage=(page,type)=>{
- this.setState({
- page
- })
- this.checkType(type,page);
- }
+ changeType = (e) => {
+ this.setState({
+ type: e.key,
+ upload: false,
+ page: 1
+ })
+ this.checkType(e.key, 1);
+ }
- onEditVideo=(item)=>{
- let videoId = {
- videoId: item.id,
- title: item.title
- }
- this.setState({
- videoId,
- })
- this.setVisible(true);
- }
- uploadVideo=(upload)=>{
+ changePage = (page, type) => {
+ this.setState({
+ page
+ })
+ this.checkType(type, page);
+ }
- this.setState({
- upload,
- isSpining:true
- })
- const { page } = this.state;
- setTimeout(()=>{
- this.getList(page);
- },500)
- }
+ onEditVideo = (item) => {
+ let videoId = {
+ videoId: item.id,
+ title: item.title
+ }
+ this.setState({
+ videoId,
+ })
+ this.setVisible(true);
+ }
+ uploadVideo = (upload) => {
- toUpload =()=> {
- const { admin , is_teacher,business} = this.props.user;
- if (admin || business || (is_teacher && this.props.checkIfProfessionalCertification())) {
- this.setState({
- type:"video",
- upload:true,
- page:1
- })
- } else {
- this.props.showProfessionalCertificationDialog();
- }
- }
+ this.setState({
+ upload,
+ isSpining: true
+ })
+ const {page} = this.state;
+ setTimeout(() => {
+ this.getList(page);
+ }, 500)
+ }
+
+ toUpload = () => {
+ const {admin, is_teacher, business} = this.props.user;
+ if (admin || business || (is_teacher && this.props.checkIfProfessionalCertification())) {
+ this.setState({
+ type: "video",
+ upload: true,
+ page: 1
+ })
+ } else {
+ this.props.showProfessionalCertificationDialog();
+ }
+ }
- // 直播设置后回调的方法
- // successFunc=()=>{
- // this.setState({
- // type:"live",
- // page:1
- // })
- // this.checkType("live",1);
- // }
- // 直播设置
- liveSetting=()=>{
- this.setState({
- liveId:undefined
- })
- this.setliveVisibel(true);
- }
- //直播设置弹框
- setliveVisibel=(flag,changetypeFlag)=>{
- this.setState({
- liveVisible:flag
- })
- if(flag === false){
- this.setState({
- liveId:undefined
- })
- }
- if(changetypeFlag){
- this.checkType("live",1);
- }
- }
- // 列表-编辑(修改传到编辑的id)
- setLiveId=(id)=>{
- this.setState({
- liveId:id
- })
- this.setliveVisibel(true);
- }
+ // 直播设置后回调的方法
+ // successFunc=()=>{
+ // this.setState({
+ // type:"live",
+ // page:1
+ // })
+ // this.checkType("live",1);
+ // }
+ // 直播设置
+ liveSetting = () => {
+ this.setState({
+ liveId: undefined
+ })
+ this.setliveVisibel(true);
+ }
+ //直播设置弹框
+ setliveVisibel = (flag, changetypeFlag) => {
+ this.setState({
+ liveVisible: flag
+ })
+ if (flag === false) {
+ this.setState({
+ liveId: undefined
+ })
+ }
+ if (changetypeFlag) {
+ this.checkType("live", 1);
+ }
+ }
+ // 列表-编辑(修改传到编辑的id)
+ setLiveId = (id) => {
+ this.setState({
+ liveId: id
+ })
+ this.setliveVisibel(true);
+ }
- // 新增目录
- addDir=()=>{
- let {videoData}=this.state;
- trigger('videoAdd', parseInt(videoData.course_module_id));
- }
- // 目录重命名
- editDir=(name,id)=>{
- let data={id,name,update:this.getList}
- trigger('editVideo',data);
- }
- // 增加外链
- setLinkeVisible=(flag,refresh)=>{
- this.setState({
- otherLinkVisible:flag
- })
- if(refresh){
- const { page } = this.state;
- this.getList(page);
- }
- }
- //统计
- statisticsy=(bool)=>{
- this.setState({
- statistics:bool
+ // 新增目录
+ addDir = () => {
+ let {videoData} = this.state;
+ trigger('videoAdd', parseInt(videoData.course_module_id));
+ }
+ // 目录重命名
+ editDir = (name, id) => {
+ let data = {id, name, update: this.getList}
+ trigger('editVideo', data);
+ }
+ // 增加外链
+ setLinkeVisible = (flag, refresh) => {
+ this.setState({
+ otherLinkVisible: flag
})
+ if (refresh) {
+ const {page} = this.state;
+ this.getList(page);
+ }
}
- render(){
- const { videos , upload , videoData , type , liveData , lives , page , liveVisible , isSpining , liveId , otherLinkVisible,statistics } = this.state;
- const { is_teacher } = this.props.user;
- const { coursesId , videoId }=this.props.match.params;
+ //统计
+ statisticsy = (bool) => {
+ this.setState({
+ statistics: bool
+ })
+ }
+
+ render() {
+ const {videos, upload, videoData, type, liveData, lives, page, liveVisible, isSpining, liveId, otherLinkVisible, statistics} = this.state;
+ const {coursesId, videoId} = this.props.match.params;
+ let {course_identity} = this.props && this.props.coursedata;
+ let is_teacher = this.props && this.props.user && this.props.user.is_teacher;
+ const flag = parseInt(course_identity) < 5;
+ const newOperation = flag;
+ const new_upload = flag && (is_teacher && this.props.checkIfProfessionalCertification());
- const {course_identity} = this.props.coursedata;
- const flag = parseInt(course_identity) < 5;
- const newOperation = flag;
- const new_upload = flag && (is_teacher && this.props.checkIfProfessionalCertification());
- return(
-
-
-
- {
- liveVisible ?
- :
- :
+
- }
+ }
{
- statistics===false?
-
+ statistics === false ?
+
{
videoData && videoData.category_name && type === "video" ?
{videoData.category_name}
:
-
+
:
-
this.statisticsy(b)}>
+
this.statisticsy(b)}>
}
{
- statistics===false?
-
- {
- type === "video" ?
-
- :
-
- }
-
+ statistics === false ?
+
+ {
+ type === "video" ?
+
+ :
+
+ }
+
:
""
}
-
- )
- }
+
+ )
+ }
}
+
export default VideoIndex;
diff --git a/public/react/src/modules/courses/signin/css/signincdi.css b/public/react/src/modules/courses/signin/css/signincdi.css
index 7ad9a0d0c..bd45185b9 100644
--- a/public/react/src/modules/courses/signin/css/signincdi.css
+++ b/public/react/src/modules/courses/signin/css/signincdi.css
@@ -188,6 +188,12 @@
padding-top: 20px;
padding-bottom: 20px;
}
+.teacherentrydivss{
+ padding-left: 20px;
+ padding-right: 20px;
+ padding-top: 20px;
+ padding-bottom: 20px;
+}
.teachedivp{
font-size:16px;
font-family:Microsoft YaHei;
diff --git a/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js b/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js
index 457c6d1f3..1111b6509 100644
--- a/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js
+++ b/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js
@@ -33,7 +33,7 @@ class Videostatisticscom extends Component {
-
+
视频统计总览
播放数据从{this.props.watch_staticsdata&&this.props.watch_staticsdata.begin_at?this.props.watch_staticsdata.begin_at:0}开始统计
diff --git a/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js b/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js
index 764ddcb1f..ed72d6bb2 100644
--- a/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js
+++ b/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js
@@ -1,6 +1,6 @@
import React, {Component} from "react";
import '../../signin/css/signincdi.css';
-import {Pagination, Table, Menu, Dropdown} from 'antd';
+import {Pagination, Table, Menu, Dropdown,Spin} from 'antd';
import {getImageUrl, sortDirections} from 'educoder';
import axios from 'axios';
import LoadingSpin from "../../../../common/LoadingSpin";
@@ -16,7 +16,7 @@ class Videostatisticscomtwo extends Component {
this.state = {
data: [],
page: 1,
- limit: 10,
+ limit: 20,
members_count: 0,
columnsstu: [
{
@@ -38,7 +38,12 @@ class Videostatisticscomtwo extends Component {
className: 'font-14 maxnamewidth100s',
width: '100px',
render: (text, record) => (
-
{record.user_name}
+
+ {record.user_name}
+
+
),
},
{
@@ -63,7 +68,9 @@ class Videostatisticscomtwo extends Component {
sorter: true,
sortDirections: sortDirections,
render: (text, record) => (
-
{record.total_duration}
+
{record.total_duration}
),
},
{
@@ -76,7 +83,11 @@ class Videostatisticscomtwo extends Component {
sorter: true,
sortDirections: sortDirections,
render: (text, record) => (
-
{record.feq}
+
+ {record.feq}
+
),
},
{
@@ -87,7 +98,11 @@ class Videostatisticscomtwo extends Component {
className: 'font-14 maxnamewidth100s',
width: '100px',
render: (text, record) => (
-
{record.start_at}
+
+ {record.start_at}
+
),
},
{
@@ -98,7 +113,11 @@ class Videostatisticscomtwo extends Component {
className: 'font-14 maxnamewidth100s',
width: '100px',
render: (text, record) => (
-
{record.end_at}
+
+ {record.end_at}
+
),
}
],
@@ -409,7 +428,7 @@ class Videostatisticscomtwo extends Component {
return (
-
+
视频名称视频名称…
- {
- loading === true ?
-
-
-
- :
-
+
+
{
data.length === 0 ?
:
+
+
}
- }
diff --git a/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js b/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js
index 637ec306c..21f3ed9a0 100644
--- a/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js
+++ b/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js
@@ -1,7 +1,7 @@
import React, {Component} from "react";
import '../../signin/css/signincdi.css';
-import {Pagination,Table} from 'antd';
-import {getImageUrl,sortDirections} from 'educoder';
+import {Pagination,Table,Spin} from 'antd';
+import {getImageUrl,sortDirections,formatSeconds} from 'educoder';
import axios from 'axios';
import LoadingSpin from "../../../../common/LoadingSpin";
import NoneDatas from "../../signin/component/NoneDatas";
@@ -34,7 +34,12 @@ class Videostatisticslist extends Component {
className: 'font-14 maxnamewidth150s',
width: '150px',
render: (text, record) => (
-
{record.title}
+
+ {record.title}
+
+
),
},
{
@@ -55,12 +60,17 @@ class Videostatisticslist extends Component {
dataIndex: 'total_time',
key: 'total_time',
align: "center",
- className: 'font-14 maxnamewidth150s',
- width: '150px',
+ className: 'font-14 maxnamewidth100s',
+ width: '100px',
sorter: true,
sortDirections: sortDirections,
render: (text, record) => (
-
{record.total_time}
+
+ {record.total_time}
+
+
),
},
{
@@ -71,7 +81,12 @@ class Videostatisticslist extends Component {
className: 'font-14 maxnamewidth100s',
width: '100px',
render: (text, record) => (
-
{record.user_name}
+
+ {record.user_name}
+
+
),
},
{
@@ -80,16 +95,16 @@ class Videostatisticslist extends Component {
key: 'id',
align: "center",
className: 'font-14',
- width: '90px',
+ width: '50px',
render: (text, record) => (
-
this.props.tisticsbools(true,record.id)}>详情
+
this.props.tisticsbools(true,record.id)}>详情
),
}
],
loading:false,
data:[],
page:1,
- limit:10,
+ limit:20,
members_count:0,
order:undefined,
}
@@ -134,10 +149,10 @@ class Videostatisticslist extends Component {
let datalists = [];
for (var i = 0; i < response.data.videos.length; i++) {
datalists.push({
- number: (parseInt(this.state.spage) - 1) * parseInt(this.state.limit) + (i + 1),
+ number: (parseInt(this.state.page) - 1) * parseInt(this.state.limit) + (i + 1),
title: response.data.videos[i].title,
people_num: response.data.videos[i].people_num,
- total_time: response.data.videos[i].total_time,
+ total_time: response.data.videos[i].total_time?formatSeconds(response.data.videos[i].total_time):0,
user_name: response.data.videos[i].user_name,
id: response.data.videos[i].id,
})
@@ -235,7 +250,7 @@ class Videostatisticslist extends Component {
-
+
@@ -250,14 +265,7 @@ class Videostatisticslist extends Component {
`
}
- {
- loading===true?
-
-
-
- :
+
{
data.length===0?
@@ -267,6 +275,7 @@ class Videostatisticslist extends Component {
:
+
+
}
- }
diff --git a/public/react/src/modules/user/account/AccountImg.js b/public/react/src/modules/user/account/AccountImg.js
index bc95e4259..595ba7ba1 100644
--- a/public/react/src/modules/user/account/AccountImg.js
+++ b/public/react/src/modules/user/account/AccountImg.js
@@ -55,26 +55,30 @@ class AccountImg extends Component {
.newheadphotoblack{
position: absolute;
- top: 49px;
- left: 4px;
+ top: 45px;
+ left: 0px;
text-align: center;
color: #fff;
- width: 107px;
+ width: 110px;
height: 23px;
- line-height:23px;
+ line-height: 23px;
background: rgba(76,172,255,0.7);
}
- .borderradiusbox{
- border-top-left-radius: 4px;
- border-top-right-radius: 4px;
- border-bottom-right-radius: 4px;
- border-bottom-left-radius: 4px;
- }
-
+ .relativeRadiusbox{
+ overflow: hidden;
+ position: relative;
+ width: 109px;
+ border-radius: 50%;
+ height: 109px;
+ }
+
`}
-
-
修改头像
+
+
+
修改头像
+
+
);
}
diff --git a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js b/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js
index 299af0d08..71b16fab2 100644
--- a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js
+++ b/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js
@@ -74,7 +74,8 @@ function VideoInReviewItem (props) {
{/*
累计学习时长:{play_duration} h
*/}
{/*
{moment(published_at || created_at).format('YYYY-MM-DD HH:mm:ss')}{people_num} */}
- {link ?
:
累计学习时长:{
+
+ {link||total_time===undefined? :累计学习时长:{
formatSeconds(total_time)}
{/* total_time<60?total_time+' s':total_time/60<60?(total_time/60).toFixed(0)+' min':(total_time/3600).toFixed(1)+ ' h' */}
}
@@ -82,7 +83,7 @@ function VideoInReviewItem (props) {
{/* 2019-09-01 10:00:22 */}
- {!people_num || (people_num && people_num)===0 ? "" :
+ {total_time===undefined?'':!people_num || (people_num && people_num)===0 ? "" :
{!people_num || (people_num && people_num)===0?"":people_num}
}