index.js 3.42 KB
Newer Older
zhanghaozhe committed
1
import React from 'react'
zhanghaozhe committed
2
import { Course, Tag } from '../../../common'
zhanghaozhe committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112


import './free-courses.scss'

const mockData = [
    {
        tagText: '机器学习',
        tagType: 1,
        title: '16年度最火课程TOP10',
        src: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg',
    },
    {
        tagText: '机器学习',
        tagType: 1,
        title: '16年度最火课程TOP10',
        src: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg',
    },
    {
        tagText: '机器学习',
        tagType: 1,
        title: '16年度最火课程TOP10',
        src: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg',
    },
    {
        tagText: '机器学习',
        tagType: 1,
        title: '16年度最火课程TOP10',
        src: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg',
    },
    {
        tagText: '机器学习',
        tagType: 1,
        title: '16年度最火课程TOP10',
        src: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg',
    },
    {
        tagText: '机器学习',
        tagType: 1,
        title: '16年度最火课程TOP10',
        src: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg',
    },
    {
        tagText: '机器学习',
        tagType: 1,
        title: '16年度最火课程TOP10',
        src: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg',
    },
    {
        tagText: '机器学习',
        tagType: 1,
        title: '16年度最火课程TOP10',
        src: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg',
    },
    {
        tagText: '机器学习',
        tagType: 1,
        title: '16年度最火课程TOP10',
        src: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg',
    },
    {
        tagText: '机器学习',
        tagType: 1,
        title: '16年度最火课程TOP10',
        src: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg',
    },
    {
        tagText: '机器学习',
        tagType: 1,
        title: '16年度最火课程TOP10',
        src: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg',
    },
    {
        tagText: '机器学习',
        tagType: 1,
        title: '16年度最火课程TOP10',
        src: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg',
    },
]

const Bottom = (props) => (
    <div className='bottom'>
        <Tag className={props.className}>{props.tagText}</Tag>
        <span>{props.audience}人观看</span>
    </div>
)


const FreeCourse = (props) => {
    return (
        <ul className='free-courses'>
            {
                mockData.map((item, index) => (
                    <Course
                        data={item}
                        top={
                            <Tag className={'tag-starting top'}>即将开始</Tag>
                        }
                        bottom={
                            <Bottom audience={232} className={'tag-category'} tagText={item.tagText}></Bottom>
                        }
                        key={index}
                    >
                    </Course>
                ))
            }
        </ul>
    )
}

export default FreeCourse