dev_video
caicai8 5 years ago
parent b87d675246
commit 22d1dfabcd

@ -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 operation = admin || business || (is_teacher && this.props.checkIfProfessionalCertification())
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(
<div className="livePanel">
{

@ -36,7 +36,7 @@ class LiveItem extends Component{
</div>
<div className="lineMiddle mt15">
<div className="liveDesc">
<p><span className="task-hide-2">{item.description}</span></p>
<p><span className="task-hide-2 break_word">{item.description}</span></p>
</div>
{
item.on_status?

@ -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>

@ -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;

@ -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;
}
Loading…
Cancel
Save