diff --git a/src/forge/Main/Index.js b/src/forge/Main/Index.js index b82db46e..ede9c535 100644 --- a/src/forge/Main/Index.js +++ b/src/forge/Main/Index.js @@ -37,7 +37,10 @@ class Index extends Component { recommendOriList:undefined, languageList:undefined, - languageId:undefined + languageId:undefined, + + CategoryList:undefined + } } @@ -147,11 +150,13 @@ class Index extends Component { this.setState({ isSpin: true, project_type: type, - search: undefined + search: undefined, + category_id: undefined, + },()=>{ + this.setTypeList(list, type) + const { page, limit, sort , languageId } = this.state; + this.getListData(page, limit, undefined, sort, type, undefined , languageId); }) - this.setTypeList(list, type) - const { page, limit, sort, category_id , languageId } = this.state; - this.getListData(page, limit, undefined, sort, type, category_id , languageId); } // 获取类型 @@ -160,23 +165,15 @@ class Index extends Component { axios.get(url).then((result) => { if (result && result.data) { + this.setCategoryList(result.data, undefined); } }).catch((error) => { }) } - setCategoryList = (list, active_id) => { + setCategoryList = (list) => { this.setState({ - categoryList: list.map((item, key) => { - return ( -
- {item.name} - {item.projects_count} -
-+ {item.name} + {item.projects_count} +
+