|
|
|
@ -1,51 +1,28 @@
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
|
|
|
|
|
import { Redirect } from 'react-router';
|
|
|
|
|
import { Link } from "react-router-dom";
|
|
|
|
|
import AccountProfile from "../user/AccountProfile";
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
import Certifiedprofessional from "../../modules/modals/Certifiedprofessional"
|
|
|
|
|
|
|
|
|
|
// import searchImg from '../../../../images/educoder/icon/search.svg'
|
|
|
|
|
|
|
|
|
|
// /images/educoder/icon/search.svg
|
|
|
|
|
|
|
|
|
|
import { getImageUrl, toPath, trigger, broadcastChannelPostMessage } from 'educoder'
|
|
|
|
|
|
|
|
|
|
import { getImageUrl } from 'educoder'
|
|
|
|
|
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 LoginDialog from '../login/LoginDialog';
|
|
|
|
|
|
|
|
|
|
import Trialapplication from '../login/Trialapplication';
|
|
|
|
|
|
|
|
|
|
import GotoQQgroup from '../../modal/GotoQQgroup'
|
|
|
|
|
|
|
|
|
|
import 'antd/lib/modal/style/index.css';
|
|
|
|
|
|
|
|
|
|
import 'antd/lib/checkbox/style/index.css';
|
|
|
|
|
|
|
|
|
|
import 'antd/lib/radio/style/index.css';
|
|
|
|
|
|
|
|
|
|
import 'antd/lib/input/style/index.css';
|
|
|
|
|
|
|
|
|
|
import './TPMIndex.css';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const $ = window.$
|
|
|
|
|
// TODO 这部分脚本从公共脚本中直接调用
|
|
|
|
|
|
|
|
|
|
const RadioGroup = Radio.Group;
|
|
|
|
|
const { Search } = Input;
|
|
|
|
|
let old_url;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
_logined_header.html.erb
|
|
|
|
|
_unlogin_header.html.erb
|
|
|
|
|
*/
|
|
|
|
|
window._header_componentHandler = null;
|
|
|
|
|
class NewHeader extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
@ -121,44 +98,9 @@ class NewHeader extends Component {
|
|
|
|
|
} 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) => {
|
|
|
|
@ -173,9 +115,6 @@ class NewHeader extends Component {
|
|
|
|
|
this.setState({
|
|
|
|
|
user: newProps.user
|
|
|
|
|
})
|
|
|
|
|
if (newProps.Headertop != undefined) {
|
|
|
|
|
old_url = newProps.Headertop.old_url
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
getCookie = (key) => {
|
|
|
|
@ -404,14 +343,6 @@ class NewHeader extends Component {
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
// }else if(value===0){
|
|
|
|
|
// if(tojoinclasstitle.length<5){
|
|
|
|
|
// this.setState({
|
|
|
|
|
// code_notice:true
|
|
|
|
|
// })
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (tojoinclasstitle === "" || tojoinclasstitle === undefined) {
|
|
|
|
|
this.setState({
|
|
|
|
|
code_notice: true
|
|
|
|
@ -447,58 +378,9 @@ class NewHeader extends Component {
|
|
|
|
|
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) {
|
|
|
|
|
let url = "/project_applies.json"
|
|
|
|
|
// const form = new FormData();
|
|
|
|
|
// form.append('code', tojoinclasstitle);
|
|
|
|
|
// form.append('role', RadioGroupvalue);
|
|
|
|
|
// form.append('type', 1);
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
code: tojoinclasstitle,
|
|
|
|
|
role: RadioGroupvalue
|
|
|
|
@ -529,14 +411,6 @@ class NewHeader extends Component {
|
|
|
|
|
this.hidetojoinclass()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// trialapplications =()=>{
|
|
|
|
|
// console.log("点击了")
|
|
|
|
|
// this.setState({
|
|
|
|
|
// isRenders: true,
|
|
|
|
|
// showTrial:true,
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// 关闭
|
|
|
|
|
cancelModulationModels = () => {
|
|
|
|
|
this.setState({ isRenders: false })
|
|
|
|
|