Commit 44fd952c by xuzhenghua

组件

parent 8510ff53
...@@ -33,3 +33,4 @@ class Scroll extends Component { ...@@ -33,3 +33,4 @@ class Scroll extends Component {
} }
export default Scroll export default Scroll
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 = {}
render() { render() {
...@@ -45,4 +45,4 @@ class TopScroll extends Component { ...@@ -45,4 +45,4 @@ class TopScroll extends Component {
} }
} }
export default TopScroll export default Topscroll
import React, {Component} from 'react';
import './carousel.scss';
class Carousel extends Component {
render() {
return (
<div className='scroll-box'>
<ul className='scroll-list'>
{this.props.children}
</ul>
</div>
)
}
}
export default Carousel
.scroll-box { .scroll-box {
width: 100%; width: 100%;
height: 92px;
overflow: auto; overflow: auto;
position: relative; position: relative;
margin-top: 15px; margin-top: 15px;
......
import React from 'react';
import './carousel.scss'
const Carousel = (props) => {
return (
<div className='scroll-box'>
<ul className='scroll-list'>
{props.children}
</ul>
</div>
)
};
export default Carousel;
// 底部路由 // 底部路由
export { default as Nav } from './Nav' export { default as Nav } from './Nav'
export { default as VList } from './VList' export { default as VList } from './VList'
export { default as Course } from './Course' export { default as Course } from './Course' // 课程状态(试听 正在直播)+封面+标题+ 详情
\ No newline at end of file export { default as Carousel } from './Carousel' // 横向滚动
export { default as Topscroll } from './Topscroll' // 首页头部轮播
export { default as Scroll } from './Scroll' // 首页正常轮播图
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Course, VList} from '../../common' import {Course, Carousel,Scroll,Topscroll} from '../../common'
import Scroll from '../../common/scroll/scroll.js';
import TopScroll from '../../common/scroll/topscroll.js';
import Carousel from '../../common/carousel/carousel.js';
import './index.scss'; import './index.scss';
class Index extends Component { class Index extends Component {
state = { state = {
dataList: [ dataList: [
...@@ -42,8 +38,8 @@ class Index extends Component { ...@@ -42,8 +38,8 @@ class Index extends Component {
'teacher': 'wwwwww', 'teacher': 'wwwwww',
'time': '2343234', 'time': '2343234',
'isbuy': 1, 'isbuy': 1,
'price0': 100, 'price0': 200,
'price1': 1000 'price1': 2000
} }
], ],
tabdata: [ tabdata: [
...@@ -74,7 +70,7 @@ class Index extends Component { ...@@ -74,7 +70,7 @@ class Index extends Component {
const top = <div>333</div> const top = <div>333</div>
return ( return (
<div className='indexbox'> <div className='indexbox'>
<TopScroll data={this.state.dataList} height='168px'></TopScroll> <Topscroll data={this.state.dataList} height='168px'></Topscroll>
<div className="tabbox"> <div className="tabbox">
<ul> <ul>
{ {
...@@ -121,12 +117,14 @@ class Index extends Component { ...@@ -121,12 +117,14 @@ class Index extends Component {
<h2 className="title">新上好课</h2> <h2 className="title">新上好课</h2>
<ul className='course-detail'> <ul className='course-detail'>
{this.state.dataList.map((item, index) => { {this.state.dataList.map((item, index) => {
const top = ( // const top = (
<span className='audition'> // {
<i className={'iconfont iconerji'}></i> // item.isbuy === '1' && <span className='audition'>
试听 // <i className={'iconfont iconerji'}></i>
</span> // 试听
) // </span>
// }
// )
const bottom = ( const bottom = (
<p className="course-price"> <p className="course-price">
<span className="new">¥{item.price0}</span> <span className="new">¥{item.price0}</span>
......
.indexbox { .indexbox {
overflow: hidden; overflow: hidden;
background-color: #fff; background-color: $bg_fff;
} }
.am-wingblank { .am-wingblank {
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
} }
span { span {
color: #606060; color: $color_606;
font-size: 13px; font-size: 13px;
display: block; display: block;
margin-top: 10px; margin-top: 10px;
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
height: 100%; height: 100%;
margin-right: 20px; margin-right: 20px;
box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.1); box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.1);
background-color: #fff; background-color: $bg_fff;
border: 1px solid rgba(0, 0, 0, .1); border: 1px solid rgba(0, 0, 0, .1);
border-radius: 5px; border-radius: 5px;
...@@ -82,18 +82,18 @@ ...@@ -82,18 +82,18 @@
.item-title { .item-title {
font-size: 15px; font-size: 15px;
color: #333; color: $color_333;
} }
.item-teacher { .item-teacher {
font-size: 13px; font-size: 13px;
color: #555; color: $color_555;
margin-top: 6px; margin-top: 6px;
} }
.item-time { .item-time {
font-size: 12px; font-size: 12px;
color: #999; color: $color_999;
margin-top: 11px; margin-top: 11px;
} }
} }
...@@ -121,12 +121,12 @@ ...@@ -121,12 +121,12 @@
.title { .title {
font-size: 15px; font-size: 15px;
color: #333; color: $color_333;
display: inline-block; display: inline-block;
} }
.more { .more {
color: #09f; color: $active;
font-size: 12px; font-size: 12px;
float: right; float: right;
} }
...@@ -141,13 +141,13 @@ ...@@ -141,13 +141,13 @@
margin-bottom: 50px; margin-bottom: 50px;
p { p {
color: #555; color: $color_555;
font-size: 15px; font-size: 15px;
margin-bottom: 10px; margin-bottom: 10px;
} }
span { span {
color: #999; color: $color_999;
font-size: 12px; font-size: 12px;
} }
} }
...@@ -165,9 +165,9 @@ ...@@ -165,9 +165,9 @@
width: 54px; width: 54px;
height: 18px; height: 18px;
line-height: 18px; line-height: 18px;
background-color: #09f; background-color: $bg_active;
font-size: 12px; font-size: 12px;
color: #fff; color: $white;
text-align: center; text-align: center;
border-radius: 1px; border-radius: 1px;
...@@ -183,12 +183,12 @@ ...@@ -183,12 +183,12 @@
margin-top: 15px; margin-top: 15px;
.new { .new {
color: #FF2121; color: $red;
font-size: 15px; font-size: 15px;
} }
.old { .old {
color: #999; color: $color_999;
font-size: 12px; font-size: 12px;
display: inline-block; display: inline-block;
margin-left: 15px; margin-left: 15px;
...@@ -201,12 +201,18 @@ ...@@ -201,12 +201,18 @@
margin-top: 15px; margin-top: 15px;
width: 61px; width: 61px;
height: 18px; height: 18px;
background-color: #09f; background-color: $bg_active;
border-radius: 9px; border-radius: 9px;
color: #fff; color: $white;
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;
line-height: 18px; line-height: 18px;
} }
} }
/*
横向滚动
*/
.scroll-box {
height: 92px;
}
...@@ -9,6 +9,7 @@ $color_333: #333; ...@@ -9,6 +9,7 @@ $color_333: #333;
$color_555: #555; $color_555: #555;
$color_666: #666; $color_666: #666;
$color_999: #999; $color_999: #999;
$color_606: #606060;
/* /*
......
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