Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hs
hjm 5 years ago
commit 89da7bc483

@ -451,7 +451,7 @@ class ApplicationController < ActionController::Base
cpu_limit = config.cpu_limit.presence || 1
cpu_request = config.lower_cpu_limit.presence || 0.1
memory_limit = config.memory_limit.presence || 1024
request_limit = config.resource_limit.presence || 10
request_limit = config.request_limit.presence || 10
resource_limit = config.resource_limit.presence || 10000
container << {:image => mirror.name,
:cpuLimit => cpu_limit,

@ -41,7 +41,6 @@ class CoursesController < ApplicationController
before_action :find_board, only: :board_list
before_action :validate_page_size, only: :mine
before_action :course_tasks, only: [:tasks_list, :update_task_position]
before_action :find_container, only: [:update_task_position]
if RUBY_PLATFORM =~ /linux/
require 'simple_xlsx_reader'
@ -62,6 +61,9 @@ class CoursesController < ApplicationController
@courses = Course.where(is_delete: 0, is_hidden: 0, is_end: 0)
end
# 金课未开课的不显示在首页
@courses = @courses.where("start_date is null or start_date <= '#{Date.today}'")
# 根据搜索关键字进一步筛选
if params[:search].present?
# REDO:Extension
@ -1150,17 +1152,20 @@ class CoursesController < ApplicationController
end
def update_task_position
tip_exception("缺少position参数") if params[:position].blank?
unless params[:position].to_i == @task.position
if params[:position].to_i < @task.position
@tasks.where("position < #{@task.position} and position >= ?", params[:position]).update_all("position = position + 1")
else
@tasks.where("position > #{@task.position} and position <= ?", params[:position]).update_all("position = position - 1")
Rails.logger.info("#######task_ids_length#{params[:task_ids].uniq.length}#########task_count:#{@tasks.count}")
tip_exception("task_ids参数有误") if params[:task_ids].blank? || params[:task_ids].uniq.length != @tasks.count
ActiveRecord::Base.transaction do
begin
@tasks.each do |task|
position = params[:task_ids].reverse.index(task.id).to_i + 1
task.update_attributes!(position: position)
end
normal_status(0, "移动成功")
rescue Exception => e
uid_logger(e.message)
tip_exception(e.message)
raise ActiveRecord::Rollback
end
@task.update_attributes(position: params[:position])
normal_status(0, "移动成功")
else
normal_status(-1, "位置没有变化")
end
end
@ -1199,8 +1204,8 @@ class CoursesController < ApplicationController
def validate_start_end_date
prev_course = @subject.courses.where("id < #{@course.id}").last
next_course = @subject.courses.where("id > #{@course.id}").first
tip_exception("开始时间和结束时间不能与其他期开课时间重叠") if prev_course && params[:start_date] <= strf_date(prev_course.end_date)
tip_exception("开始时间和结束时间不能与其他期开课时间重叠") if next_course && params[:end_date] >= strf_date(next_course.start_date)
tip_exception("开始时间不能与往期开课时间重叠") if prev_course && params[:start_date] <= strf_date(prev_course.end_date)
tip_exception("结束时间不能与后期开课时间重叠") if next_course && params[:end_date] >= strf_date(next_course.start_date)
end
# 超级管理员和课堂管理员的权限判断
@ -1247,24 +1252,24 @@ class CoursesController < ApplicationController
end
end
def find_container
case params[:container_type]
when 'shixun_homework', 'common_homework', 'group_homework'
@task = HomeworkCommon.find_by(id: params[:container_id])
when 'exercise'
@task = Exercise.find_by(id: params[:container_id])
when 'poll'
@task = Poll.find_by(id: params[:container_id])
when 'graduation_topic'
@task = GraduationTopic.find_by(id: params[:container_id])
when 'graduation_task'
@task = GraduationTask.find_by(id: params[:container_id])
when 'attachment'
@task = Attachment.find_by(id: params[:container_id])
else
tip_exception("container_type参数有误")
end
end
# def find_container
# case params[:container_type]
# when 'shixun_homework', 'common_homework', 'group_homework'
# @task = HomeworkCommon.find_by(id: params[:container_id])
# when 'exercise'
# @task = Exercise.find_by(id: params[:container_id])
# when 'poll'
# @task = Poll.find_by(id: params[:container_id])
# when 'graduation_topic'
# @task = GraduationTopic.find_by(id: params[:container_id])
# when 'graduation_task'
# @task = GraduationTask.find_by(id: params[:container_id])
# when 'attachment'
# @task = Attachment.find_by(id: params[:container_id])
# else
# tip_exception("container_type参数有误")
# end
# end
def student_act_score group_id, search
sql_select = %Q{SELECT cm.*,(

@ -9,6 +9,7 @@ class HomeworksService
homework_detail_manual = HomeworkDetailManual.new
homework.homework_detail_manual = homework_detail_manual
homework.position = course.practice_homeworks.first&.position.to_i + 1
if homework.save!
homework_detail_manual.save! if homework_detail_manual

@ -1,13 +1,5 @@
class MigrateCourseTaskPosition < ActiveRecord::Migration[5.2]
def change
add_column :homework_commons, :position, :integer, :default => 0
Course.find_each do |course|
puts course.id
course.practice_homeworks.order("IF(ISNULL(homework_commons.publish_time),0,1), homework_commons.publish_time DESC,
homework_commons.created_at DESC").reverse.each_with_index do |homework, index|
homework.update_columns(position: index + 1)
end
end
end
end

@ -0,0 +1,11 @@
class MigrateCourseShixunHomeworkPosition < ActiveRecord::Migration[5.2]
def change
Course.find_each do |course|
puts course.id
course.practice_homeworks.order("IF(ISNULL(homework_commons.publish_time),0,1), homework_commons.publish_time DESC,
homework_commons.created_at DESC").reverse.each_with_index do |homework, index|
homework.update_columns(position: index + 1)
end
end
end
end

@ -19,7 +19,6 @@ import Trialapplicationysl from './modules/login/Trialapplicationysl';
import Trialapplicationreview from './modules/user/Trialapplicationreview';
import Addcourses from "./modules/courses/coursesPublic/Addcourses";
import AccountProfile from "./modules/user/AccountProfile";
import Certifiedprofessional from "./modules/modals/Certifiedprofessional"
import Trialapplication from './modules/login/Trialapplication'
import NotFoundPage from './NotFoundPage'
@ -306,7 +305,7 @@ class App extends Component {
<Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview>
<Addcourses {...this.props} {...this.state}/>
<AccountProfile {...this.props} {...this.state}/>
<Certifiedprofessional {...this.props} {...this.state}/>
{/*<Certifiedprofessional {...this.props} {...this.state}/>*/}
<Router>
<Switch>

@ -307,11 +307,15 @@ class CommonWorkDetailIndex extends Component{
onClick={() => this.setState({moduleName: '参考答案'})}
className={`${childModuleName == '参考答案' ? 'active' : '' } `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案</Link>}
{this.props.isAdmin() ?
<Link
onClick={() => this.setState({moduleName: '设置'})}
className={`${childModuleName == '设置' ? 'active' : '' } `}
style={{paddingLeft:'38px'}}
to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>设置</Link>
to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>设置</Link>:
""
}
{/* { this.props.tabRightComponents } */}

@ -144,10 +144,13 @@ class WorkDetailPageHeader extends Component{
{view_answer == true && <Link
className={`${childModuleName == '参考答案' ? 'active' : '' } `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案</Link>}
{this.props.isAdmin()?
<Link
className={`${childModuleName == '设置' ? 'active' : '' } `}
style={{paddingLeft:'38px'}}
to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>设置</Link>
to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>设置</Link>:
""
}
{ this.props.tabRightComponents }

@ -12,6 +12,7 @@ import Guide from './CoursesGuide';
import AddStudentModal from '../members/modal/AddStudentModal'
import AddTeacherModal from '../members/modal/AddTeacherModal'
import Jointheclass from '../../modals/Jointheclass'
import Certifiedprofessional from "../../modals/Certifiedprofessional";
// 点击按钮复制功能
// function jsCopy(){
// var e = document.getElementById("copy_invite_code");
@ -48,6 +49,8 @@ class CoursesBanner extends Component {
is_guide:false,
excellent:false,//是否是精品课堂
yslJointhe:false,
mydisplay:false
}
}
componentDidMount() {
@ -58,9 +61,22 @@ class CoursesBanner extends Component {
componentWillUnmount() {
off('updatabanner', this.updatabanner)
}
onloadupdatabanner=()=>{
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
Addcoursestypes:false,
mydisplay:true,
occupation:i,
})
};
ModalCancelsy=()=>{
this.setState({
mydisplay:false,
})
};
onloadupdatabanner=()=>{
this.updatabanner()
}
updatabanner=()=>{
@ -413,7 +429,9 @@ class CoursesBanner extends Component {
{Addcoursestypes === true ? <Addcourses
Addcoursestype={Addcoursestypes}
hideAddcoursestype={() => this.tojoinclass(2)}
HideAddcoursestypess={(i)=>this.HideAddcoursestypess(i)}
/> : ""}
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.ModalCancelsy} />
<Modals
modalsType={modalsType}
modalsTopval={modalsTopval}
@ -500,7 +518,32 @@ class CoursesBanner extends Component {
</div>
{excellent===false?
{/*{excellent===false?*/}
{/* :*/}
{/* <div>*/}
{/* <style>*/}
{/* {*/}
{/* `*/}
{/* .user_white_btn{border: 1px solid #ffffff;color: #ffffff!important;}*/}
{/* */}
{/* `*/}
{/* }*/}
{/* </style>*/}
{/* /!*coursedata.course_identity === 6 是非课堂成员*!/*/}
{/* {coursedata.course_identity === 6&&coursedata.educoder_teacher===false?*/}
{/* <a className="fr user_default_btn user_white_btn mr20 font-18" style={{width:"130px"}}*/}
{/* onClick={() => this.myyslgradin()}>加入课堂</a>: ""}*/}
{/* {coursedata.course_identity === 6&&coursedata.educoder_teacher===true?*/}
{/* <a className="fr user_default_btn user_white_btn mr20 font-18" style={{width:"130px"}}*/}
{/* onClick={() => this.myyslgradin()}>加入课堂</a>: ""}*/}
{/* /!*{this.props.isStudent()?<a className="fr user_default_btn user_blue_btn mr20 font-18"*!/*/}
{/* /!* onClick={() => this.exitclass()}*!/*/}
{/* /!*> 退出课堂 </a>:""}*!/*/}
{/* </div>*/}
{/*}*/}
<div>
{coursedata.switch_to_student === true ?
<Tooltip placement="bottom" title={
@ -548,31 +591,7 @@ class CoursesBanner extends Component {
> 退出课堂 </a>:""}
</div>
:
<div>
<style>
{
`
.user_white_btn{border: 1px solid #ffffff;color: #ffffff!important;}
`
}
</style>
{/*coursedata.course_identity === 6 是非课堂成员*/}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===false?
<a className="fr user_default_btn user_white_btn mr20 font-18" style={{width:"130px"}}
onClick={() => this.myyslgradin()}>加入课堂</a>: ""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a className="fr user_default_btn user_white_btn mr20 font-18" style={{width:"130px"}}
onClick={() => this.myyslgradin()}>加入课堂</a>: ""}
{/*{this.props.isStudent()?<a className="fr user_default_btn user_blue_btn mr20 font-18"*/}
{/* onClick={() => this.exitclass()}*/}
{/*> 退出课堂 </a>:""}*/}
</div>
}
<style>
{

@ -34,6 +34,7 @@ class Addcourses extends Component{
this.setState({
Addcoursestypes: true
})
return
}
return response;
@ -213,25 +214,42 @@ class Addcourses extends Component{
student:student
}
).then((response) => {
console.log("submittojoinclass");
console.log(response);
if(response === undefined){
this.setState({
// Addcoursestype:false,
isSpin:false
});
// try {
// this.props.HideAddcoursestypess(3);
// }catch (e) {
//
// }
return
}
if(response.data.status===-2){
this.setState({
Addcoursestype:false,
isSpin:false
});
try {
if(response.data.message==="该课堂要求成员完成实名认证"){
this.props.HideAddcoursestypess(1);
}
if(response.data.message==="该课堂要求成员完成职业认证"){
this.props.HideAddcoursestypess(2);
}
if(response.data.message==="该课堂要求成员完成实名和职业认证"){
this.props.HideAddcoursestypess(3);
}
}catch (e) {
this.props.showNotification(response.data.message);
}
return;
}
if(response.data.status===0){
// course_id: 1545
// message: "成功"
// status: 0
// this.setState({
// // loadtype:true,
// // modalsType:true,
// // modalsTopval:response.data.message,
// // modalSave:this.submitasyn,
// course_id:response.data.course_id
// })
// https://www.trustie.net/issues/22365
if (response.data.course_id == 2704) {
this.props.history.push('/courses/2704/boards/8367/messages/42072')
@ -263,14 +281,6 @@ class Addcourses extends Component{
this.props.hideAddcoursestype();
}
// this.setState({
// loadtype:true,
// modalsType:true,
// modalsTopval:response.data.message,
// modalSave:this.submitasyn,
// course_id:undefined
// })
}
this.setState({
@ -285,52 +295,6 @@ class Addcourses extends Component{
});
})
// if(value===0){
// const form = new FormData();
// form.append('invite_code', tojoinclasstitle);
// form.append('role', pamst);
// form.append('type', 1);
// axios.post(url,form,[true]
// ).then((response) => {
// if( response.data.state===0){
// this.submitstatevalue(0,"加入成功",response.data.course_id)
// }else if( response.data.state===1){
// }else if( response.data.state===2){
// this.submitstatevalue( 0,"课堂已过期! 请联系课堂管理员重启课堂。(在配置课堂处)")
// }else if( response.data.state===3){
// this.submitstatevalue( 0,"您已是课堂成员)",response.data.course_id)
// }else if( response.data.state===4){
// this.submitstatevalue( 0,"您输入的邀请码错误)")
// }else if( response.data.state===5){
// this.submitstatevalue( 0,"您还未登录")
// }else if( response.data.state===6){
// this.submitstatevalue( 0,"申请已提交,请等待审核")
// }else if( response.data.state===7){
// this.submitstatevalue( 0," 您已经发送过申请了,请耐心等待")
// }else if( response.data.state===8){
// this.submitstatevalue( 0,"您已经是该课堂的教师了",response.data.course_id)
// }else if( response.data.state==9){
// this.submitstatevalue( 0,"您已经是该课堂的教辅了",response.data.course_id)
// }else if( response.data.state==10){
// this.submitstatevalue(0,"您已经是该课堂的管理员了",response.data.course_id)
// }else if( response.data.state==11){
// this.submitstatevalue(0," 该课堂已归档,请联系老师")
// }else if( response.data.state==12){
// this.submitstatevalue(0,"您已经发送过申请了,请耐心等待师")
// }else if( response.data.state==13){
// this.submitstatevalue(0,"您申请已提交,请等待审核")
// }else if( response.data.state==14){
// this.submitstatevalue("此邀请码已停用,请与老师联系")
// }else if( response.data.state==15){
// this.submitstatevalue(0,"您已是课堂成员! 加入分班请在课堂具体分班页面进行")
// }else {
// this.submitstatevalue(0," 未知错误,请稍后再试")
// }
// })
//
// }
}
render(){

@ -43,9 +43,11 @@ class CoursesNew extends Component {
listvalue: undefined,
fetching:false,
boolxinjian:false,
checkboxgroup:undefined,
checkbofrup:["shixun_homework","common_homework","group_homework","exercise","attachment","course_group","graduation","poll","board"],
checkbofrups:[],
}
}
componentDidMount() {
@ -76,7 +78,32 @@ class CoursesNew extends Component {
is_public: data.is_public === 1 ? true : false,
Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification,
})
});
try {
var datasysl=[];
var dataysl2=[];
var dataysl3=[];
var checkbofrup =this.state.checkbofrup;
dataysl2=data.course_module_types;
datasysl=checkbofrup;
for (var k=0;k<datasysl.length;k++){
for (var i=0;i<data.course_module_types.length;i++){
if(datasysl[k]===data.course_module_type[i]){
datasysl.slice(k,1);
}
}
}
dataysl3 = dataysl2.concat(datasysl);
this.setState({
checkboxgroup: dataysl3,
})
}catch (e) {
this.setState({
checkboxgroup:this.state.checkbofrup,
})
}
this.handleSearchschool(data.school);
}).catch((error) => {
console.log(error);
@ -442,7 +469,7 @@ class CoursesNew extends Component {
this.applyForAddOrgForm.setVisible(true)
}
render() {
let {datatime,school,searchlistscholl} = this.state;
let {datatime,school,searchlistscholl,checkboxgroup} = this.state;
const {getFieldDecorator} = this.props.form;
const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form
@ -669,17 +696,49 @@ class CoursesNew extends Component {
"shixun_homework", "common_homework", "group_homework", "exercise", "attachment", "course_group",
],
})(
this.props.match.params.coursesId != undefined?
<Checkbox.Group style={{width: "800px", marginTop: "10px"}}>
<Checkbox value={"shixun_homework"} className="fl">实训作业</Checkbox>
<Checkbox value={"common_homework"} className="fl">普通作业</Checkbox>
<Checkbox value={"group_homework"} className="fl">分组作业</Checkbox>
<Checkbox value={"exercise"} className="fl">试卷</Checkbox>
<Checkbox value={"attachment"} className="fl">资源</Checkbox>
<Checkbox value={"course_group"} className="fl">分班</Checkbox>
<Checkbox value={"graduation"} className="fl">毕业设计</Checkbox>
<Checkbox value={"poll"} className="fl">问卷</Checkbox>
<Checkbox value={"board"} className="fl">讨论</Checkbox>
{
checkboxgroup===undefined?"":checkboxgroup.length===0?"":checkboxgroup.map((item,key)=>{
return(
item ==="shixun_homework"?
<Checkbox value={"shixun_homework"} className="fl">实训作业</Checkbox>
:item ==="common_homework"?
<Checkbox value={"common_homework"} className="fl">普通作业</Checkbox>
:item ==="group_homework"?
<Checkbox value={"group_homework"} className="fl">分组作业</Checkbox>
:item ==="exercise"?
<Checkbox value={"exercise"} className="fl">试卷</Checkbox>
:item ==="attachment"?
<Checkbox value={"attachment"} className="fl">资源</Checkbox>
:item ==="course_group"?
<Checkbox value={"course_group"} className="fl">分班</Checkbox>
:item ==="graduation"?
<Checkbox value={"graduation"} className="fl">毕业设计</Checkbox>
:item ==="poll"?
<Checkbox value={"poll"} className="fl">问卷</Checkbox>
:item ==="board"?
<Checkbox value={"board"} className="fl">讨论</Checkbox>
:""
)
})
}
</Checkbox.Group>
:
<Checkbox.Group style={{width: "800px", marginTop: "10px"}}>
<Checkbox value={"shixun_homework"} className="fl">实训作业</Checkbox>
<Checkbox value={"common_homework"} className="fl">普通作业</Checkbox>
<Checkbox value={"group_homework"} className="fl">分组作业</Checkbox>
<Checkbox value={"exercise"} className="fl">试卷</Checkbox>
<Checkbox value={"attachment"} className="fl">资源</Checkbox>
<Checkbox value={"course_group"} className="fl">分班</Checkbox>
<Checkbox value={"graduation"} className="fl">毕业设计</Checkbox>
<Checkbox value={"poll"} className="fl">问卷</Checkbox>
<Checkbox value={"board"} className="fl">讨论</Checkbox>
</Checkbox.Group>
)}
</Form.Item>
</div>

@ -186,9 +186,10 @@ class ShixunHomeworkPage extends Component {
`
}</style>
:""}
{this.props.isAdmin() ?
<a className={parseInt(tab) === 3 ? "active" : ""}
onClick={(e) => this.ChangeTab(3)}
>设置</a>
>设置</a>:""}
{/*{this.props.isAdmin() ? <a*/}
{/* className="fr color-blue font-16"*/}
{/* href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xlsx`}*/}

@ -1313,28 +1313,28 @@ class Trainingjobsetting extends Component {
this.setState({
publish_time:moment(handleDateString(dateString))
})
if(this.state.allowreplenishment === true) {
this.setState({
end_time:moment(handleDateString(dateString)).add(1, 'months'),
deadline:moment(handleDateString(dateString)).add(1, 'months').format('YYYY-MM-DD HH:mm'),
late_time:moment(handleDateString(dateString)).add(2, 'months'),
late_times:moment(handleDateString(dateString)).add(2, 'months').format('YYYY-MM-DD HH:mm'),
});
try {
this.setState({
unit_e_tip: "",
p_flag: false,
borredss:undefined,
})
} catch (e) {
}
}else{
this.setState({
end_time:moment(handleDateString(dateString)).add(1, 'months'),
deadline:moment(handleDateString(dateString)).add(1, 'months').format('YYYY-MM-DD HH:mm'),
});
}
// if(this.state.allowreplenishment === true) {
// this.setState({
// end_time:moment(handleDateString(dateString)).add(1, 'months'),
// deadline:moment(handleDateString(dateString)).add(1, 'months').format('YYYY-MM-DD HH:mm'),
// late_time:moment(handleDateString(dateString)).add(2, 'months'),
// late_times:moment(handleDateString(dateString)).add(2, 'months').format('YYYY-MM-DD HH:mm'),
// });
// try {
// this.setState({
// unit_e_tip: "",
// p_flag: false,
// borredss:undefined,
// })
// } catch (e) {
//
// }
// }else{
// this.setState({
// end_time:moment(handleDateString(dateString)).add(1, 'months'),
// deadline:moment(handleDateString(dateString)).add(1, 'months').format('YYYY-MM-DD HH:mm'),
// });
// }
}
}

@ -477,6 +477,8 @@ class MessagSub extends Component{
return window.open(`/users/${this.props.current_user.login}/videos`);
}
return '';
case "PublicCourseStart":
return window.open(`/courses/${item.container_id}/informs`);
default :
return window.open("/")
}

@ -10,8 +10,8 @@ class Certifiedprofessional extends Component {
constructor(props) {
super(props);
this.state={
occupation:3,
mydisplay:false,
// occupation:3,
// mydisplay:false,
}
}
@ -21,37 +21,19 @@ class Certifiedprofessional extends Component {
}
componentDidMount() {
axios.interceptors.response.use((response) => {
if (response != undefined)
if (response && response.data.status === -1) {
if(response.data.message==="该课堂要求成员完成实名认证"){
this.setState({
mydisplay:true,
occupation:1,
})
}else if(response.data.message==="该课堂要求成员完成职业认证"){
this.setState({
mydisplay:true,
occupation:2,
})
}else if(response.data.message==="该课堂要求成员完成实名和职业认证"){
this.setState({
mydisplay:true,
occupation:3,
})
}
}
return response;
}, (error) => {
//TODO 这里如果样式变了会出现css不加载的情况
});
// axios.interceptors.response.use((response) => {
// if (response != undefined)
// if (response && response.data.status === -1) {
//
// }
// return response;
// }, (error) => {
// //TODO 这里如果样式变了会出现css不加载的情况
//
// });
}
modalCancel=()=>{
this.setState({
mydisplay:false,
})
this.props.ModalCancelsy();
};
setDownload=()=>{
@ -63,7 +45,7 @@ class Certifiedprofessional extends Component {
render() {
// console.log("加入金品课堂2");
// console.log(this.props);
let{occupation} =this.state;
let{occupation} =this.props;
return(
<Modal
keyboard={false}
@ -72,7 +54,7 @@ class Certifiedprofessional extends Component {
destroyOnClose={true}
title="因为以下原因,您暂时不能进行操作"
centered={true}
visible={this.state.mydisplay}
visible={this.props.mydisplay}
width="600px"
heigth="307px"
>

@ -3,6 +3,7 @@ import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Redirect } from 'react-router';
import AccountProfile from"../user/AccountProfile";
import PropTypes from 'prop-types';
import Certifiedprofessional from "../../modules/modals/Certifiedprofessional"
// import searchImg from '../../../../images/educoder/icon/search.svg'
@ -62,7 +63,9 @@ class NewHeader extends Component {
isRender:false,
showSearchOpentype:false,
showTrial:false,
setevaluatinghides:false
setevaluatinghides:false,
occupation:0,
mydisplay:false
}
// console.log("176")
// console.log(props);
@ -95,7 +98,29 @@ class NewHeader extends Component {
//获取游览器地址
window.sessionStorage.setItem("yslgeturls",JSON.stringify(window.location.href))
// axios.interceptors.response.use((response) => {
// if (response != undefined)
// if (response && response.data.status === -1) {
// if (response.data.message === "该课堂要求成员完成实名认证") {
//
// } else if (response.data.message === "该课堂要求成员完成职业认证") {
// console.log("该课堂要求成员完成职业认证");
// this.HideAddcoursestypess(2);
//
//
//
// return
// } else if (response.data.message === "该课堂要求成员完成实名和职业认证") {
// console.log("该课堂要求成员完成实名和职业认证");
// this.HideAddcoursestypess(3);
// return
//
// }
// }
// return response;
// }, (error) => {
//
// });
}
componentDidUpdate = (prevProps) => {
@ -326,7 +351,20 @@ class NewHeader extends Component {
this.setState({
Addcoursestypes:false
})
}
};
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
Addcoursestypes:false,
mydisplay:true,
occupation:i,
})
};
ModalCancelsy=()=>{
this.setState({
mydisplay:false,
})
};
hidetojoinclass=()=>{
@ -880,7 +918,10 @@ submittojoinclass=(value)=>{
{Addcoursestypes===true?<Addcourses
Addcoursestype={Addcoursestypes}
hideAddcoursestype={this.hideAddcoursestypes}
HideAddcoursestypess={(i)=>this.HideAddcoursestypess(i)}
/>:""}
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.ModalCancelsy}/>
{/* /courses/join_course_multi_role */}
<li>

Loading…
Cancel
Save