diff --git a/public/react/src/modules/courses/Video/Live.js b/public/react/src/modules/courses/Video/Live.js
index b903b38bd..8de2628e8 100644
--- a/public/react/src/modules/courses/Video/Live.js
+++ b/public/react/src/modules/courses/Video/Live.js
@@ -7,9 +7,10 @@ import './video.css';
class Live extends Component{
render(){
- const { liveData , lives , successFunc , admin , business , is_teacher , pageSize , changePage } = this.props;
+ const { liveData , lives , successFunc , pageSize , changePage } = this.props;
+
+ const { admin , business , is_teacher } = this.props.user;
const operation = admin || business || (is_teacher && this.props.checkIfProfessionalCertification())
-
return(
{
diff --git a/public/react/src/modules/courses/Video/LiveItem.js b/public/react/src/modules/courses/Video/LiveItem.js
index 10586cdd7..4739c4c5f 100644
--- a/public/react/src/modules/courses/Video/LiveItem.js
+++ b/public/react/src/modules/courses/Video/LiveItem.js
@@ -36,7 +36,7 @@ class LiveItem extends Component{
-
{item.description}
+
{item.description}
{
item.on_status?
diff --git a/public/react/src/modules/courses/Video/LiveNew.js b/public/react/src/modules/courses/Video/LiveNew.js
index 0663525b2..0e3526b0f 100644
--- a/public/react/src/modules/courses/Video/LiveNew.js
+++ b/public/react/src/modules/courses/Video/LiveNew.js
@@ -6,12 +6,6 @@ import axios from 'axios';
const { TextArea } = Input;
class LiveNew extends Component{
- constructor(props){
- super(props);
- this.state={
-
- }
- }
handleSubmit=()=>{
this.props.form.validateFields((err, values) => {
@@ -24,7 +18,7 @@ class LiveNew extends Component{
if(result){
this.props.showNotification("添加成功!");
const { setliveVisibel } = this.props;
- setliveVisibel && setliveVisibel(false);
+ setliveVisibel && setliveVisibel(false,true);
}
}).catch(error=>{
console.log(error);
@@ -33,9 +27,25 @@ class LiveNew extends Component{
})
}
+ validateDesc= (rule, value, callback) => {
+ if (value.length > 100) {
+ callback("直播说明不能超过100个字!");
+ }
+ callback();
+ }
+
+ cancelNew=()=>{
+ const { setliveVisibel } = this.props;
+ this.props.form.setFieldsValue({
+ url:undefined,
+ description:undefined
+ })
+ setliveVisibel && setliveVisibel(false);
+ }
+
render(){
const {getFieldDecorator} = this.props.form;
- const { visible , setliveVisibel } = this.props;
+ const { visible } = this.props;
return(
)}
-
+
{getFieldDecorator('description', {
- rules: [],
+ rules: [{
+ validator: this.validateDesc,
+ }],
})(
)}
EduCoder推荐您使用腾讯课堂进行直播
- 下载操作指引
+ 操作指引
diff --git a/public/react/src/modules/courses/Video/VideoIndex.js b/public/react/src/modules/courses/Video/VideoIndex.js
index 59b8dc882..ad76d6d5d 100644
--- a/public/react/src/modules/courses/Video/VideoIndex.js
+++ b/public/react/src/modules/courses/Video/VideoIndex.js
@@ -148,12 +148,13 @@ class VideoIndex extends Component{
this.checkType("live",1);
}
//直播设置弹框
- setliveVisibel=(flag)=>{
+ setliveVisibel=(flag,changetypeFlag)=>{
this.setState({
- liveVisible:flag,
- type:"live"
+ liveVisible:flag
})
- this.checkType("live",1);
+ if(changetypeFlag){
+ this.checkType("live",1);
+ }
}
render(){
const { videos , upload , videoData , type , liveData , lives , liveVisible , isSpining } = this.state;
diff --git a/public/react/src/modules/courses/Video/video.css b/public/react/src/modules/courses/Video/video.css
index 0163d072b..e6186b640 100644
--- a/public/react/src/modules/courses/Video/video.css
+++ b/public/react/src/modules/courses/Video/video.css
@@ -119,8 +119,21 @@
}
.liveModal .ant-modal-body{
- padding:10px 20px 20px 20px;
+ padding:20px;
}
.liveModal .ant-modal-body .task-popup-content{
padding:0px;
+}
+.liveModal .ant-row.ant-form-item{
+ position: relative;
+ margin-bottom: 20px;
+}
+.liveModal .ant-form-explain{
+ position: absolute;
+ bottom: -18px;
+ left: 0px;
+}
+.liveModal .ant-col.ant-form-item-label{
+ height: 30px;
+ line-height: 30px;
}
\ No newline at end of file