import React, {Component} from 'react'; import {Button,notification} from 'antd'; import {broadcastChannelPostMessage} from 'educoder'; import MyEduCoderModal from './MyEduCoderModal'; import axios from 'axios'; import './common.css'; import './MyeducoderI.css' import mytc from './img/mytc.png'; import skzbdx from './img/skzbdx.png'; import zyrs1 from './img/zyrs1.png'; import gouxuan from './img/gouxuan.png'; import meigouxuan from './img/meigouxuan.png'; import qdkf from './img/qdkf.png'; import hdkf from './img/hdkf.png'; import ydkf from './img/ydkf.png'; import sjk from './img/sjk.png'; import ysj from './img/ysj.png'; import yunwei from './img/yunwei.png'; import rgzn from './img/rgzn.png'; import qita from './img/qita.png'; //父组件 EducoderLogin.js class InterestpageComponent extends Component { constructor(props) { super(props) this.state = { gouxuans: "", gouxuans2:0, gouxuans4:[], namezh:this.props.namezh, passmm:this.props.passmm, homedatalist:undefined, hometypepvisible: undefined, MyEduCoderModals:false, } } openNotification = (messge) => { // type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色 notification.open({ message: "提示", description: messge, onClick: () => { console.log('Notification Clicked!'); }, }); } componentDidMount(){ console.log("min"); let{gouxuans4} =this.state; let url=`/repertoires.json`; axios.get(url).then((response)=> { if(response){ // console.log("53"); // console.log(response.data); for(var i=0;i{ console.log(error) }); } componentWillReceiveProps(nextProps) { // console.log("46"); // console.log(nextProps); // console.log(this.props); if (nextProps.namezh != this.props.namezh) { // console.log("50"); // console.log(nextProps.user); if (nextProps.namezh !== undefined) { // console.log("53"); // console.log(nextProps.user); this.setState({ namezh: nextProps.namezh, }) } } if (nextProps.passmm != this.props.passmm) { // console.log("50"); // console.log(nextProps.user); if (nextProps.passmm !== undefined) { // console.log("53"); // console.log(nextProps.user); this.setState({ passmm: nextProps.passmm, }) } } } Clickteacher=(e)=>{ // console.log(e); if(e === "teacher"){ this.setState({ gouxuans:"teacher", }) }else if(e ==="student"){ this.setState({ gouxuans:"student", }) }else if(e === "professional"){ this.setState({ gouxuans:"professional", }) } } Clickteacher2=(e)=>{ // console.log(e); let {gouxuans4} =this.state; for (var i=0;i{ this.setState({ MyEduCoderModals:true }) } //兴趣页面点击 Interestcompletionpage(){ if(this.state.gouxuans.length === 0){ this.openNotification("请选择职业"); return } var ints=[]; for (var i =0;i { if (response !== undefined) { // this.Jumptotheinterestpage(); // window.location.href = "/" if(response.data.status===0){ this.setMyEduCoderModals() } } }).catch((error) => { console.log(error); }) } // //跳转然后登入 // Jumptotheinterestpage=()=>{ // console.log(this.state.login); // console.log(this.state.password); // var url = "/accounts/login.json"; // axios.post(url, { // login: this.props.login, // password: this.props.password, // }).then((response) => { // if (response === undefined) { // return // } // if (response.status === 200) { // // if (response.data.status === 402) { // // window.location.href = response.data.url; // // } else { // // broadcastChannelPostMessage('refreshPage') // // this.setState({ // // isRender: false // // }) // window.location.href = "/" // // } // } // // // }).catch((error) => { // console.log(error); // }) // } setNotcompleteds=()=>{ this.setState({ Notcompleteds:true, MyEduCoderModals:false }) } render() { const { gouxuans, gouxuans4, } = this.state console.log(window.screen.width); return (
{this.setNotcompleteds()}} />
请选择你的职业
this.Clickteacher("teacher")}>{gouxuans ==="teacher"? :}老师
this.Clickteacher("teacher")} src={skzbdx} className="ysldivhomedivimg"/>
this.Clickteacher("student")}>{gouxuans==="student"? :}学生
this.Clickteacher("student")} src={mytc} className="ysldivhomedivimg"/>
this.Clickteacher("professional")}>{gouxuans==="professional"?:}专业人士
this.Clickteacher("professional")} src={zyrs1} className="ysldivhomedivimg"/>

选择你可能感兴趣的内容

基于你关注的内容推荐

{gouxuans4&&gouxuans4.map((item,key)=>{ return(
this.Clickteacher2(item.id)}> {item.bool===true?:
}

{item.name}

) })}
); } } export default (InterestpageComponent);