|
|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
import React, { Component } from "react";
|
|
|
|
|
import Box2 from "./box2";
|
|
|
|
|
|
|
|
|
|
export default class Box4 extends Component {
|
|
|
|
|
constructor() {
|
|
|
|
|
@ -8,6 +9,8 @@ export default class Box4 extends Component {
|
|
|
|
|
current: 1,
|
|
|
|
|
button: "new",
|
|
|
|
|
color: 0,
|
|
|
|
|
id1: "",
|
|
|
|
|
id2: "",
|
|
|
|
|
};
|
|
|
|
|
fetch(
|
|
|
|
|
"https://test-data.educoder.net/api/paths.json?sort=desc&order=" +
|
|
|
|
|
@ -26,7 +29,11 @@ export default class Box4 extends Component {
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
{console.log()}
|
|
|
|
|
<Box2
|
|
|
|
|
event={this.hadnleClick_box2}
|
|
|
|
|
eventall={this.handleClick_box2_all}
|
|
|
|
|
eventbox={this.hadnleClick_box2_part}
|
|
|
|
|
></Box2>
|
|
|
|
|
<div className="kc_main_box3">
|
|
|
|
|
<div
|
|
|
|
|
className={
|
|
|
|
|
@ -78,6 +85,54 @@ export default class Box4 extends Component {
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
hadnleClick_box2_part = (disciplines_id) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
map: [],
|
|
|
|
|
id1: disciplines_id,
|
|
|
|
|
current: 1,
|
|
|
|
|
});
|
|
|
|
|
var b = this.state.button;
|
|
|
|
|
fetch(
|
|
|
|
|
"https://test-data.educoder.net/api/paths.json?sort=desc&order=" +
|
|
|
|
|
b +
|
|
|
|
|
"&page=" +
|
|
|
|
|
1 +
|
|
|
|
|
"&limit=16&keyword=&discipline_id=" +
|
|
|
|
|
disciplines_id +
|
|
|
|
|
"&sub_discipline_id="
|
|
|
|
|
)
|
|
|
|
|
.then((res) => res.json())
|
|
|
|
|
.then((data) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
map: data.subjects,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
hadnleClick_box2 = (disciplines_id, sub_disciplines_id) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
map: [],
|
|
|
|
|
id1: disciplines_id,
|
|
|
|
|
id2: sub_disciplines_id,
|
|
|
|
|
current: 1,
|
|
|
|
|
});
|
|
|
|
|
var b = this.state.button;
|
|
|
|
|
fetch(
|
|
|
|
|
"https://test-data.educoder.net/api/paths.json?sort=desc&order=" +
|
|
|
|
|
b +
|
|
|
|
|
"&page=" +
|
|
|
|
|
1 +
|
|
|
|
|
"&limit=16&keyword=&discipline_id=" +
|
|
|
|
|
disciplines_id +
|
|
|
|
|
"&sub_discipline_id=" +
|
|
|
|
|
sub_disciplines_id
|
|
|
|
|
)
|
|
|
|
|
.then((res) => res.json())
|
|
|
|
|
.then((data) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
map: data.subjects,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
handleClick_zuixin = () => {
|
|
|
|
|
this.setState({
|
|
|
|
|
color: 0,
|
|
|
|
|
@ -86,12 +141,17 @@ export default class Box4 extends Component {
|
|
|
|
|
});
|
|
|
|
|
var v = this.state.current;
|
|
|
|
|
var b = "new";
|
|
|
|
|
var id1 = this.state.id1;
|
|
|
|
|
var id2 = this.state.id2;
|
|
|
|
|
fetch(
|
|
|
|
|
"https://test-data.educoder.net/api/paths.json?sort=desc&order=" +
|
|
|
|
|
b +
|
|
|
|
|
"&page=" +
|
|
|
|
|
v +
|
|
|
|
|
"&limit=16&keyword=&discipline_id=&sub_discipline_id="
|
|
|
|
|
"&limit=16&keyword=&discipline_id=" +
|
|
|
|
|
id1 +
|
|
|
|
|
"&sub_discipline_id=" +
|
|
|
|
|
id2
|
|
|
|
|
)
|
|
|
|
|
.then((res) => res.json())
|
|
|
|
|
.then((data) => {
|
|
|
|
|
@ -108,12 +168,17 @@ export default class Box4 extends Component {
|
|
|
|
|
});
|
|
|
|
|
var v = this.state.current;
|
|
|
|
|
var b = "";
|
|
|
|
|
var id1 = this.state.id1;
|
|
|
|
|
var id2 = this.state.id2;
|
|
|
|
|
fetch(
|
|
|
|
|
"https://test-data.educoder.net/api/paths.json?sort=desc&order=" +
|
|
|
|
|
b +
|
|
|
|
|
"&page=" +
|
|
|
|
|
v +
|
|
|
|
|
"&limit=16&keyword=&discipline_id=&sub_discipline_id="
|
|
|
|
|
"&limit=16&keyword=&discipline_id=" +
|
|
|
|
|
id1 +
|
|
|
|
|
"&sub_discipline_id=" +
|
|
|
|
|
id2
|
|
|
|
|
)
|
|
|
|
|
.then((res) => res.json())
|
|
|
|
|
.then((data) => {
|
|
|
|
|
@ -127,13 +192,19 @@ export default class Box4 extends Component {
|
|
|
|
|
current: this.state.current + 1,
|
|
|
|
|
map: [],
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var b = this.state.button;
|
|
|
|
|
var id1 = this.state.id1;
|
|
|
|
|
var id2 = this.state.id2;
|
|
|
|
|
fetch(
|
|
|
|
|
"https://test-data.educoder.net/api/paths.json?sort=desc&order=" +
|
|
|
|
|
b +
|
|
|
|
|
"&page=" +
|
|
|
|
|
(v + 1) +
|
|
|
|
|
"&limit=16&keyword=&discipline_id=&sub_discipline_id="
|
|
|
|
|
"&limit=16&keyword=&discipline_id=" +
|
|
|
|
|
id1 +
|
|
|
|
|
"&sub_discipline_id=" +
|
|
|
|
|
id2
|
|
|
|
|
)
|
|
|
|
|
.then((res) => res.json())
|
|
|
|
|
.then((data) => {
|
|
|
|
|
@ -148,12 +219,17 @@ export default class Box4 extends Component {
|
|
|
|
|
map: [],
|
|
|
|
|
});
|
|
|
|
|
var b = this.state.button;
|
|
|
|
|
var id1 = this.state.id1;
|
|
|
|
|
var id2 = this.state.id2;
|
|
|
|
|
fetch(
|
|
|
|
|
"https://test-data.educoder.net/api/paths.json?sort=desc&order=" +
|
|
|
|
|
b +
|
|
|
|
|
"&page=" +
|
|
|
|
|
(v - 1) +
|
|
|
|
|
"&limit=16&keyword=&discipline_id=&sub_discipline_id="
|
|
|
|
|
"&limit=16&keyword=&discipline_id=" +
|
|
|
|
|
id1 +
|
|
|
|
|
"&sub_discipline_id=" +
|
|
|
|
|
id2
|
|
|
|
|
)
|
|
|
|
|
.then((res) => res.json())
|
|
|
|
|
.then((data) => {
|
|
|
|
|
@ -162,4 +238,26 @@ export default class Box4 extends Component {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
handleClick_box2_all = () => {
|
|
|
|
|
this.setState({
|
|
|
|
|
map: [],
|
|
|
|
|
id1: "",
|
|
|
|
|
id2: "",
|
|
|
|
|
current: 1,
|
|
|
|
|
});
|
|
|
|
|
var b = this.state.button;
|
|
|
|
|
fetch(
|
|
|
|
|
"https://test-data.educoder.net/api/paths.json?sort=desc&order=" +
|
|
|
|
|
b +
|
|
|
|
|
"&page=" +
|
|
|
|
|
1 +
|
|
|
|
|
"&limit=16&keyword=&discipline_id=&sub_discipline_id="
|
|
|
|
|
)
|
|
|
|
|
.then((res) => res.json())
|
|
|
|
|
.then((data) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
map: data.subjects,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|