From 8892e402919b3bb346508f5c5211c5f262be63e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 11 Sep 2019 15:27:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=AE=9E=E8=AE=AD=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/ListPageIndex.js | 18 +- .../courses/coursesPublic/NewShixunModel.js | 170 ++++++++++++------ .../courses/shixunHomework/shixunHomework.js | 1 + 3 files changed, 128 insertions(+), 61 deletions(-) diff --git a/public/react/src/modules/courses/ListPageIndex.js b/public/react/src/modules/courses/ListPageIndex.js index ae52cd6b8..9d9b28558 100644 --- a/public/react/src/modules/courses/ListPageIndex.js +++ b/public/react/src/modules/courses/ListPageIndex.js @@ -81,13 +81,13 @@ class ListPageIndex extends Component{ } componentDidMount(){ - console.log("77"); + // console.log("77"); var yslGuideone = window.localStorage.getItem('yslGuideone'); - console.log("78"); - console.log(yslGuideone); + // console.log("78"); + // console.log(yslGuideone); try { if (yslGuideone === "true") { - console.log("true 字符串"); + // console.log("true 字符串"); this.setState({ yslGuideone:true, }) @@ -95,7 +95,7 @@ class ListPageIndex extends Component{ this.setState({ yslGuideone:false, }); - console.log("false 字符串"); + // console.log("false 字符串"); } }catch (e) { console.log(e); @@ -121,8 +121,7 @@ class ListPageIndex extends Component{ window.localStorage.setItem('yslGuideone', bool); try { if (bool === "true") { - console.log("115"); - console.log("true 字符串"); + this.setState({ yslGuideone:true, }) @@ -130,11 +129,10 @@ class ListPageIndex extends Component{ this.setState({ yslGuideone:false, }); - console.log("124"); - console.log("false 字符串"); + } }catch (e) { - console.log(e); + // console.log(e); this.setState({ yslGuideone:false, }); diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 2294684a7..54918e634 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -7,38 +7,89 @@ class NewShixunModel extends Component{ constructor(props){ super(props) this.state={ + diff:0, + shixun_list:undefined, + shixuns_count:undefined, + } + } + componentDidMount() { + console.log(this.props.type) + + if(this.props.type==='shixun'){ + let url="/shixuns/shixun_list.json" + axios.get(url).then((response) => { + + if(response.data){ + console.log(response.data); + if(response.data.status===0){ + } + } + + }) + }else{ + let url="/shixuns/shixun_list.json" + axios.get(url,{params:{ + type:'all', //这是带过来的值 + status:'all', + search:undefined, + diff:0, + order:'desc', + page:1, + limit:15, + }}).then((response) => { + + if(response.data){ + this.setState({ + shixun_list:response.data.shixun_list, + shixuns_count:response.data.shixuns_count, + }) + } + + }) } + } + DropdownClick=(type)=>{ + this.setState({ + diff:type + }) + } render() { - // let {Searchvalue,type,hometypepvisible,shixunmodallist,newshixunmodallist,}=this.state; + let {diff,datas,shixun_list,shixuns_count}=this.state; // let {visible,patheditarry}=this.props; const menus = ( - + this.DropdownClick(0)}> + 所有 + + + + + this.DropdownClick(1)} > 初级 - + this.DropdownClick(2)}> 中级 - + this.DropdownClick(3)}> 高级 - - 顶级 + this.DropdownClick(4)}> + 顶级 @@ -84,7 +135,7 @@ class NewShixunModel extends Component{

已选 6 个实训 - 5 个实训 + {shixuns_count===undefined?"":shixuns_count} 个实训 学习人数 @@ -96,7 +147,7 @@ class NewShixunModel extends Component{ - 难度 + {diff===0?"所有":diff===1?"初级":diff===2?"中级":diff===3?"高级":diff===4?"顶级":""}

@@ -107,31 +158,45 @@ class NewShixunModel extends Component{

+ {/*author_name: "刘强"*/} + {/*author_school_name: "湖南工业大学"*/} + {/*challenge_names: ["打印输出 Hello World", "打印输出图形", "求3个数的最大值", "熟悉C语言调试过程"]*/} + {/*challenges_count: 4*/} + {/*content: {}*/} + {/*id: 1504*/} + {/*identifier: "tb7hw62n"*/} + {/*level: "初级"*/} + {/*study_count: 6002*/} + {/*subjects: [{id: 138, name: "C语言程序设计"}, {id: 180, name: "C语言程序设计(湖南师范大学)"}, {id: 211, name: "移动云启 —— C语言练习题库"}]*/} + {/*title: "C语言程序设计编辑与调试环境"*/} + {/*visits_count: 9419*/} + {shixun_list===undefined?"":shixun_list.length===0?"":shixun_list.map((item,key)=>{ + console.log(item.content) + return( +
+
+
+
+ + {item.title} + -
-
-
-
- - 移动云启 ——JAVA面向对象 - - -
-

- 已被广泛应用于移动及桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等各个领域的软件开发中。 -

- -

- 已被广泛应用于移动及桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等各个领域的软件开发中。 -

- -
-
-
+
+

+ {/*{item.content}*/} +

+ +

+ 已被广泛应用于移动及桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等各个领域的软件开发中。 +

+ +
+
+
-

- - - Home - Application Center - Application List - An Application - An Application - - - -

- - - 难度 - - + + + {item.author_name} + {item.author_school_name} + 难度系数:{item.level} + 学习人数:{item.study_count} + {item.author_name} + + + +

+ + + 难度 + + +
-
+ )}) + } -
+ + {shixun_list===undefined?"":shixun_list.length>15?
-
+
:""}
diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 6fb55894a..aee4f35b4 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -946,6 +946,7 @@ class ShixunHomework extends Component{