From 2b57369c7bbcdfd456e8f9547c26cd3a4f92e60c Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Sat, 8 Feb 2020 18:12:30 +0800 Subject: [PATCH] =?UTF-8?q?fix=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/Video/VideoIndex.js | 29 +++++++++++-------- .../courses/coursesDetail/CoursesLeftNav.js | 4 ++- .../user/usersInfo/video/VideoInReviewItem.js | 15 ++++++---- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/public/react/src/modules/courses/Video/VideoIndex.js b/public/react/src/modules/courses/Video/VideoIndex.js index 7f154544c..ede1012ea 100644 --- a/public/react/src/modules/courses/Video/VideoIndex.js +++ b/public/react/src/modules/courses/Video/VideoIndex.js @@ -145,8 +145,8 @@ class VideoIndex extends Component{ } toUpload =()=> { - const { admin , is_teacher} = this.props.user; - if (admin || (is_teacher && this.props.checkIfProfessionalCertification())) { + const { admin , is_teacher,business} = this.props.user; + if (admin || business || (is_teacher && this.props.checkIfProfessionalCertification())) { this.setState({ upload:true }) @@ -160,7 +160,9 @@ class VideoIndex extends Component{ const login=this.props.user&&this.props.user.login; 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(
@@ -193,14 +195,17 @@ class VideoIndex extends Component{

{count} 个视频 -

  • - { - upload ? - this.uploadVideo(false)}>取消 - : - 上传视频 - } -
  • + { + (admin || is_teacher) && +
  • + { + upload ? + this.uploadVideo(false)}>取消 + : + 上传视频 + } +
  • + }

    { @@ -228,7 +233,7 @@ class VideoIndex extends Component{ onEditVideo={this.onEditVideo} onMaskClick={this.onMaskClick} getCopyText={this.getCopyText} - + operation={operation} > ) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 9a572f9cb..7dc4e90a4 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -1178,7 +1178,9 @@ class Coursesleftnav extends Component{ item.type==="poll"?: item.type==="attachment"?: item.type==="board"?: - item.type==="course_group"?: + item.type==="course_group"?: + + item.type==="video"?: item.type==="statistics"?:"" } diff --git a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js b/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js index 1bba7ac03..ce1c1bfad 100644 --- a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js +++ b/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js @@ -20,7 +20,7 @@ const clipboardMap = {} function VideoInReviewItem (props) { const theme = useContext(ThemeContext); 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(()=> { if (!isReview) { _clipboard = new ClipboardJS(`.copybtn_item_${id}`); @@ -73,11 +73,14 @@ function VideoInReviewItem (props) { } {vv===0?"":vv} { isReview != true &&
    - - onEditVideo(props)} - style={{ marginTop: '1px', display: 'inline-block'}} - > - + { + operation && + + onEditVideo(props)} + style={{ marginTop: '1px', display: 'inline-block'}} + > + + }