import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import './index.less'; import { Icon } from 'antd'; import Page from '@src/containers/Page'; import Assets from '@src/components/Assets'; import UserLayout from '../../../layouts/User'; import Button from '../../../components/Button'; import ProgressText from '../../../components/ProgressText'; import { Icon as GIcon } from '../../../components/Icon'; import menu from '../index'; import Tabs from '../../../components/Tabs'; import UserTable from '../../../components/UserTable'; import More from '../../../components/More'; export default class extends Page { initState() { return { tab1: '2', tab2: '1', data: [ { status: 'ing', history: [{}], list: [ { status: 'ing', type: '1' }, { status: 'not', type: '2' }, { status: 'end', type: '3' }, { status: 'not', type: '4' }, { status: 'end', type: '5' }, { status: 'not', type: '6' }, { status: 'end', type: '7' }, ], }, { status: 'not', history: [{}], list: [ { status: 'ing', type: '1' }, { status: 'not', type: '2' }, { status: 'end', type: '3' }, { status: 'not', type: '4' }, { status: 'end', type: '5' }, { status: 'not', type: '6' }, { status: 'end', type: '7' }, ], }, { status: 'end', history: [{}], list: [] }, ], }; } onAction() {} refresh(tab1, tab2) { this.setState({ tab1, tab2 }); } renderView() { const { config } = this.props; return ; } renderDetail() { const { tab1, tab2 } = this.state; return (
理清备考思路,避开常见误区,让学习的每一分钟发光发热!
去填写 >
this.refresh(key, tab2)} /> this.refresh(tab1, key)} /> {this[`renderTab${tab1}`]()}
); } renderTab1() { const { data = [] } = this.state; return data.map(item => { return ; }); } renderTab2() { const { data = [] } = this.state; return data.map(item => { return ; }); } } class Course extends Component { constructor(props) { super(props); this.columns = [ { title: '学习内容' }, { title: '预习作业' }, { title: '进度' }, { title: '最近学习' }, { title: '笔记' }, { title: '问答' }, ]; this.state = { open: false }; } render() { const { data = {} } = this.props; switch (data.status) { case 'ing': return this.renderIng(); case 'not': return this.renderNot(); case 'end': return this.renderEnd(); default: return
; } } renderIng() { const { data } = this.props; const { history = [] } = data; return (
学习中
OG20整合刷题-语法SC
继续学习:课时 13:解读句子属性
授课老师
李小小
有效期
88Day
12/20
12/20
12/20
12/20
); } renderNot() { return (
未开通
OG20整合刷题-语法SC
授课老师
李小小
有效期
88Day
请于 2020-06-26 前开通
); } renderEnd() { return (
已结束
OG20整合刷题-语法SC
授课老师
李小小
有效期
88Day
12/20
12/20
12/20
12/20
); } } class Education extends Component { constructor(props) { super(props); this.columns = [ { title: '学习内容' }, { title: '预习作业' }, { title: '授课时间' }, { title: '课后笔记' }, { title: '课后补充' }, ]; this.state = { open: true, tab: '1' }; } render() { const { data = {} } = this.props; switch (data.status) { case 'ing': return this.renderIng(); case 'not': return this.renderNot(); case 'end': return this.renderEnd(); default: return
; } } renderIng() { const { tab } = this.state; return (
学习中
OG20整合刷题-语法SC
继续学习:课时 13:解读句子属性
授课老师
李小小
有效期
88Day
12/20
12/20
this.setState({ tab: key })} />
课时 5:解读句子属性
{}} /> 上一课时 下一课时 {}} />
{tab === '1' ? this.renderTimeLine() : this.renderTable()}
); } renderNot() { return (
未开通
OG20整合刷题-语法SC
授课老师
李小小
有效期
88Day
请尽快与老师预约上课时间
请于 2019-07-25 前开通课程
{this.renderTimeLine()}
); } renderEnd() { const { open } = this.state; return (
已结课
OG20整合刷题-语法SC
授课老师
李小小
有效期
88Day
12/20
12/20
this.setState({ open: !open })} />
{open && this.renderTable()}
); } renderTimeLine() { const { data = {} } = this.props; const { list = [] } = data; return (
{list.map(item => { return ; })}
); } renderTable() { const { data = {} } = this.props; const { history = [] } = data; return ; } } class TimeLineItem extends Component { constructor(props) { super(props); this.titleMap = { 1: '预约时间', 2: '答疑文档', 3: '上课', 4: '课后笔记', 5: '课后补充', 6: '备考信息', 7: '完成作业', }; } onClick(key) { const { data = {}, onClick } = this.props; const { status } = data; if (status === 'not') return; if (onClick) onClick(key); } render() { const { data = {} } = this.props; const { status, type } = data; return (
{this.titleMap[type]}
{this.renderDetail()}
); } renderDetail() { const { data = {} } = this.props; const { type, status } = data; switch (type) { case '1': return status === 'not' ? ( 请尽快与老师预约上课时间,扫码加微信 ) : ( 2019-07-24 09:00 ~ 10:00 ); case '2': return 点此上传; case '3': return status === 'end' ? ( CCtalk 频道号 :1234567 CC talk使用手册 ) : ( ); case '4': return 点此上传; case '5': return 写留言; case '6': return [
基本情况梳理 2019-08-20 更新 修改
,
备考细节梳理 填写
, ]; case '7': return ; default: return
; } } }