Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into courseware

courseware
杨树明 5 years ago
commit 04a1abf178

@ -12,6 +12,7 @@ import Videostatistics from '../videostatistics/Videostatistics';
import './video.css'; import './video.css';
import '../css/Courses.css'; import '../css/Courses.css';
import '../publicNav/nav.css'; import '../publicNav/nav.css';
const PAGE_SIZE = 15; const PAGE_SIZE = 15;
const LIVE_PAGE_SIZE = 10; const LIVE_PAGE_SIZE = 10;
const $ = window.$; const $ = window.$;
@ -20,6 +21,7 @@ function getRight(){
var right = parseInt($(".-task-sidebar").css("right")); var right = parseInt($(".-task-sidebar").css("right"));
return right === 0 ? 0 : right; return right === 0 ? 0 : right;
} }
class VideoIndex extends Component { class VideoIndex extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -241,14 +243,16 @@ class VideoIndex extends Component{
statistics: bool statistics: bool
}) })
} }
render() { render() {
const {videos, upload, videoData, type, liveData, lives, page, liveVisible, isSpining, liveId, otherLinkVisible, statistics} = this.state; const {videos, upload, videoData, type, liveData, lives, page, liveVisible, isSpining, liveId, otherLinkVisible, statistics} = this.state;
const {coursesId, videoId} = this.props.match.params; const {coursesId, videoId} = this.props.match.params;
let course_identity = this.props&&this.props.coursedata; let {course_identity} = this.props && this.props.coursedata;
let is_teacher = this.props && this.props.user && this.props.user.is_teacher; let is_teacher = this.props && this.props.user && this.props.user.is_teacher;
const flag = parseInt(course_identity) < 5; const flag = parseInt(course_identity) < 5;
const newOperation = flag; const newOperation = flag;
const new_upload = flag && (is_teacher && this.props.checkIfProfessionalCertification()); const new_upload = flag && (is_teacher && this.props.checkIfProfessionalCertification());
return ( return (
<React.Fragment> <React.Fragment>
<VideoLink <VideoLink
@ -312,11 +316,14 @@ class VideoIndex extends Component{
><i className="iconfont icon-tongji1 mr5"></i></WordsBtn> ><i className="iconfont icon-tongji1 mr5"></i></WordsBtn>
{ {
videoId ? videoId ?
<WordsBtn style="blue" onClick={()=>this.editDir(videoData && videoData.category_name,videoId)} className={"ml30 font-16"}>目录重命名</WordsBtn> <WordsBtn style="blue"
onClick={() => this.editDir(videoData && videoData.category_name, videoId)}
className={"ml30 font-16"}>目录重命名</WordsBtn>
: :
<WordsBtn style="blue" className="ml30 font-16" onClick={this.addDir}>新建目录</WordsBtn> <WordsBtn style="blue" className="ml30 font-16" onClick={this.addDir}>新建目录</WordsBtn>
} }
<WordsBtn style="blue" className="ml30 font-16" onClick={()=>this.setLinkeVisible(true)}>增加外链</WordsBtn> <WordsBtn style="blue" className="ml30 font-16"
onClick={() => this.setLinkeVisible(true)}>增加外链</WordsBtn>
</span> : "" </span> : ""
} }
{ {
@ -324,11 +331,13 @@ class VideoIndex extends Component{
<span> <span>
{ {
upload ? upload ?
<WordsBtn style="grey" className="font-16 ml30" onClick={()=>this.uploadVideo(false)}>取消</WordsBtn> <WordsBtn style="grey" className="font-16 ml30"
onClick={() => this.uploadVideo(false)}>取消</WordsBtn>
: :
<WordsBtn style="blue" className="font-16 ml30" onClick={this.toUpload}>上传视频</WordsBtn> <WordsBtn style="blue" className="font-16 ml30" onClick={this.toUpload}>上传视频</WordsBtn>
} }
</span>:"" </span>
: ""
} }
</React.Fragment> </React.Fragment>
: :
@ -378,4 +387,5 @@ class VideoIndex extends Component{
) )
} }
} }
export default VideoIndex; export default VideoIndex;

@ -16,7 +16,7 @@ class Videostatisticscomtwo extends Component {
this.state = { this.state = {
data: [], data: [],
page: 1, page: 1,
limit: 10, limit: 20,
members_count: 0, members_count: 0,
columnsstu: [ columnsstu: [
{ {

@ -89,7 +89,7 @@ class Videostatisticslist extends Component {
loading:false, loading:false,
data:[], data:[],
page:1, page:1,
limit:10, limit:20,
members_count:0, members_count:0,
order:undefined, order:undefined,
} }
@ -134,7 +134,7 @@ class Videostatisticslist extends Component {
let datalists = []; let datalists = [];
for (var i = 0; i < response.data.videos.length; i++) { for (var i = 0; i < response.data.videos.length; i++) {
datalists.push({ 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, title: response.data.videos[i].title,
people_num: response.data.videos[i].people_num, people_num: response.data.videos[i].people_num,
total_time: response.data.videos[i].total_time, total_time: response.data.videos[i].total_time,

Loading…
Cancel
Save