From d0270e6b7a9d21016509c20e6db7edf389ed620e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 16 Jul 2019 10:25:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/user/Interestpage.js | 150 ++++++++++++------ 1 file changed, 103 insertions(+), 47 deletions(-) diff --git a/public/react/src/modules/user/Interestpage.js b/public/react/src/modules/user/Interestpage.js index 77397fbc6..a13a10d88 100644 --- a/public/react/src/modules/user/Interestpage.js +++ b/public/react/src/modules/user/Interestpage.js @@ -1,7 +1,5 @@ import React, {Component} from 'react'; - - -import {Button} from 'antd'; +import {Button,notification} from 'antd'; import {broadcastChannelPostMessage} from 'educoder'; import axios from 'axios'; import './common.css' @@ -26,12 +24,65 @@ class InterestpageComponent extends Component { this.state = { gouxuans: "", gouxuans2:0, - gouxuans3:[{id:1,name:"前端开发",bool:false,url:qdkf},{id:2,name:"后端开发",bool:false,url:hdkf},{id:3,name:"移动开发",bool:false,url:ydkf},{id:4,name:"数据库",bool:false,url:sjk},{id:5,name:"云计算和大数据",bool:false,url:ysj},{id:6,name:"运维与测试",bool:false,url:yunwei},{id:7,name:"人工智能",bool:false,url:rgzn},{id:8,name:"其他",bool:false,url:qita}], + gouxuans4:[], namezh:this.props.namezh, passmm:this.props.passmm, + homedatalist:undefined, + hometypepvisible: undefined, + } } + openNotification = (messge) => { + // type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色 + notification.open({ + message: "提示", + description: messge, + onClick: () => { + console.log('Notification Clicked!'); + }, + }); + } + componentDidMount(){ + 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); @@ -85,21 +136,21 @@ class InterestpageComponent extends Component { } Clickteacher2=(e)=>{ console.log(e); - let {gouxuans3} =this.state; - for (var i=0;i{ - 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); - }) - } + // //跳转然后登入 + // 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); + // }) + // } render() { const { gouxuans, - gouxuans3 + gouxuans4, } = this.state // height: 346px; return ( @@ -193,7 +249,7 @@ class InterestpageComponent extends Component {
基于你关注的内容推荐
- {gouxuans3&&gouxuans3.map((item,key)=>{ + {gouxuans4&&gouxuans4.map((item,key)=>{ return(
this.Clickteacher2(item.id)}> {item.bool===true?:
}