From ae23a705d67fe510b6884ce95c84e943192a7853 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Fri, 14 Feb 2020 10:42:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/Video/Live.js | 2 +- .../src/modules/courses/Video/LiveItem.js | 55 ++++++++++++++++--- .../src/modules/courses/Video/LiveNew.js | 22 ++++++-- .../react/src/modules/courses/Video/video.css | 11 ++++ 4 files changed, 76 insertions(+), 14 deletions(-) diff --git a/public/react/src/modules/courses/Video/Live.js b/public/react/src/modules/courses/Video/Live.js index c077a4fa7..5a808633f 100644 --- a/public/react/src/modules/courses/Video/Live.js +++ b/public/react/src/modules/courses/Video/Live.js @@ -37,7 +37,7 @@ class Live extends Component{ (简明手册)
  • - + (简明手册) diff --git a/public/react/src/modules/courses/Video/LiveItem.js b/public/react/src/modules/courses/Video/LiveItem.js index 85cc05bc0..405cdfaf2 100644 --- a/public/react/src/modules/courses/Video/LiveItem.js +++ b/public/react/src/modules/courses/Video/LiveItem.js @@ -4,6 +4,13 @@ import { Modal } from 'antd'; import { WordsBtn } from 'educoder'; import axios from 'axios'; +// 点击按钮复制功能 +function jsCopy(props){ + var e = document.getElementById("copy_meet_content"); + e.select(); + document.execCommand("Copy"); + props.showNotification("复制成功!"); +} class LiveItem extends Component{ constructor(props) { super(props); @@ -48,6 +55,9 @@ class LiveItem extends Component{ render(){ const { key, item , setLiveId } = this.props; const { visible } = this.state; + + const wei_flag = item.platform && (item.platform === "威佰通"); + console.log(wei_flag && item.url); return(
    -
    -

    直播链接失效

    -
    -
    - 知道了 -
    + { + wei_flag && item.url ? + +
    +

    打开威佰通客户端,输入会议号即可进入直播

    +
    +

    + 会议号: + + jsCopy(this.props)}>复制会议号 +

    +
    +
    +
    + 取消 + 完成 +
    +
    + : + +
    +

    {wei_flag ? "当前直播无会议号":"直播链接失效"}

    +
    +
    + 知道了 +
    +
    + }
    { visible ? @@ -96,7 +128,14 @@ class LiveItem extends Component{ { item.url ? - 进入 + + { + wei_flag ? + 进入 + : + 进入 + } + : 进入 } @@ -111,7 +150,7 @@ class LiveItem extends Component{ { item.platform && 直播平台:{item.platform} } { item.live_time && 开播时间:{item.live_time}} - { item.duration && 直播时长:{item.duration} } + { item.duration && 直播时长:{item.duration}分钟 } { diff --git a/public/react/src/modules/courses/Video/LiveNew.js b/public/react/src/modules/courses/Video/LiveNew.js index 7c9b3f672..9be7707fd 100644 --- a/public/react/src/modules/courses/Video/LiveNew.js +++ b/public/react/src/modules/courses/Video/LiveNew.js @@ -35,6 +35,7 @@ class LiveNew extends Component{ this.state={ isSpining:false, beginTime:undefined, + wei_flag:undefined } } @@ -66,7 +67,8 @@ class LiveNew extends Component{ course_name:result.data.course_name }) this.setState({ - beginTime:result.data.live_time && moment(result.data.live_time,"YYYY-MM-DD HH:mm") + beginTime:result.data.live_time && moment(result.data.live_time,"YYYY-MM-DD HH:mm"), + wei_flag:result.data.platform && result.data.platform === "威佰通" }) } }) @@ -167,7 +169,8 @@ class LiveNew extends Component{ duration:undefined }) this.setState({ - beginTime:undefined + beginTime:undefined, + wei_flag:false }) } @@ -177,8 +180,16 @@ class LiveNew extends Component{ }) } + ChangePlatform=(e)=>{ + if(e === "威佰通"){ + this.setState({ + wei_flag:true + }) + } + } + render(){ - const { isSpining , beginTime } = this.state; + const { isSpining , beginTime , wei_flag } = this.state; const {getFieldDecorator} = this.props.form; const { visible } = this.props; @@ -212,16 +223,17 @@ class LiveNew extends Component{ })( )} - + {getFieldDecorator('url', { rules: [], })( - + )}
    diff --git a/public/react/src/modules/courses/Video/video.css b/public/react/src/modules/courses/Video/video.css index 0fd666544..7f1528bef 100644 --- a/public/react/src/modules/courses/Video/video.css +++ b/public/react/src/modules/courses/Video/video.css @@ -165,4 +165,15 @@ margin-right: 50px; display: flex; align-items: center; +} +.showNumber{ + border:none; +} +.wei_meet{ + display: flex; + margin:20px auto; + align-items: center; +} +.wei_meet_info{ + margin:0px auto; } \ No newline at end of file