);
}
+ 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,
+ });
+ });
+ };
}
diff --git a/src/pages/shijiankecheng/shijiankecheng.css b/src/pages/shijiankecheng/shijiankecheng.css
index 7d0a2973..5801159a 100644
--- a/src/pages/shijiankecheng/shijiankecheng.css
+++ b/src/pages/shijiankecheng/shijiankecheng.css
@@ -150,6 +150,10 @@
background: #ddecf9 !important;
color: #4cacff !important;
}
+.kc_active{
+ background: #ddecf9 !important;
+ color: #4cacff !important;
+}
.kc_main_box2_contain_li{
display: none;
position: absolute;
diff --git a/src/pages/shijiankecheng/shijiankecheng.js b/src/pages/shijiankecheng/shijiankecheng.js
index e7232901..96ae68df 100644
--- a/src/pages/shijiankecheng/shijiankecheng.js
+++ b/src/pages/shijiankecheng/shijiankecheng.js
@@ -1,7 +1,7 @@
import React, { Component } from "react";
import "./shijiankecheng.css";
import Center6 from "../shouye/component/tg_dibu/center6";
-import Box2 from "./box2";
+
import Box4 from "./box4";
export default class Shijiankecheng extends Component {
@@ -37,7 +37,6 @@ export default class Shijiankecheng extends Component {