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

dev_video
daiao 5 years ago
commit f44ba6a72c

@ -1,29 +1,22 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { WordsBtn,ActionBtn,getmyUrl,getUrl } from 'educoder'; import { WordsBtn } from 'educoder';
import {Tooltip,message,Input, Button} from 'antd'; import {Tooltip,message} from 'antd';
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import {getImageUrl} from 'educoder';
import axios from 'axios' import axios from 'axios'
import {getUrl} from 'educoder';
import moment from 'moment' import moment from 'moment'
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import Showoldfiles from "../coursesPublic/Showoldfiles"; import Showoldfiles from "../coursesPublic/Showoldfiles";
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import HeadlessModal from '../../user/usersInfo/common/HeadlessModal'
import ClipboardJS from 'clipboard'
import '../../user/usersInfo/video/InfosVideo.css'
let _clipboard = null;
class Fileslistitem extends Component{ class Fileslistitem extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state = { this.state = {
videoModalObj:false,
file_url:null,
} }
} }
setVisible=(bool)=>{
this.setState({
videoModalObj:bool
})
}
settingList=()=>{ settingList=()=>{
let {discussMessage}=this.props let {discussMessage}=this.props
@ -35,9 +28,6 @@ class Fileslistitem extends Component{
} }
showfiles=(list)=>{ showfiles=(list)=>{
// console.log("showfiles");
// console.log(list);
if(this.props.checkIfLogin()===false){ if(this.props.checkIfLogin()===false){
this.props.showLoginDialog() this.props.showLoginDialog()
return return
@ -56,21 +46,7 @@ class Fileslistitem extends Component{
if(list.is_history_file===false){ if(list.is_history_file===false){
// this.props.DownloadFileA(list.title,list.url) // this.props.DownloadFileA(list.title,list.url)
//window.location.href=list.url; //window.location.href=list.url;
if(list.content_type){ window.open(list.url, '_blank');
if(list.content_type==="video/mp4"){
this.setState({
videoModalObj:true,
file_url:"https://"+document.domain+list.url+'?file_name='+list.title+"&disposition=MP4",
// file_url:getUrl()+list.url+'?file_name='+list.title+'&disposition=MP4',
})
return
}else{
window.open(list.url, '_blank');
}
}else{
window.open(list.url, '_blank');
}
}else{ }else{
let {discussMessage,coursesId}=this.props let {discussMessage,coursesId}=this.props
let file_id=discussMessage.id let file_id=discussMessage.id
@ -89,24 +65,7 @@ class Fileslistitem extends Component{
// //
// } // }
// this.props.DownloadFileA(result.data.title,result.data.url) // this.props.DownloadFileA(result.data.title,result.data.url)
if(list.content_type){ window.open(list.url, '_blank');
if(list.content_type==="video/mp4"){
this.setState({
videoModalObj:true,
file_url:"https://"+document.domain+list.url+'?file_name='+list.title+'&disposition=MP4',
// file_url:getUrl()+list.url+'?file_name='+list.title+'&disposition=MP4',
})
return
}else{
window.open(list.url, '_blank');
}
}else{
window.open(list.url, '_blank');
}
}else{ }else{
this.setState({ this.setState({
Showoldfiles:true, Showoldfiles:true,
@ -128,17 +87,6 @@ class Fileslistitem extends Component{
}) })
} }
Clicktobroadcastthevideo=(bool,url)=>{
this.setState({
videoModalObj:bool,
file_url:"https://"+document.domain+url+'&disposition=MP4',
// file_url:getUrl()+url+'&disposition=MP4',
})
}
onDelete = (id) => { onDelete = (id) => {
this.setState({ this.setState({
@ -163,17 +111,6 @@ class Fileslistitem extends Component{
} }
copyurls =()=>{
//复制网络链接
setTimeout(() => {
if (!_clipboard) {
_clipboard = new ClipboardJS('.copybtn');
_clipboard.on('success', (e) => {
this.props.showNotification("复制成功");
});
}
}, 200)
}
savedelete=(id)=>{ savedelete=(id)=>{
this.setState({ this.setState({
@ -215,40 +152,13 @@ class Fileslistitem extends Component{
} }
render(){ render(){
const {videoModalObj,file_url}=this.state
const { checkBox, const { checkBox,
discussMessage,index discussMessage,index
} = this.props; } = this.props;
// console.log("Fileslistitem");
// console.log( document.domain);
// console.log(this.props.imhost);
// console.log( window.location.href);
return( return(
<div className="graduateTopicList boardsList"> <div className="graduateTopicList boardsList">
{
videoModalObj&&videoModalObj===true?
<HeadlessModal
visible={videoModalObj}
setVisible={(bool)=>this.setVisible(bool)}
className="showVideoModal"
width={800 - 1}
>
<video
preload="auto"
src={file_url} controls="true" >
您的浏览器不支持 video 标签
</video>
<div className="df copyLine">
<Input value={file_url}
className="dark"
></Input>
<ActionBtn className="copybtn" data-clipboard-text={file_url} onClick={() =>this.copyurls()}>复制视频地址</ActionBtn>
</div>
</HeadlessModal>
:""
}
{/*提示*/} {/*提示*/}
{this.state.Modalstype&&this.state.Modalstype===true?<Modals {this.state.Modalstype&&this.state.Modalstype===true?<Modals
@ -263,7 +173,6 @@ class Fileslistitem extends Component{
{...this.props} {...this.props}
visible={this.state.Showoldfiles} visible={this.state.Showoldfiles}
allfiles={this.state.allfiles} allfiles={this.state.allfiles}
Clicktobroadcastthevideo={(bool,urls,index)=>this.Clicktobroadcastthevideo(bool,urls,index)}
closaoldfilesprops={this.closaoldfilesprops} closaoldfilesprops={this.closaoldfilesprops}
/> />
<style>{` <style>{`
@ -457,4 +366,3 @@ class Fileslistitem extends Component{
} }
} }
export default Fileslistitem; export default Fileslistitem;

Loading…
Cancel
Save