Commit 6f77278a by xuzhenghua

idea

parent d97bd399
...@@ -13,14 +13,21 @@ class Classify extends Component { ...@@ -13,14 +13,21 @@ class Classify extends Component {
handleClick() { handleClick() {
console.log(1); console.log(1);
} }
ontabclick(tab, index) { ontabclick(tab, index) {
console.log(tab, index) console.log(tab, index)
} }
pulldown(){
alert(2) pulldown() {
this.setState(status => ({
ispull: !status.ispull,
display: status.ispull ? 'none': 'block'
}));
} }
state = { state = {
ispull: false,
display: 'none',
mockData: [ mockData: [
{ {
title: '三月面试求职三月面试求职三月面试求职', title: '三月面试求职三月面试求职三月面试求职',
...@@ -115,13 +122,22 @@ class Classify extends Component { ...@@ -115,13 +122,22 @@ class Classify extends Component {
{title: '数据结构'}, {title: '数据结构'},
{title: '数学'}, {title: '数学'},
]; ];
const bottom = (
<i className={'iconfont iconiconfront-69 pull-down'}></i>
)
const top = (
<i className={'iconfont iconiconfront-71 pull-down'}></i>
)
return ( return (
<div className='class-box'> <div className='class-child'>
<div> <div>
<WhiteSpace/> <WhiteSpace/>
<i className={'iconfont iconiconfront-69 pull-down'} onClick={this.pulldown.bind(this)}></i> <div onClick={this.pulldown.bind(this)}>
<Tabs {this.state.ispull ? top : bottom}
</div>
<Tabs
tabs={tabs} tabs={tabs}
animated={false} animated={false}
onTabClick={(tab, index) => this.ontabclick(tab, index)} onTabClick={(tab, index) => this.ontabclick(tab, index)}
...@@ -154,13 +170,13 @@ class Classify extends Component { ...@@ -154,13 +170,13 @@ class Classify extends Component {
</Tabs> </Tabs>
<WhiteSpace/> <WhiteSpace/>
</div> </div>
<div className='mbc-box'> <div className='mbc-box' style={{display: this.state.display}}>
<div className="tabcontent"> <div className="tabcontent">
<div className="class-course"> <div className="class-course">
<p className='course-items-title'>基础入门</p> <p className='course-items-title'>基础入门</p>
<div className='items-box'> <div className='items-box'>
{ {
this.state.dataList.map((item,index)=>{ this.state.dataList.map((item, index) => {
return ( return (
<a href="/#" key={index} className='item-label'>{item.title}</a> <a href="/#" key={index} className='item-label'>{item.title}</a>
) )
...@@ -172,7 +188,7 @@ class Classify extends Component { ...@@ -172,7 +188,7 @@ class Classify extends Component {
<p className='course-items-title'>进阶提高</p> <p className='course-items-title'>进阶提高</p>
<div className='items-box'> <div className='items-box'>
{ {
this.state.dataList.map((item,index)=>{ this.state.dataList.map((item, index) => {
return ( return (
<a href="/#" key={index} className='item-label'>{item.title}</a> <a href="/#" key={index} className='item-label'>{item.title}</a>
) )
......
.class-box { .class-child {
padding: 0 12px; padding: 0 12px;
position: relative; position: relative;
.v-list-item { .v-list-item {
......
...@@ -54,7 +54,7 @@ class Classify extends Component { ...@@ -54,7 +54,7 @@ class Classify extends Component {
{ {
this.state.dataList.map((item,index)=>{ this.state.dataList.map((item,index)=>{
return ( return (
<a href="/#" key={index} className='item-banner'><img <a href="/classify/courselist" key={index} className='item-banner'><img
src={item.src} src={item.src}
alt=""/></a> alt=""/></a>
) )
......
...@@ -16,10 +16,11 @@ const router = () => ( ...@@ -16,10 +16,11 @@ const router = () => (
<Switch> <Switch>
<Route exact path="/" component={Index}></Route> <Route exact path="/" component={Index}></Route>
<Route path="/index" component={Index}></Route> <Route path="/index" component={Index}></Route>
<Route path='/classify' component={Classify}></Route> <Route path='/classify' component={Classify}>
<Route path='/classify/courselist' component={CourseList}></Route>
</Route>
<Route path='/study' component={Study}></Route> <Route path='/study' component={Study}></Route>
<Route path='/my' component={My}></Route> <Route path='/my' component={My}></Route>
<Route path='/courselist' component={CourseList}></Route>
<Route path='/search' component={Search}></Route> <Route path='/search' component={Search}></Route>
</Switch> </Switch>
<Menu /> <Menu />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment