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 = (
@@ -84,7 +135,7 @@ class NewShixunModel extends Component{
已选 6 个实训
- 共 5 个实训
+ 共 {shixuns_count===undefined?"":shixuns_count} 个实训
学习人数
@@ -96,7 +147,7 @@ class NewShixunModel extends Component{
- 已被广泛应用于移动及桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等各个领域的软件开发中。 -
- -- 已被广泛应用于移动及桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等各个领域的软件开发中。 -
- -+ {/*{item.content}*/} +
+ ++ 已被广泛应用于移动及桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等各个领域的软件开发中。 +
+ +
-
-