From f98f112701ca93834bd0dc232b3d0ba81cbfef1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 14:32:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AB=98=E4=BA=AE=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/NewShixunModel.js | 50 +++++++++---------- .../courses/coursesPublic/Newshixunmodel.css | 15 +++++- 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index e753b3bbc..ce38b2852 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -15,31 +15,31 @@ class NewShixunModel extends Component{ page:1, type:'all', status:'all', - search:undefined, + keyword:undefined, order:'desc', diff:0, limit:15, } } componentDidMount() { - let{page,type,search,order,diff,limit}=this.state; + let{page,type,keyword,order,diff,limit}=this.state; let status=this.props.statustype===undefined?'all':'published'; this.setState({ status:status }) - this.getdatalist(page,type,status,search,order,diff,limit) + this.getdatalist(page,type,status,keyword,order,diff,limit) } - getdatalist=(page,type,status,search,order,diff,limit,pagetype)=>{ + getdatalist=(page,type,status,keyword,order,diff,limit,pagetype)=>{ this.setState({ isspinning:true }) - let url="/shixuns/shixun_list.json" + let url="/shixun_lists.json" axios.get(url,{params:{ page, type, status, - search, + keyword, order, diff, limit @@ -72,8 +72,8 @@ class NewShixunModel extends Component{ this.setState({ diff:diff }) - let{page,type,status,search,order,limit}=this.state; - this.getdatalist(page,type,status,search,order,diff,limit) + let{page,type,status,keyword,order,limit}=this.state; + this.getdatalist(page,type,status,keyword,order,diff,limit) } ItsCourse=(item)=>{ @@ -130,8 +130,8 @@ class NewShixunModel extends Component{ newallGrouplist.push({page:pageNumber,list:[]}) } - let{type,status,search,order,diff,limit}=this.state; - this.getdatalist(pageNumber,type,status,search,order,diff,limit,"pagetype") + let{type,status,keyword,order,diff,limit}=this.state; + this.getdatalist(pageNumber,type,status,keyword,order,diff,limit,"pagetype") this.setState({ page:pageNumber, allGrouplist:newallGrouplist @@ -143,8 +143,8 @@ class NewShixunModel extends Component{ this.setState({ type:value }) - let{page,status,search,order,diff,limit}=this.state; - this.getdatalist(page,value,status,search,order,diff,limit) + let{page,status,keyword,order,diff,limit}=this.state; + this.getdatalist(page,value,status,keyword,order,diff,limit) } updatedlist=(order)=>{ @@ -153,28 +153,28 @@ class NewShixunModel extends Component{ this.setState({ order:"asc" }) - let{type,page,status,search,diff,limit}=this.state; - this.getdatalist(page,type,status,search,"asc",diff,limit) + let{type,page,status,keyword,diff,limit}=this.state; + this.getdatalist(page,type,status,keyword,"asc",diff,limit) }else{ this.setState({ order:"desc" }) - let{type,page,status,search,diff,limit}=this.state; - this.getdatalist(page,type,status,search,"desc",diff,limit) + let{type,page,status,keyword,diff,limit}=this.state; + this.getdatalist(page,type,status,keyword,"desc",diff,limit) } } setdatafunsval=(e)=>{ this.setState({ - search:e.target.value + keyword:e.target.value }) } setdatafuns=(value)=>{ this.setState({ - search:value, + keyword:value, type:undefined, page:1, status:'all', @@ -265,8 +265,8 @@ class NewShixunModel extends Component{ this.setState({ status:status }) - let{page,type,search,order,diff,limit}=this.state; - this.getdatalist(page,type,status,search,order,diff,limit) + let{page,type,keyword,order,diff,limit}=this.state; + this.getdatalist(page,type,status,keyword,order,diff,limit) } render() { @@ -363,7 +363,7 @@ class NewShixunModel extends Component{ style={{ width: "800px"}} className="packinput" placeholder="实训信息 / 院校名称 / 创建者" - value={this.state.search} + value={this.state.keyword} enterButton={搜索} onInput={(e)=>this.setdatafunsval(e)} onSearch={ (value)=>this.setdatafuns(value)} /> @@ -420,13 +420,13 @@ class NewShixunModel extends Component{ className="fl task-hide edu-txt-left mt3" name="shixun_homework[]" > - - {item.title} +
- {JSON.stringify(item.content) == "{}"?"":
- {/*{item.description}*/} + {JSON.stringify(item.description) == "{}"?"":
} {item.challenge_names.length===0?"":
diff --git a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css index b58cb4196..dd267d65b 100644 --- a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css +++ b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css @@ -149,6 +149,14 @@ color: #999999; margin-top: 15px; margin-left: 30px; + overflow: hidden; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + max-width: 1100px; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; } .newshixunmodelbotfont{ @@ -236,4 +244,9 @@ .mt3 { margin-top: 3px !important; -} \ No newline at end of file +} + +.highlight{ + color: #4CACFF; +} +