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, + }], })(