dev_video
caicai8 5 years ago
parent 6c860ebc0f
commit 2b57369c7b

@ -145,8 +145,8 @@ class VideoIndex extends Component{
} }
toUpload =()=> { toUpload =()=> {
const { admin , is_teacher} = this.props.user; const { admin , is_teacher,business} = this.props.user;
if (admin || (is_teacher && this.props.checkIfProfessionalCertification())) { if (admin || business || (is_teacher && this.props.checkIfProfessionalCertification())) {
this.setState({ this.setState({
upload:true upload:true
}) })
@ -160,7 +160,9 @@ class VideoIndex extends Component{
const login=this.props.user&&this.props.user.login; const login=this.props.user&&this.props.user.login;
const _inputValue = videoId && this.getCopyText(videoId.file_url, videoId.cover_url); const _inputValue = videoId && this.getCopyText(videoId.file_url, videoId.cover_url);
const { admin , is_teacher ,business} = this.props.user;
// console.log(this.props && this.props.admin());
const operation = admin || business || (is_teacher && this.props.checkIfProfessionalCertification())
return( return(
<React.Fragment> <React.Fragment>
<div className="edu-back-white"> <div className="edu-back-white">
@ -193,14 +195,17 @@ class VideoIndex extends Component{
</HeadlessModal> </HeadlessModal>
<p className="clearfix padding30"> <p className="clearfix padding30">
<span className="fl font-grey-9"> <span className="color-orange">{count}</span> </span> <span className="fl font-grey-9"> <span className="color-orange">{count}</span> </span>
<li className="fr"> {
{ (admin || is_teacher) &&
upload ? <li className="fr">
<WordsBtn style="grey" className="font-16" onClick={()=>this.uploadVideo(false)}>取消</WordsBtn> {
: upload ?
<WordsBtn style="blue" className="font-16" onClick={this.toUpload}>上传视频</WordsBtn> <WordsBtn style="grey" className="font-16" onClick={()=>this.uploadVideo(false)}>取消</WordsBtn>
} :
</li> <WordsBtn style="blue" className="font-16" onClick={this.toUpload}>上传视频</WordsBtn>
}
</li>
}
</p> </p>
</div> </div>
{ {
@ -228,7 +233,7 @@ class VideoIndex extends Component{
onEditVideo={this.onEditVideo} onEditVideo={this.onEditVideo}
onMaskClick={this.onMaskClick} onMaskClick={this.onMaskClick}
getCopyText={this.getCopyText} getCopyText={this.getCopyText}
operation={operation}
> >
</VideoInReviewItem> </VideoInReviewItem>
) )

@ -1178,7 +1178,9 @@ class Coursesleftnav extends Component{
item.type==="poll"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-wenjuan mr10 fl":"iconfont icon-wenjuan mr10 fl"}></i>: item.type==="poll"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-wenjuan mr10 fl":"iconfont icon-wenjuan mr10 fl"}></i>:
item.type==="attachment"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-ziyuan mr10 fl":"iconfont icon-ziyuan mr10 fl"} ></i>: item.type==="attachment"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-ziyuan mr10 fl":"iconfont icon-ziyuan mr10 fl"} ></i>:
item.type==="board"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-taolun mr10 fl":"iconfont icon-taolun mr10 fl"} ></i>: item.type==="board"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-taolun mr10 fl":"iconfont icon-taolun mr10 fl"} ></i>:
item.type==="course_group"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenban mr10 fl":"iconfont icon-fenban mr10 fl"} ></i>: item.type==="course_group"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenban mr10 fl":"iconfont icon-fenban mr10 fl"} ></i>:
item.type==="video"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-bofang1 mr10 fl":"iconfont icon-bofang1 mr10 fl"} ></i>:
item.type==="statistics"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-tongji mr10 fl":"iconfont icon-tongji mr10 fl"} ></i>:"" item.type==="statistics"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-tongji mr10 fl":"iconfont icon-tongji mr10 fl"} ></i>:""
} }

@ -20,7 +20,7 @@ const clipboardMap = {}
function VideoInReviewItem (props) { function VideoInReviewItem (props) {
const theme = useContext(ThemeContext); const theme = useContext(ThemeContext);
const { history, file_url, cover_url, title, created_at, published_at, isReview, id const { history, file_url, cover_url, title, created_at, published_at, isReview, id
, onEditVideo, onMaskClick, getCopyText, showNotification,vv,play_duration} = props; , onEditVideo, onMaskClick, getCopyText, showNotification,vv,play_duration,operation} = props;
useEffect(()=> { useEffect(()=> {
if (!isReview) { if (!isReview) {
_clipboard = new ClipboardJS(`.copybtn_item_${id}`); _clipboard = new ClipboardJS(`.copybtn_item_${id}`);
@ -73,11 +73,14 @@ function VideoInReviewItem (props) {
</Tooltip> } {vv===0?"":vv} </Tooltip> } {vv===0?"":vv}
</span> </span>
{ isReview != true && <div> { isReview != true && <div>
<Tooltip title="编辑" placement="bottom"> {
<i className="icon-bianji1 iconfont" onClick={() => onEditVideo(props)} operation &&
style={{ marginTop: '1px', display: 'inline-block'}} <Tooltip title="编辑" placement="bottom">
></i> <i className="icon-bianji1 iconfont" onClick={() => onEditVideo(props)}
</Tooltip> style={{ marginTop: '1px', display: 'inline-block'}}
></i>
</Tooltip>
}
<Tooltip title="复制视频地址" placement="bottom"> <Tooltip title="复制视频地址" placement="bottom">
<i className={`icon-fuzhi iconfont copybtn_item_${id}`} data-clipboard-text={getCopyText(file_url, cover_url)}></i> <i className={`icon-fuzhi iconfont copybtn_item_${id}`} data-clipboard-text={getCopyText(file_url, cover_url)}></i>
</Tooltip> </Tooltip>

Loading…
Cancel
Save