弹框提示

Adjustreact
caicai8 5 years ago
parent 7c3dc6e023
commit 384d363482

@ -1,11 +1,16 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { getImageUrl } from 'educoder'; import { getImageUrl } from 'educoder';
import { Modal } from 'antd';
import { WordsBtn } from 'educoder'; import { WordsBtn } from 'educoder';
import moment from 'moment';
import axios from 'axios'; import axios from 'axios';
class LiveItem extends Component{ class LiveItem extends Component{
constructor(props) {
super(props);
this.state = {
visible:false
}
}
deleteLive=(id)=>{ deleteLive=(id)=>{
this.props.confirm({ this.props.confirm({
@ -27,12 +32,55 @@ class LiveItem extends Component{
console.log('Cancel'); console.log('Cancel');
}, },
}); });
}
alertInfo=()=>{
console.log("dddd");
this.setState({
visible:true
})
}
onDialogOkBtnClick=()=>{
this.setState({
visible:false,
})
} }
render(){ render(){
const { key, item , setLiveId } = this.props; const { key, item , setLiveId } = this.props;
const { visible } = this.state;
console.log(visible);
return( return(
<div className="liveItem" key={key}> <div className="liveItem" key={key}>
<Modal
title="提示"
visible={visible}
closable={false}
footer={null}
keyboard={false}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">直播链接失效</p >
</div>
<div className="task-popup-submit clearfix edu-txt-center">
<a className="task-btn task-btn-orange mr51" onClick={this.onDialogOkBtnClick}>知道了</a >
</div>
</Modal>
{
visible ?
<style>{
`
body{
width: calc(100% - 7px)!important;
overflow: hidden!important;
}
.-task-sidebar{
right:44px!important
}
`}
</style>
:
""
}
<div className="lineMiddle livesMain"> <div className="lineMiddle livesMain">
<span className="lineMiddle"> <span className="lineMiddle">
<span className="font-18 task-hide" style={{maxWidth:"759px"}}>{item.course_name}</span> <span className="font-18 task-hide" style={{maxWidth:"759px"}}>{item.course_name}</span>
@ -44,11 +92,20 @@ class LiveItem extends Component{
<p><span className="task-hide-2 break_word">{item.description}</span></p> <p><span className="task-hide-2 break_word">{item.description}</span></p>
</div> </div>
{ {
(item.on_status && item.url)? item.on_status ?
<a className="btns going" target="_blank" href={`${item.url}`}>进入</a> <React.Fragment>
{
item.url ?
<a className="btns going" target="_blank" href={`${item.url}`}>进入</a>
:
<a className="btns going" onClick={this.alertInfo}>进入</a>
}
</React.Fragment>
: :
<span className="btns ect">进入</span> <span className="btns ect">进入</span>
} }
<a className="btns going" onClick={this.alertInfo}>进入</a>
</div> </div>
<p className="lineMiddle livesMain mt15 font-12"> <p className="lineMiddle livesMain mt15 font-12">
<span className="lineMiddle color-grey-9"> <span className="lineMiddle color-grey-9">

@ -9,7 +9,8 @@ import axios from 'axios';
const { TextArea } = Input; const { TextArea } = Input;
const { Option } = Select; const { Option } = Select;
const array=['腾讯课堂','B站','斗鱼','威佰通'] // ,'威佰通'
const array=['腾讯课堂','B站','斗鱼'];
function range(start, end) { function range(start, end) {
const result = []; const result = [];

Loading…
Cancel
Save