Merge branch 'dev_aliyun' into develop

Adjustreact
daiao 5 years ago
commit 3c411cb06c

@ -0,0 +1,14 @@
class AddIndexToUserIdAndShixunIdForShixuns < ActiveRecord::Migration[5.2]
def change
shixun_members = ShixunMember.select("count(*) cnt, shixun_members.*").group(:user_id, :shixun_id).having("cnt > 1")
puts "shixun_members: #{shixun_members.map{|sm| sm.id}}"
shixun_members.each do |sm|
s = ShixunMember.where.not(id: sm.id).where(user_id: sm.user_id, shixun_id: sm.shixun_id)
puts "s: #{s.map{|sm| sm.id}}"
s.delete_all
end
add_index :shixun_members, [:user_id, :shixun_id], unique: true
end
end

@ -47,8 +47,7 @@ namespace :subjects do
subjects = subjects.where(id:ENV['subject_id'])
end
subjects.find_in_batches(batch_size: 20) do |s|
str = []
Parallel.each(s, in_processes: 6) do |subject|
Parallel.each_with_index(s, in_processes: 4) do |subject, index, str = []|
puts("---------------------course_info_statistic: #{subject.id}")
Rails.logger.info("---------------------course_info_statistic: #{subject.id}")
data = Subjects::CourseUsedInfoService.call(subject)

@ -37,7 +37,7 @@ class Live extends Component{
<a href="https://www.douyu.com/special/guide/anchor" target="_blank" className="color-blue ml20">(简明手册)</a>
</li>
<li>
<a href="https://lenovo325000.d17.cc/" target="_blank"><img alt="" src={WeiBaiTong} className="mr8" width="28px"/>
<a href="https://vbconsole.zznode.com/download" target="_blank"><img alt="" src={WeiBaiTong} className="mr8" width="28px"/>
<label className="color-grey-3 pointer">威佰通</label>
</a>
<a href="https://www.educoder.net/forums/3734" target="_blank" className="color-blue ml20">(简明手册)</a>

@ -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(
<div className="liveItem" key={key}>
<Modal
@ -58,12 +68,34 @@ class LiveItem extends Component{
keyboard={false}
centered={true}
>
<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>
{
wei_flag && item.url ?
<React.Fragment>
<div className="task-popup-content edu-txt-center">
<p className="font-16">打开威佰通客户端输入会议号即可进入直播</p>
<div className="wei_meet">
<p className="wei_meet_info">
<span>会议号</span>
<input value={item.url} className="showNumber" readOnly id="copy_meet_content"/>
<a className="color-blue ml50" onClick={()=>jsCopy(this.props)}>复制会议号</a>
</p>
</div>
</div>
<div className="task-popup-submit clearfix edu-txt-center">
<a className="task-btn fl" onClick={this.onDialogOkBtnClick}>取消</a >
<a className="task-btn task-btn-orange fr" onClick={this.onDialogOkBtnClick}>完成</a >
</div>
</React.Fragment>
:
<React.Fragment>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">{wei_flag ? "当前直播无会议号":"直播链接失效"}</p >
</div>
<div className="task-popup-submit clearfix edu-txt-center">
<a className="task-btn task-btn-orange mr51" onClick={this.onDialogOkBtnClick}>知道了</a >
</div>
</React.Fragment>
}
</Modal>
{
visible ?
@ -96,7 +128,14 @@ class LiveItem extends Component{
<React.Fragment>
{
item.url ?
<a className="btns going" target="_blank" href={`${item.url}`}>进入</a>
<React.Fragment>
{
wei_flag ?
<a className="btns going" onClick={this.alertInfo}>进入</a>
:
<a className="btns going" target="_blank" href={`${item.url}`}>进入</a>
}
</React.Fragment>
:
<a className="btns going" onClick={this.alertInfo}>进入</a>
}
@ -111,7 +150,7 @@ class LiveItem extends Component{
<label className="mr50">{item.author_name}</label>
{ item.platform && <span className="mr50">直播平台{item.platform}</span> }
{ item.live_time && <span className="mr50">开播时间{item.live_time}</span>}
{ item.duration && <span className="mr50">直播时长{item.duration}</span> }
{ item.duration && <span className="mr50">直播时长{item.duration}分钟</span> }
</span>
<span>
{

@ -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,20 @@ class LiveNew extends Component{
})
}
ChangePlatform=(e)=>{
if(e === "威佰通"){
this.setState({
wei_flag:true
})
}else{
this.setState({
wei_flag:false
})
}
}
render(){
const { isSpining , beginTime } = this.state;
const { isSpining , beginTime , wei_flag } = this.state;
const {getFieldDecorator} = this.props.form;
const { visible } = this.props;
@ -212,16 +227,17 @@ class LiveNew extends Component{
})(
<AutoComplete
placeholder="请选择或输入直播平台名称"
onChange={this.ChangePlatform}
dataSource={dataSource}
>
</AutoComplete>
)}
</Form.Item>
<Form.Item label={`直播链接`}>
<Form.Item label={wei_flag?`会议号`:`直播链接`}>
{getFieldDecorator('url', {
rules: [],
})(
<Input placeholder="请输入第三方直播链接,如:腾讯课堂播放链接等。" />
<Input placeholder={wei_flag?`请输入会议号`:"请输入第三方直播链接,如:腾讯课堂播放链接等。"} />
)}
</Form.Item>
<div className="flex-bottom">

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