Commit 094ee096 by xuzhenghua

首页优化完

parent c5c40c32
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Carousel, WingBlank} from 'antd-mobile'; import {Carousel, WingBlank} from 'antd-mobile';
class Topscroll extends Component { class Topscroll extends Component {
state = {} state = {
slideIndex:0
}
render() { render() {
return ( return (
<WingBlank> <div className='top-scroll'>
<Carousel className="space-carousel" <WingBlank>
frameOverflow="visible" <Carousel className="space-carousel"
cellSpacing={12} frameOverflow="visible"
slideWidth={0.9} cellSpacing={10}
autoplay slideWidth={0.8}
infinite autoplay
beforeChange={(from, to) => console.log(`slide from ${from} to ${to}`)} infinite
afterChange={index => this.setState({slideIndex: index})} dotActiveStyle={{
> width: '18px',
{this.props.data.map((val, index) => ( height: '8px',
<a background: '#fff',
key={val} borderRadius: '4px',
href="http://www.alipay.com" }}
style={{ beforeChange={(from, to) => console.log(`slide from ${from} to ${to}`)}
display: 'block', afterChange={index => this.setState({ slideIndex: index })}
position: 'relative', >
top: this.state.slideIndex === index ? -10 : 0, {this.props.data.map((val, index) => (
height: this.props.height, <a
boxShadow: '2px 1px 1px rgba(0, 0, 0, 0.2)', key={val}
}} href="http://www.alipay.com"
> style={{
<img display: 'block',
src={val.src} position: 'relative',
alt="" top: this.state.slideIndex === index ? -6 : 0,
style={{width: '100%', verticalAlign: 'top'}} height: this.state.slideIndex === index ? this.props.actheight : this.props.height,
onLoad={() => { }}
// fire window resize event to change height >
window.dispatchEvent(new Event('resize')); <img
this.setState({imgHeight: this.props.height}); src={val.src}
}} alt=""
/> style={{ width: '100%', verticalAlign: 'top', height: '100%' }}
</a> onLoad={() => {
))} // fire window resize event to change height
</Carousel> window.dispatchEvent(new Event('resize'));
</WingBlank> // this.setState({ imgHeight: 'auto' });
}}
/>
</a>
))}
</Carousel>
</WingBlank>
</div>
); );
} }
} }
......
...@@ -68,8 +68,8 @@ class Index extends Component { ...@@ -68,8 +68,8 @@ class Index extends Component {
render() { render() {
return ( return (
<div className='indexbox'> <div className='index-box'>
<Topscroll data={this.state.dataList} height='168px'></Topscroll> <Topscroll data={this.state.dataList} height='155px' actheight='168px'></Topscroll>
<div className="tabbox"> <div className="tabbox">
<ul> <ul>
......
.indexbox { .index-box {
overflow: hidden; overflow: hidden;
background-color: $bg_fff; background-color: $bg_fff;
} }
.am-wingblank { .top-scroll {
margin-top: 15px; margin-top: 15px;
height: 168px;
position: relative;
.am-wingblank.am-wingblank-lg {
margin: 0;
}
img {
border-radius: 6px;
}
.slider-decorator-0 {
position: absolute;
top: 125px;
.am-carousel-wrap {
text-align: right;
padding-right: 50px;
}
}
} }
/*热门推荐轮播*/ /*热门推荐轮播*/
...@@ -22,7 +41,6 @@ ...@@ -22,7 +41,6 @@
width: 100%; width: 100%;
height: 103px; height: 103px;
padding: 20px 17px; padding: 20px 17px;
margin-top: 50px;
ul { ul {
display: flex; display: flex;
...@@ -132,27 +150,6 @@ ...@@ -132,27 +150,6 @@
} }
} }
/*
底部查看所有课程
*/
.all-course {
text-align: center;
padding-bottom: 30px;
margin-bottom: 50px;
p {
color: $color_555;
font-size: 15px;
margin-bottom: 10px;
}
span {
color: $color_999;
font-size: 12px;
}
}
.course-detail { .course-detail {
width: 100%; width: 100%;
display: flex; display: flex;
...@@ -215,4 +212,26 @@ ...@@ -215,4 +212,26 @@
*/ */
.scroll-box { .scroll-box {
height: 92px; height: 92px;
} }
/*
底部查看所有课程
*/
.all-course {
text-align: center;
padding-bottom: 30px;
margin-bottom: 50px;
p {
color: $color_555;
font-size: 15px;
margin-bottom: 10px;
}
span {
color: $color_999;
font-size: 12px;
}
}
import React, { Component } from 'react'; import React, { Component } from 'react';
import './index.scss';
class Classify extends Component { class Classify extends Component {
render() { render() {
return( return(
<div> <div className='class-box'>
分类 <div className="class-title">分类</div>
<div class="class-course">
<p>集训营</p>
<a href=""></a><a href=""></a><a href=""></a>
</div>
</div> </div>
) )
} }
......
.class-box {
background-color: $bg_fff;
}
.class-title {
width: 100%;
height: 44px;
line-height: 44px;
text-align: center;
background-color: #F7F9FC;
font-size: 16px;
color: $color_333;
}
\ No newline at end of file
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