|
|
|
@ -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(
|
|
|
|
|
<Modal
|
|
|
|
|
visible={visible}
|
|
|
|
@ -54,20 +64,22 @@ class LiveNew extends Component{
|
|
|
|
|
<Input placeholder="请输入第三方直播链接,如:腾讯课堂播放链接等。" />
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item label={`直播说明`} style={{marginBottom:"0px"}}>
|
|
|
|
|
<Form.Item label={`直播说明`}>
|
|
|
|
|
{getFieldDecorator('description', {
|
|
|
|
|
rules: [],
|
|
|
|
|
rules: [{
|
|
|
|
|
validator: this.validateDesc,
|
|
|
|
|
}],
|
|
|
|
|
})(
|
|
|
|
|
<TextArea rows={4} placeholder="可在此介绍开播具体事项,如开播时间安排等。" />
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<p className="flex-middle" style={{justifyContent:"space-between"}}>
|
|
|
|
|
<span>EduCoder推荐您使用<a href="https://ke.qq.com/" target="_blank" className="color-blue">腾讯课堂</a>进行直播</span>
|
|
|
|
|
<a href="https://pub.idqqimg.com/pc/misc/files/20200204/2e4cb765bef54f0c919c0ab8ab79d969.pdf" target="_blank" className="color-blue">下载操作指引</a>
|
|
|
|
|
<a href="https://pub.idqqimg.com/pc/misc/files/20200204/2e4cb765bef54f0c919c0ab8ab79d969.pdf" target="_blank" className="color-blue">操作指引</a>
|
|
|
|
|
</p>
|
|
|
|
|
</Form>
|
|
|
|
|
<div className="clearfix mt30 edu-txt-center">
|
|
|
|
|
<a onClick={()=>setliveVisibel(false)} className="task-btn mr30">取消</a>
|
|
|
|
|
<a onClick={this.cancelNew} className="task-btn mr30">取消</a>
|
|
|
|
|
<a type="submit" onClick={this.handleSubmit} className="task-btn task-btn-orange">确定</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|