diff --git a/src/pages/shijiankecheng/box2.js b/src/pages/shijiankecheng/box2.js index 2f1feb65..e721ec97 100644 --- a/src/pages/shijiankecheng/box2.js +++ b/src/pages/shijiankecheng/box2.js @@ -5,33 +5,77 @@ export default class Box2 extends Component { super(); this.state = { list: [], + color: "", + color2: -1, }; fetch("https://test-data.educoder.net/api/disciplines.json?source=subject") .then((res) => res.json()) .then((data) => { - console.log(data.disciplines); this.setState({ list: data.disciplines, }); }); } + handleclick2(t, i) { + this.props.eventbox(t); + this.setState({ + color2: i, + color: "", + }); + } + handleclick(e, v, t, i, o) { + e.stopPropagation(); + this.props.event(v, t); + this.setState({ + color: i, + color2: o, + }); + } + handleclick3() { + this.props.eventall(); + this.setState({ + color2: -1, + color: "", + }); + } render() { return (