|
|
@ -1,25 +1,18 @@
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
|
|
|
|
import { Link } from "react-router-dom";
|
|
|
|
import { Redirect } from 'react-router';
|
|
|
|
|
|
|
|
import AccountProfile from "../user/AccountProfile";
|
|
|
|
import AccountProfile from "../user/AccountProfile";
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import Certifiedprofessional from "../../modules/modals/Certifiedprofessional"
|
|
|
|
import Certifiedprofessional from "../../modules/modals/Certifiedprofessional"
|
|
|
|
|
|
|
|
|
|
|
|
// import searchImg from '../../../../images/educoder/icon/search.svg'
|
|
|
|
import { getImageUrl } from 'educoder'
|
|
|
|
|
|
|
|
|
|
|
|
// /images/educoder/icon/search.svg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { getImageUrl, toPath ,trigger,broadcastChannelPostMessage} from 'educoder'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import axios from 'axios';
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
|
|
import { Modal,Checkbox ,Radio,Input,message,notification,Popover} from 'antd';
|
|
|
|
import { Modal, Radio, Input, message, notification } from 'antd';
|
|
|
|
|
|
|
|
|
|
|
|
import Addcourses from '../courses/coursesPublic/Addcourses';
|
|
|
|
import Addcourses from '../courses/coursesPublic/Addcourses';
|
|
|
|
|
|
|
|
|
|
|
|
import LoginDialog from '../login/LoginDialog';
|
|
|
|
import LoginDialog from '../login/LoginDialog';
|
|
|
|
|
|
|
|
|
|
|
|
import Trialapplication from '../login/Trialapplication';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import GotoQQgroup from '../../modal/GotoQQgroup'
|
|
|
|
import GotoQQgroup from '../../modal/GotoQQgroup'
|
|
|
|
|
|
|
|
|
|
|
@ -121,44 +114,6 @@ class NewHeader extends Component {
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 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) => {
|
|
|
|
|
|
|
|
// if(prevProps.user!=this.props.user){
|
|
|
|
|
|
|
|
// // console.log("216")
|
|
|
|
|
|
|
|
// // console.log(prevProps.user);
|
|
|
|
|
|
|
|
// // console.log(this.props.user);
|
|
|
|
|
|
|
|
// if(this.props.user !== undefined){
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
|
|
|
// user_phone_binded :this.props.user.user_phone_binded,
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
openNotification = (messge) => {
|
|
|
|
openNotification = (messge) => {
|
|
|
@ -204,9 +159,6 @@ class NewHeader extends Component {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
user: undefined
|
|
|
|
user: undefined
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// let path="/";
|
|
|
|
|
|
|
|
// this.props.history.push(path);
|
|
|
|
|
|
|
|
// broadcastChannelPostMessage('refreshPage')
|
|
|
|
|
|
|
|
window.location.href = "/login"
|
|
|
|
window.location.href = "/login"
|
|
|
|
message.success('退出成功');
|
|
|
|
message.success('退出成功');
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -341,38 +293,12 @@ class NewHeader extends Component {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
isRender: true
|
|
|
|
isRender: true
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// var url = `/accounts/logout.json`;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// axios.get((url)).then((result) => {
|
|
|
|
|
|
|
|
// if(result!==undefined){
|
|
|
|
|
|
|
|
// // this.setState({
|
|
|
|
|
|
|
|
// // isRender:true
|
|
|
|
|
|
|
|
// // })
|
|
|
|
|
|
|
|
// window.location.href = "/";
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }).catch((error) => {
|
|
|
|
|
|
|
|
// console.log(error);
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
educoderloginysl = () => {
|
|
|
|
educoderloginysl = () => {
|
|
|
|
//退出账号
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
|
|
|
// isRender:true
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// let newTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'
|
|
|
|
|
|
|
|
// let shixunopenprocess=this.props.user&&this.props.user.user_id+'shixunopenprocess'
|
|
|
|
|
|
|
|
// let openopenpublictype=this.props.user&&this.props.user.user_id+'openopenpublictype'
|
|
|
|
|
|
|
|
var url = `/accounts/logout.json`;
|
|
|
|
var url = `/accounts/logout.json`;
|
|
|
|
// let storage=window.localStorage;
|
|
|
|
|
|
|
|
axios.get((url)).then((result) => {
|
|
|
|
axios.get((url)).then((result) => {
|
|
|
|
// storage.removeItem(newTPMsettings);
|
|
|
|
|
|
|
|
// storage.removeItem(shixunopenprocess);
|
|
|
|
|
|
|
|
// storage.removeItem( openopenpublictype);
|
|
|
|
|
|
|
|
if (result !== undefined) {
|
|
|
|
if (result !== undefined) {
|
|
|
|
// this.setState({
|
|
|
|
|
|
|
|
// isRender:true
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// broadcastChannelPostMessage('refreshPage')
|
|
|
|
|
|
|
|
window.location.href = "/";
|
|
|
|
window.location.href = "/";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch((error) => {
|
|
|
|
}).catch((error) => {
|
|
|
@ -477,58 +403,9 @@ submittojoinclass=(value)=>{
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// if(value===0){
|
|
|
|
|
|
|
|
// let url="/courses/join_course_multi_role.json"
|
|
|
|
|
|
|
|
// 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," 未知错误,请稍后再试")
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (value === 1) {
|
|
|
|
if (value === 1) {
|
|
|
|
let url = "/project_applies.json"
|
|
|
|
let url = "/project_applies.json"
|
|
|
|
// const form = new FormData();
|
|
|
|
|
|
|
|
// form.append('code', tojoinclasstitle);
|
|
|
|
|
|
|
|
// form.append('role', RadioGroupvalue);
|
|
|
|
|
|
|
|
// form.append('type', 1);
|
|
|
|
|
|
|
|
axios.post(url, {
|
|
|
|
axios.post(url, {
|
|
|
|
code: tojoinclasstitle,
|
|
|
|
code: tojoinclasstitle,
|
|
|
|
role: RadioGroupvalue
|
|
|
|
role: RadioGroupvalue
|
|
|
@ -558,15 +435,6 @@ submittojoinclass=(value)=>{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.hidetojoinclass()
|
|
|
|
this.hidetojoinclass()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// trialapplications =()=>{
|
|
|
|
|
|
|
|
// console.log("点击了")
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
|
|
|
// isRenders: true,
|
|
|
|
|
|
|
|
// showTrial:true,
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 关闭
|
|
|
|
// 关闭
|
|
|
|
cancelModulationModels = () => {
|
|
|
|
cancelModulationModels = () => {
|
|
|
|
this.setState({ isRenders: false })
|
|
|
|
this.setState({ isRenders: false })
|
|
|
@ -1404,8 +1272,6 @@ submittojoinclass=(value)=>{
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<i className="iconfont icon-xiaoxilingdang color-white"></i>
|
|
|
|
<i className="iconfont icon-xiaoxilingdang color-white"></i>
|
|
|
|
<span className="newslight" style={{ display: this.props.Headertop === undefined ? "none" : this.props.Headertop.new_message === true ? "block" : "none" }}>
|
|
|
|
<span className="newslight" style={{ display: this.props.Headertop === undefined ? "none" : this.props.Headertop.new_message === true ? "block" : "none" }}>
|
|
|
|
{/*{this.props.Headertop===undefined?"":this.props.Headertop.unread_message_count > 99 ? '99+'*/}
|
|
|
|
|
|
|
|
{/*: this.props.Headertop===undefined?"":this.props.Headertop.unread_message_count}*/}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
}
|
|
|
|
}
|
|
|
|