Commit 2d772622 by xuzhenghua

首页分类头部

parent 554db2fd
.scroll-box {
width: 100%;
overflow: auto;
position: relative;
margin-top: 15px;
.scroll-list {
height: 100%;
display: flex;
overflow: hidden;
position: absolute;
}
}::-webkit-scrollbar{
display:none;
}
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;
...@@ -6,6 +6,7 @@ const VList = (props) => { ...@@ -6,6 +6,7 @@ const VList = (props) => {
<li className='v-list-item'> <li className='v-list-item'>
<div className="content"> <div className="content">
<div className="cover" onClick={props.handleClick}> <div className="cover" onClick={props.handleClick}>
{props.status}
<img src='https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg' alt=""/> <img src='https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg' alt=""/>
</div> </div>
{props.info} {props.info}
......
...@@ -11,14 +11,24 @@ ...@@ -11,14 +11,24 @@
.cover { .cover {
flex: 1 0 auto; flex: 1 0 auto;
margin-right: 16px; margin-right: 16px;
position: relative;
img { img {
width: 150px; width: 150px;
height: 108px; height: 108px;
border-radius: 3px; border-radius: 3px;
} }
} }
.course-status {
width: 100%;
height: 24px;
position: absolute;
bottom: -1px;
border-radius: 0 0 3px 3px;
text-align: center;
line-height: 24px;
color: $white;
font-size: 13px;
}
} }
} }
\ No newline at end of file
...@@ -2,7 +2,4 @@ ...@@ -2,7 +2,4 @@
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' // 课程状态(试听 正在直播)+封面+标题+ 详情
export { default as Carousel } from './Carousel' // 横向滚动
export { default as Topscroll } from './Topscroll' // 首页头部轮播
export { default as Scroll } from './Scroll' // 首页正常轮播图
export { default as Tag } from './CategoryTag' export { default as Tag } from './CategoryTag'
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Course, Carousel, Scroll, Topscroll} from '../../common' import {Course} from '../../common'
import Scroll from './scroll'
import Topscroll from './topscroll'
import './index.scss'; import './index.scss';
class Index extends Component { class Index extends Component {
...@@ -65,10 +67,18 @@ class Index extends Component { ...@@ -65,10 +67,18 @@ class Index extends Component {
} }
] ]
} }
toSearch() {
window.location.href ='/search'
}
render() { render() {
return ( return (
<div className='index-box'> <div className='index-box'>
<div className='header'>
<img className="logo" src="http://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/img/index/logo.png" alt="" />
<button className='to-app'>APP打开</button>
<i className='iconfont iconiconfront- search' onClick={this.toSearch.bind(this)}></i>
</div>
<Topscroll data={this.state.dataList} height='155px' actheight='168px'></Topscroll> <Topscroll data={this.state.dataList} height='155px' actheight='168px'></Topscroll>
<div className="tabbox"> <div className="tabbox">
...@@ -87,7 +97,8 @@ class Index extends Component { ...@@ -87,7 +97,8 @@ class Index extends Component {
</div> </div>
<div className='category'> <div className='category'>
<h2 className="title">近期直播</h2> <h2 className="title">近期直播</h2>
<Carousel> <div className='scroll-box'>
<ul className='scroll-list'>
{ {
this.state.dataList.map((item, index) => { this.state.dataList.map((item, index) => {
return ( return (
...@@ -104,7 +115,9 @@ class Index extends Component { ...@@ -104,7 +115,9 @@ class Index extends Component {
) )
}) })
} }
</Carousel> </ul>
</div>
<div className="category-vip"> <div className="category-vip">
<a href="/#"> <a href="/#">
<img <img
......
.index-box { .index-box {
overflow: hidden; overflow: hidden;
background-color: $bg_fff; background-color: $bg_fff;
}
.top-scroll { .header {
margin-top: 15px; width: 100%;
height: 44px;
background-color: $bg_fff;
padding: 10px 15px;
.logo {
width: 78px;
height: 20px;
}
.to-app {
margin-left: 10px;
width: 88px;
height: 22px;
border: 1px solid $bg_active;
border-radius: 11px;
background-color: $bg_fff;
font-size: 12px;
color: $active;
vertical-align: top;
}
.search {
font-size: 22px!important;
float: right;
margin-top: -6px;
}
}
.top-scroll {
touch-action: pan-y;
margin-top: 7px;
height: 168px; height: 168px;
position: relative; position: relative;
...@@ -19,25 +49,28 @@ ...@@ -19,25 +49,28 @@
.slider-decorator-0 { .slider-decorator-0 {
position: absolute; position: absolute;
top: 125px; top: 125px;
.am-carousel-wrap { .am-carousel-wrap {
text-align: right; text-align: right;
padding-right: 50px; padding-right: 50px;
} }
} }
} }
/*热门推荐轮播*/
/*热门推荐轮播*/ .scroll {
.scroll {
width: 100%; width: 100%;
margin-left: 0 !important; margin-left: 0 !important;
margin-top: 12px; margin-top: 12px;
margin-bottom: 5px; margin-bottom: 5px;
} touch-action: pan-y;
}
/* /*
页面tab 页面tab
*/ */
.tabbox { .tabbox {
width: 100%; width: 100%;
height: 103px; height: 103px;
padding: 20px 17px; padding: 20px 17px;
...@@ -58,18 +91,28 @@ ...@@ -58,18 +91,28 @@
span { span {
color: $color_606; color: $color_606;
font-size: 13px; font-size: 14px;
display: block; display: block;
margin-top: 10px; margin-top: 10px;
} }
} }
} }
} }
/* /*
近期直播 近期直播
*/ */
.scroll-item { .scroll-box {
width: 100%;
overflow: auto;
position: relative;
margin-top: 15px;
.scroll-list {
height: 100%;
display: flex;
overflow: hidden;
position: absolute;
.scroll-item {
display: inline-block; display: inline-block;
width: 301px; width: 301px;
height: 100%; height: 100%;
...@@ -99,12 +142,12 @@ ...@@ -99,12 +142,12 @@
} }
.item-title { .item-title {
font-size: 15px; font-size: 16px;
color: $color_333; color: $color_333;
} }
.item-teacher { .item-teacher {
font-size: 13px; font-size: 14px;
color: $color_555; color: $color_555;
margin-top: 6px; margin-top: 6px;
} }
...@@ -115,9 +158,14 @@ ...@@ -115,9 +158,14 @@
margin-top: 11px; margin-top: 11px;
} }
} }
} }
}
}::-webkit-scrollbar{
display:none;
}
.category-vip { .category-vip {
width: 100%; width: 100%;
height: 106px; height: 106px;
border-radius: 5px; border-radius: 5px;
...@@ -128,17 +176,17 @@ ...@@ -128,17 +176,17 @@
height: 106px; height: 106px;
border-radius: 5px; border-radius: 5px;
} }
} }
/*课程公共样式*/ /*课程公共样式*/
.category { .category {
width: 100%; width: 100%;
border-top: 8px solid #F3F4F8; border-top: 8px solid #F3F4F8;
padding: 20px 15px 15px 15px; padding: 20px 15px 15px 15px;
.title { .title {
font-size: 15px; font-size: 16px;
color: $color_333; color: $color_333;
display: inline-block; display: inline-block;
} }
...@@ -148,9 +196,9 @@ ...@@ -148,9 +196,9 @@
font-size: 12px; font-size: 12px;
float: right; float: right;
} }
} }
.course-detail { .course-detail {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -181,7 +229,7 @@ ...@@ -181,7 +229,7 @@
.new { .new {
color: $red; color: $red;
font-size: 15px; font-size: 16px;
} }
.old { .old {
...@@ -205,27 +253,27 @@ ...@@ -205,27 +253,27 @@
text-align: center; text-align: center;
line-height: 18px; line-height: 18px;
} }
} }
/* /*
横向滚动 横向滚动
*/ */
.scroll-box { .scroll-box {
height: 92px; height: 92px;
} }
/* /*
底部查看所有课程 底部查看所有课程
*/ */
.all-course { .all-course {
text-align: center; text-align: center;
padding-bottom: 30px; padding-bottom: 30px;
margin-bottom: 50px; margin-bottom: 50px;
p { p {
color: $color_555; color: $color_555;
font-size: 15px; font-size: 16px;
margin-bottom: 10px; margin-bottom: 10px;
} }
...@@ -233,5 +281,6 @@ ...@@ -233,5 +281,6 @@
color: $color_999; color: $color_999;
font-size: 12px; font-size: 12px;
} }
} }
}
\ No newline at end of file
import React, {Component} from 'react'; import React, {Component} from 'react';
import { Carousel, WingBlank } from 'antd-mobile'; import { Carousel, WingBlank } from 'antd-mobile';
class Scroll extends Component { export default class Scroll extends Component {
render() { render() {
return ( return (
<WingBlank className='scroll'> <WingBlank className='scroll'>
...@@ -32,5 +32,5 @@ class Scroll extends Component { ...@@ -32,5 +32,5 @@ class Scroll extends Component {
} }
} }
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 { export default class Topscroll extends Component {
state = { state = {
slideIndex:0 slideIndex:0
} }
...@@ -53,4 +53,3 @@ class Topscroll extends Component { ...@@ -53,4 +53,3 @@ class Topscroll extends Component {
} }
} }
export default Topscroll
.class-child { .class-child {
.search-nav {
height: 44px;
line-height: 44px;
padding: 0 15px;
background-color: $bg_f7f9fc;
display: flex;
justify-content: space-between;
.am-search {
width: 81%;
background-color: $bg_f7f9fc;
}
.am-search-input,.am-search-synthetic-ph,.am-search-value{
text-align: left;
padding-left: 15px;
height: 26px;
line-height: 26px;
}
.am-search-input {
background-color: $bg_EBEFF5;
border-radius: 13px;
}
.shopping-cart,.return {
font-size: 18px !important;
}
}
.class-content {
padding: 0 12px; padding: 0 12px;
position: relative; position: relative;
.v-list-item { .v-list-item {
padding: 10px 0 0; padding: 10px 0 0;
...@@ -14,12 +46,18 @@ ...@@ -14,12 +46,18 @@
img { img {
width: 100%; width: 100%;
} }
.course-status {
background-color: rgba(224, 46, 36, 0.6);
}
} }
} }
.info { .info {
width: 52.3%; width: 52.3%;
position: relative; position: relative;
display: block;
.title { .title {
font-size: 16px; font-size: 16px;
...@@ -42,7 +80,7 @@ ...@@ -42,7 +80,7 @@
.course-price { .course-price {
.new { .new {
color: $red; color: $red;
font-size: 15px; font-size: 16px;
} }
.old { .old {
...@@ -72,24 +110,49 @@ ...@@ -72,24 +110,49 @@
.tabs { .tabs {
display: flex; display: flex;
margin-top: 10px; margin-top: 10px;
margin-bottom: 50px;
} }
.pull-down { .pull-down {
width: 32px; width: 32px;
position: absolute; position: absolute;
top: 12px; top: 4px;
right: 0; right: 0;
z-index: 2; z-index: 2;
background-color: $bg_fff; background-color: $bg_fff;
color: $color_666; color: $color_666;
} }
.am-tabs-tab-bar-wrap {
padding-right: 20px;
}
.am-tabs-default-bar-tab {
width: auto !important;
margin-right: 20px;
}
.am-tabs-default-bar-tab-active {
color: $active;
border-bottom: 2px solid $active !important;
}
.am-tabs-default-bar-underline {
display: none;
}
.am-whitespace.am-whitespace-md {
height: 0 !important;
}
}
.mbc-box { .mbc-box {
position: fixed; position: fixed;
left: 0; left: 0;
top: 53px; top: 88px;
right: 0; right: 0;
bottom: 0; bottom: 0;
background-color: rgba(0,0,0,.6); background-color: rgba(0, 0, 0, .6);
.tabcontent { .tabcontent {
width: 100%; width: 100%;
height: 303px; height: 303px;
...@@ -97,13 +160,14 @@ ...@@ -97,13 +160,14 @@
background-color: $bg_fff; background-color: $bg_fff;
border-top: 1px solid $sp_ddd; border-top: 1px solid $sp_ddd;
padding-bottom: 30px; padding-bottom: 30px;
.class-course { .class-course {
width: 100%; width: 100%;
margin-top: 20px; margin-top: 20px;
padding: 0 15px; padding: 0 15px;
.course-items-title { .course-items-title {
font-size: 13px; font-size: 14px;
color: $color_333; color: $color_333;
} }
...@@ -142,11 +206,8 @@ ...@@ -142,11 +206,8 @@
} }
} }
} }
} }
html:not([data-scale]) .am-tabs-default-bar-top .am-tabs-default-bar-tab::after { html:not([data-scale]) .am-tabs-default-bar-top .am-tabs-default-bar-tab::after {
background-color: $bg_fff; background-color: $bg_fff;
} }
.am-tabs-tab-bar-wrap {
padding-right: 30px;
}
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
padding: 0 15px; padding: 0 15px;
.course-items-title { .course-items-title {
font-size: 13px; font-size: 14px;
color: $color_333; color: $color_333;
img { img {
......
...@@ -37,6 +37,7 @@ $bg_000: #000; ...@@ -37,6 +37,7 @@ $bg_000: #000;
$bg_f4f4f4: #f4f4f4; $bg_f4f4f4: #f4f4f4;
$bg_f5f5f5: #f5f5f5; $bg_f5f5f5: #f5f5f5;
$bg_f7f9fc: #f7f9fc; $bg_f7f9fc: #f7f9fc;
$bg_EBEFF5: #EBEFF5;
/* /*
......
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