Merge remote-tracking branch 'origin/dev_video' into dev_video

# Conflicts:
#	public/react/src/modules/courses/Video/VideoIndex.js
dev_video
杨树明 6 years ago
commit d8abcc5f31

@ -142,6 +142,17 @@ class VideoIndex extends Component{
}) })
this.getList(page); this.getList(page);
} }
toUpload =()=> {
const { admin , is_teacher} = this.props.user;
if (admin || (is_teacher && this.props.checkIfProfessionalCertification())) {
this.setState({
upload:true
})
} else {
this.props.showProfessionalCertificationDialog();
}
}
render(){ render(){
const { count , videos , upload , visible , videoVisible , videoId } = this.state; const { count , videos , upload , visible , videoVisible , videoId } = this.state;
const CourseId=this.props.match.params.coursesId; const CourseId=this.props.match.params.coursesId;
@ -186,7 +197,7 @@ class VideoIndex extends Component{
upload ? upload ?
<WordsBtn style="grey" className="font-16" onClick={()=>this.uploadVideo(false)}>取消</WordsBtn> <WordsBtn style="grey" className="font-16" onClick={()=>this.uploadVideo(false)}>取消</WordsBtn>
: :
<WordsBtn style="blue" className="font-16" onClick={()=>this.uploadVideo(true)}>上传视频</WordsBtn> <WordsBtn style="blue" className="font-16" onClick={this.toUpload}>上传视频</WordsBtn>
} }
</li> </li>
</p> </p>

@ -869,7 +869,7 @@ class CoursesNew extends Component {
> >
{getFieldDecorator("checkboxgroup", { {getFieldDecorator("checkboxgroup", {
initialValue: [ initialValue: [
"shixun_homework", "common_homework", "group_homework", "exercise", "attachment", "course_group", "shixun_homework", "common_homework", "group_homework", "exercise", "attachment", "course_group","video"
], ],
})( })(
<Checkbox.Group style={{ marginTop: "10px"}}> <Checkbox.Group style={{ marginTop: "10px"}}>

@ -76,14 +76,14 @@ function doCreateUploader (options) {
file_name: _random+fileName file_name: _random+fileName
}).then((response) => { }).then((response) => {
// if (response.data.status == ) // if (response.data.status == )
if(response){
const data = response.data.data const data = response.data.data
var uploadAuth = data.UploadAuth var uploadAuth = data.UploadAuth
var uploadAddress = data.UploadAddress var uploadAddress = data.UploadAddress
var videoId = data.VideoId var videoId = data.VideoId
uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress, videoId) uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress, videoId)
}
}).catch((error) => { }).catch((error) => {
// 删除当前出错的,并执行下一个任务 // 删除当前出错的,并执行下一个任务
uploader.deleteFile(uploader._curIndex) uploader.deleteFile(uploader._curIndex)

@ -47,8 +47,8 @@ function VideoUpload (props) {
` `
} }
</style> </style>
<div className="courseForm"> <div className="courseForm" style={{display:"flex",alignItems:"center"}}>
<span className="titleLabel">标题</span> <span className="titleLabel mt15">标题</span>
<Input placeholder={`标题支持最多${MAX_LENGTH}个字符`} onInput={titleChange} maxLength={MAX_LENGTH} addonAfter={ <Input placeholder={`标题支持最多${MAX_LENGTH}个字符`} onInput={titleChange} maxLength={MAX_LENGTH} addonAfter={
<span className="color-grey-6 font-13">{String(title.length)}/{MAX_LENGTH}</span> <span className="color-grey-6 font-13">{String(title.length)}/{MAX_LENGTH}</span>
} }

@ -50,7 +50,8 @@ function VideoUploadList (props) {
} }
const _beforeunload = beforeunload // .bind(this, noUploads, state) const _beforeunload = beforeunload // .bind(this, noUploads, state)
const username = props.match.params.username const username = props.match.params.username || props.CourseUser;
console.log("username",username);
const { showNotification, history } = props; const { showNotification, history } = props;
const uploaderOptions = { const uploaderOptions = {
@ -237,15 +238,16 @@ function VideoUploadList (props) {
}) })
}).then((response) => { }).then((response) => {
// to success page // to success page
if(response){
if (response.data.status == 0) { if (response.data.status == 0) {
dispatch({type: 'removeAll'}) dispatch({type: 'removeAll'})
// setCouldRouteNav(true)
if(flag){ if(flag){
successFunc(false) successFunc(false)
}else{ }else{
history.push(`/users/${username}/videos/success`) history.push(`/users/${username}/videos/success`)
} }
} }
}
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })

Loading…
Cancel
Save