|
@@ -3,7 +3,10 @@ import './index.less';
|
|
|
import { Link } from 'react-router-dom';
|
|
|
import Page from '@src/containers/Page';
|
|
|
import { asyncConfirm } from '@src/services/AsyncTools';
|
|
|
-import { formatTreeData, getMap } from '@src/services/Tools';
|
|
|
+import { formatTreeData, getMap, formatSeconds, formatDate } from '@src/services/Tools';
|
|
|
+import Continue from '../../../components/Continue';
|
|
|
+import Step from '../../../components/Step';
|
|
|
+import List from '../../../components/List';
|
|
|
import Tabs from '../../../components/Tabs';
|
|
|
import Module from '../../../components/Module';
|
|
|
import Input from '../../../components/Input';
|
|
@@ -14,16 +17,18 @@ import ListTable from '../../../components/ListTable';
|
|
|
import ProgressText from '../../../components/ProgressText';
|
|
|
import IconButton from '../../../components/IconButton';
|
|
|
import { Main } from '../../../stores/main';
|
|
|
+import { My } from '../../../stores/my';
|
|
|
import { Sentence } from '../../../stores/sentence';
|
|
|
import { Question } from '../../../stores/question';
|
|
|
-// import { Course } from '../../../stores/course';
|
|
|
+import { Course } from '../../../stores/course';
|
|
|
+import { User } from '../../../stores/user';
|
|
|
|
|
|
const SENTENCE = 'sentence';
|
|
|
const PREVIEW = 'preview';
|
|
|
const PREVIEW_CLASS = 'PREVIEW_CLASS';
|
|
|
const PREVIEW_LIST = 'PREVIEW_LIST';
|
|
|
|
|
|
-const columns = [
|
|
|
+const exerciseColumns = [
|
|
|
{
|
|
|
title: '练习册',
|
|
|
width: 250,
|
|
@@ -88,19 +93,19 @@ const columns = [
|
|
|
render: item => {
|
|
|
return (
|
|
|
<div className="table-row p-t-1">
|
|
|
- {!item.repport.id && (
|
|
|
- <IconButton type="start" tip="Start" onClick={() => this.previewAction('start', item)} />
|
|
|
+ {!item.report && (
|
|
|
+ <IconButton type="start" tip="Start" onClick={() => this.start('preview', item)} />
|
|
|
)}
|
|
|
- {item.repport.id && (
|
|
|
+ {item.report.id && !item.report.isFinish && (
|
|
|
<IconButton
|
|
|
className="m-r-2"
|
|
|
type="continue"
|
|
|
tip="Continue"
|
|
|
- onClick={() => this.previewAction('continue', item)}
|
|
|
+ onClick={() => this.continue('preview', item)}
|
|
|
/>
|
|
|
)}
|
|
|
- {item.repport.id && (
|
|
|
- <IconButton type="restart" tip="Restart" onClick={() => this.previewAction('restart', item)} />
|
|
|
+ {item.report.id && (
|
|
|
+ <IconButton type="restart" tip="Restart" onClick={() => this.restart('preview', item)} />
|
|
|
)}
|
|
|
</div>
|
|
|
);
|
|
@@ -113,7 +118,7 @@ const columns = [
|
|
|
render: item => {
|
|
|
return (
|
|
|
<div className="table-row p-t-1">
|
|
|
- {item.report.userNumber === item.report.questionNumber && <IconButton type="report" tip="Report" />}
|
|
|
+ {item.report.isFinish && <IconButton type="report" tip="Report" onClick={() => this.viewReport(item)} />}
|
|
|
</div>
|
|
|
);
|
|
|
},
|
|
@@ -121,38 +126,162 @@ const columns = [
|
|
|
];
|
|
|
|
|
|
export default class extends Page {
|
|
|
+ constructor(props) {
|
|
|
+ super(props);
|
|
|
+ this.sentenceColums = [
|
|
|
+ {
|
|
|
+ title: '练习册',
|
|
|
+ width: 250,
|
|
|
+ align: 'left',
|
|
|
+ render: (record) => {
|
|
|
+ let progress = 0;
|
|
|
+ if (record.report) {
|
|
|
+ progress = record.report.userNumber * 100 / record.report.questionNumber;
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <div className="table-row">
|
|
|
+ <div className="night f-s-16">{record.title}</div>
|
|
|
+ <div>
|
|
|
+ <ProgressText progress={progress} size="small" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '正确率',
|
|
|
+ width: 150,
|
|
|
+ align: 'left',
|
|
|
+ render: (record) => {
|
|
|
+ let correct = '--';
|
|
|
+ if (record.report) {
|
|
|
+ correct = `${record.report.userCorrect * 100 / record.report.userNumber}%`;
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <div className="table-row">
|
|
|
+ <div className="night f-s-16 f-w-b">{correct}</div>
|
|
|
+ <div className="f-s-12">全站{record.stat.totalCorrect * 100 / record.stat.totalNumber}%</div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '全站用时',
|
|
|
+ width: 150,
|
|
|
+ align: 'left',
|
|
|
+ render: (record) => {
|
|
|
+ let time = '--';
|
|
|
+ if (record.paper) {
|
|
|
+ time = record.paper.report.userTime / record.paper.report.userNumber;
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <div className="table-row">
|
|
|
+ <div className="night f-s-16 f-w-b">{formatSeconds(time)}</div>
|
|
|
+ <div className="f-s-12">全站{formatSeconds(record.stat.totalTime / record.stat.totalNumber)}</div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '最近做题',
|
|
|
+ width: 150,
|
|
|
+ align: 'left',
|
|
|
+ render: (record) => {
|
|
|
+ if (!record.report) return null;
|
|
|
+ return (
|
|
|
+ <div className="table-row">
|
|
|
+ <div>{formatDate(record.report.updateTime, 'YYYY-MM-DD')}</div>
|
|
|
+ <div>{formatDate(record.report.updateTime, 'HH:mm')}</div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ width: 180,
|
|
|
+ align: 'left',
|
|
|
+ render: (record) => {
|
|
|
+ return (
|
|
|
+ <div className="table-row p-t-1">
|
|
|
+ {!record.report && <IconButton type="start" tip="Start" onClick={() => {
|
|
|
+ this.start('sentence', record);
|
|
|
+ }} />}
|
|
|
+ {!record.report.isFinish && <IconButton className="m-r-2" type="continue" tip="Continue" onClick={() => {
|
|
|
+ this.continue('sentence', record);
|
|
|
+ }} />}
|
|
|
+ <IconButton type="restart" tip="Restart" onClick={() => {
|
|
|
+ this.restart(record);
|
|
|
+ }} />
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '报告',
|
|
|
+ dataIndex: 'report',
|
|
|
+ width: 30,
|
|
|
+ align: 'right',
|
|
|
+ render: (text, record) => {
|
|
|
+ if (!record.report || !record.report.isFinish) return null;
|
|
|
+ return (
|
|
|
+ <div className="table-row p-t-1">
|
|
|
+ <IconButton type="report" tip="Report" onClick={() => {
|
|
|
+ this.viewReport(record);
|
|
|
+ }} />
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
initState() {
|
|
|
this.code = null;
|
|
|
- this.columns = columns;
|
|
|
- this.exerciseProcess = {};
|
|
|
+ this.columns = exerciseColumns;
|
|
|
+ this.exerciseProgress = {};
|
|
|
+ this.inited = false;
|
|
|
return {
|
|
|
- tab1: PREVIEW,
|
|
|
+ tab1: SENTENCE,
|
|
|
tab2: '',
|
|
|
- previewType: PREVIEW_CLASS,
|
|
|
+ pt: PREVIEW_CLASS,
|
|
|
tabs: [],
|
|
|
allClass: [],
|
|
|
classProcess: {},
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- initData() {
|
|
|
+ init() {
|
|
|
Main.getExercise().then(result => {
|
|
|
const list = result.map((row) => {
|
|
|
row.title = `${row.titleZh}${row.titleEn}`;
|
|
|
row.key = row.extend;
|
|
|
return row;
|
|
|
});
|
|
|
- const tabs = formatTreeData(list);
|
|
|
+ const map = getMap(list, 'key');
|
|
|
+ const tabs = formatTreeData(list, 'id', 'title', 'parentId');
|
|
|
tabs.push({ key: PREVIEW, name: '预习作业' });
|
|
|
- const map = getMap(tabs, 'key');
|
|
|
this.setState({ tabs, map });
|
|
|
+ this.inited = true;
|
|
|
+ this.refreshData();
|
|
|
});
|
|
|
- this.refresh();
|
|
|
}
|
|
|
|
|
|
- refresh() {
|
|
|
+ initData() {
|
|
|
+ const { info = {} } = this.props.user;
|
|
|
+ if (info.latestExercise) {
|
|
|
+ // 获取最后一次做题记录
|
|
|
+ Question.baseReport(info.latestExercise).then((result) => {
|
|
|
+ this.setState({ latest: result });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ const data = Object.assign(this.state, this.state.search);
|
|
|
+ this.setState(data);
|
|
|
+ if (this.inited) this.refreshData();
|
|
|
+ }
|
|
|
+
|
|
|
+ refreshData(tab) {
|
|
|
const { tab1 } = this.state;
|
|
|
- switch (tab1) {
|
|
|
+ switch (tab || tab1) {
|
|
|
case SENTENCE:
|
|
|
this.refreshSentence();
|
|
|
break;
|
|
@@ -160,29 +289,92 @@ export default class extends Page {
|
|
|
this.refreshPreview();
|
|
|
break;
|
|
|
default:
|
|
|
- this.refreshExercise();
|
|
|
+ this.refreshExercise(tab || tab1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
refreshSentence() {
|
|
|
- Sentence.getInfo().then(result => {
|
|
|
- this.setState({ sentence: result });
|
|
|
- });
|
|
|
- Sentence.listArticle().then(result => {
|
|
|
- const articleMap = {};
|
|
|
- result.forEach((article) => {
|
|
|
- if (!articleMap[article.chapter]) {
|
|
|
- articleMap[article.chapter] = [];
|
|
|
- }
|
|
|
- articleMap[article.chapter].push(article);
|
|
|
- });
|
|
|
- this.setState({ articleMap });
|
|
|
- });
|
|
|
+ const { sentence } = this.state;
|
|
|
+ if (!sentence) {
|
|
|
+ // User.clearSentenceTrail();
|
|
|
+ Sentence.getInfo().then(result => {
|
|
|
+ // result.code = '123123';
|
|
|
+ result.trailPages = 20;
|
|
|
+ this.setState({ sentence: result });
|
|
|
+ return result;
|
|
|
+ })
|
|
|
+ .then(({ code, trailPages, chapters }) => {
|
|
|
+ return Sentence.listArticle().then(result => {
|
|
|
+ const chapterSteps = [];
|
|
|
+ const chapterMap = {};
|
|
|
+ const map = {};
|
|
|
+ const trailArticles = [];
|
|
|
+ let totalPage = 0;
|
|
|
+ let introduction = null;
|
|
|
+ let exerciseChapter = null;
|
|
|
+ let index = 0;
|
|
|
+ let lastChapter = -1;
|
|
|
+
|
|
|
+ chapters.forEach(row => {
|
|
|
+ chapterMap[row.value] = row;
|
|
|
+ if (row.exercise) exerciseChapter = row;
|
|
|
+ });
|
|
|
+
|
|
|
+ result.forEach((article) => {
|
|
|
+ if (article.chapter === 0) introduction = article;
|
|
|
+ if (!map[article.chapter]) {
|
|
|
+ map[article.chapter] = [];
|
|
|
+ }
|
|
|
+ article.startPage = totalPage + 1;
|
|
|
+ article.endPage = totalPage + article.pages;
|
|
|
+ if (article.chapter) {
|
|
|
+ article.position = `${article.chapter}.${article.part}`;
|
|
|
+ } else {
|
|
|
+ // 设置list中的样式
|
|
|
+ article.style = 'introduction';
|
|
|
+ }
|
|
|
+ totalPage += article.pages;
|
|
|
+ if (article.startPage < trailPages) {
|
|
|
+ if (lastChapter !== article.chapter) {
|
|
|
+ lastChapter = article.chapter;
|
|
|
+ trailArticles.push(Object.assign({ articles: [] }, chapterMap[article.chapter] || {}));
|
|
|
+ }
|
|
|
+ trailArticles[trailArticles.length - 1].articles.push(article);
|
|
|
+ }
|
|
|
+ map[article.chapter].push(article);
|
|
|
+ });
|
|
|
+
|
|
|
+ if (!code) {
|
|
|
+ chapterSteps.push(`「${index}」试用`);
|
|
|
+ }
|
|
|
+ // 添加前言
|
|
|
+ if (introduction) {
|
|
|
+ index += 1;
|
|
|
+ chapterSteps.push(`「${index}」${introduction.title}`);
|
|
|
+ chapterMap[0] = {
|
|
|
+ title: introduction.title,
|
|
|
+ value: 0,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ index += 1;
|
|
|
+ chapters.forEach(row => {
|
|
|
+ chapterSteps.push(`「${index}」${row.short}`);
|
|
|
+ index += 1;
|
|
|
+ });
|
|
|
+ this.setState({ articleMap: map, trailArticles, chapterSteps, introduction, chapterMap, exerciseChapter });
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return Sentence.listPaper().then(result => {
|
|
|
+ this.setState({ paperList: result, paperFilterList: result });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
refreshPreview() {
|
|
|
- const { previewType } = this.state;
|
|
|
- switch (previewType) {
|
|
|
+ const { pt } = this.state;
|
|
|
+ switch (pt) {
|
|
|
case PREVIEW_LIST:
|
|
|
this.refreshListPreview();
|
|
|
break;
|
|
@@ -194,7 +386,7 @@ export default class extends Page {
|
|
|
}
|
|
|
|
|
|
refreshClassProcess() {
|
|
|
- Question.getClassProcess().then(result => {
|
|
|
+ Course.classProcess().then(result => {
|
|
|
const classProcess = {};
|
|
|
for (let i = 0; i < result.length; i += 1) {
|
|
|
const item = result[i];
|
|
@@ -210,36 +402,39 @@ export default class extends Page {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- refreshExercise() {
|
|
|
+ refreshExercise(tab) {
|
|
|
const { map, tab1 } = this.state;
|
|
|
let { tab2 } = this.state;
|
|
|
- const subject = map[tab1];
|
|
|
- if (tab2 === '') {
|
|
|
- tab2 = subject.children[0].key;
|
|
|
- this.onChangeTab(2, tab2);
|
|
|
+ if (!map) {
|
|
|
+ // 等待数据加载
|
|
|
return;
|
|
|
}
|
|
|
+ const subject = map[tab];
|
|
|
+ // 切换tab1的情况
|
|
|
+ if (tab2 === '' || tab1 !== tab) {
|
|
|
+ tab2 = subject.children[0].key;
|
|
|
+ this.setState({ tab2 });
|
|
|
+ }
|
|
|
const type = map[tab2];
|
|
|
Main.getExerciseChildren(type.id, true).then(result => {
|
|
|
const exerciseChild = result;
|
|
|
this.setState({ exerciseChild });
|
|
|
});
|
|
|
- Question.getExerciseProcess(type.id).then((r => {
|
|
|
- const exerciseProcess = getMap(r, 'id');
|
|
|
- this.setState({ exerciseProcess });
|
|
|
+ Question.getExerciseProgress(type.id).then((r => {
|
|
|
+ const exerciseProgress = getMap(r, 'id');
|
|
|
+ this.setState({ exerciseProgress });
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
onChangePreviewType(type) {
|
|
|
- this.setState({ previewType: type });
|
|
|
+ this.setState({ pt: type });
|
|
|
this.refreshPreview();
|
|
|
}
|
|
|
|
|
|
onChangeTab(level, tab) {
|
|
|
- const state = {};
|
|
|
- state[`tab${level}`] = tab;
|
|
|
- this.setState(state);
|
|
|
- this.refresh();
|
|
|
+ const { tab1, tab2 } = this.state;
|
|
|
+ // this.refreshData(tab);
|
|
|
+ this.refreshQuery(Object.assign({ tab1, tab2 }, { [`tab${level}`]: tab }));
|
|
|
}
|
|
|
|
|
|
previewAction(type, item) {
|
|
@@ -274,18 +469,69 @@ export default class extends Page {
|
|
|
linkTo(`/paper/process/${type}/${item.id}?r=${item.report.id}`);
|
|
|
}
|
|
|
|
|
|
+ viewReport(item) {
|
|
|
+ linkTo(`/paper/report/${item.report.id}`);
|
|
|
+ }
|
|
|
+
|
|
|
activeSentence() {
|
|
|
Sentence.active(this.code)
|
|
|
.then(() => {
|
|
|
+ // 重新获取长难句信息
|
|
|
+ User.clearSentenceTrail();
|
|
|
+ this.setState({ sentence: null, articleMap: null, paperList: null });
|
|
|
this.refresh();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ trailSentence() {
|
|
|
+ this.setState({ sentenceInput: false });
|
|
|
+ User.sentenceTrail();
|
|
|
+ }
|
|
|
+
|
|
|
+ sentenceRead(article) {
|
|
|
+ if (article) {
|
|
|
+ linkTo(`/sentence/read?chapter=${article.chapter}&part=${article.part}`);
|
|
|
+ } else {
|
|
|
+ linkTo('/sentence/read');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ sentenceFilter(value) {
|
|
|
+ const { paperList } = this.state;
|
|
|
+ const list = paperList.filter(row => {
|
|
|
+ const finish = row.paper ? row.paper.times > 0 : false;
|
|
|
+ if (value === 0) {
|
|
|
+ return !finish;
|
|
|
+ }
|
|
|
+ return finish;
|
|
|
+ });
|
|
|
+ this.setState({ paperFilterList: list, paperChecked: value });
|
|
|
+ }
|
|
|
+
|
|
|
+ clearExercise() {
|
|
|
+ My.clearLatestExercise();
|
|
|
+ this.setState({ latest: null });
|
|
|
+ }
|
|
|
+
|
|
|
renderView() {
|
|
|
- const { tab1 = {}, tab2 = {}, tabs, map = {} } = this.state;
|
|
|
+ const { tab1 = {}, tab2 = {}, tabs, map = {}, latest } = this.state;
|
|
|
const children = (map[tab1] || {}).children || [];
|
|
|
return (
|
|
|
<div>
|
|
|
+ {latest && <Continue
|
|
|
+ data={latest}
|
|
|
+ onClose={() => {
|
|
|
+ this.clearExercise();
|
|
|
+ }}
|
|
|
+ onContinue={() => {
|
|
|
+
|
|
|
+ }}
|
|
|
+ onRestart={() => {
|
|
|
+
|
|
|
+ }}
|
|
|
+ onNext={() => {
|
|
|
+
|
|
|
+ }} />}
|
|
|
<div className="content">
|
|
|
<Module className="m-t-2">
|
|
|
<Tabs type="card" active={tab1} tabs={tabs} onChange={key => {
|
|
@@ -365,16 +611,97 @@ export default class extends Page {
|
|
|
}
|
|
|
|
|
|
renderSentence() {
|
|
|
- const { sentence = {}, trail = false } = this.state;
|
|
|
- if (sentence.code || trail) {
|
|
|
+ const { sentence = {}, sentenceInput } = this.state;
|
|
|
+ const { sentenceTrail } = this.props.user;
|
|
|
+ if (sentenceInput !== true && (sentence.code || sentenceTrail)) {
|
|
|
return this.renderSentenceArticle();
|
|
|
}
|
|
|
return this.renderInputCode();
|
|
|
}
|
|
|
|
|
|
renderSentenceArticle() {
|
|
|
- // const { sentence = {}, trail } = this.state;
|
|
|
- return <div />;
|
|
|
+ const { sentence = {}, introduction, chapterSteps, chapterStep = 1, exerciseChapter = {}, chapterMap = {}, articleMap = {}, trailArticles = [], paperFilterList = [], paperList = [], paperChecked } = this.state;
|
|
|
+ const { sentenceTrail } = this.props.user;
|
|
|
+ let maxStep = 0;
|
|
|
+ if (sentenceTrail) {
|
|
|
+ // 试用只能访问第一step
|
|
|
+ maxStep = 1;
|
|
|
+ // 查找练习章节
|
|
|
+ }
|
|
|
+ // 减去前言计算chapter
|
|
|
+ const chapter = introduction ? chapterStep - 1 : chapterStep;
|
|
|
+ const chapterInfo = chapterMap[chapter] || {};
|
|
|
+ let isExercise = false;
|
|
|
+ if (chapterInfo && chapterInfo.exercise) {
|
|
|
+ isExercise = true;
|
|
|
+ }
|
|
|
+ return <div>
|
|
|
+ {sentence.code && <div className='sentence-code'>CODE: {sentence.code}</div>}
|
|
|
+ {sentenceTrail && <div className='sentence-code'>CODE: <Link to=''>去获取</Link><a onClick={() => {
|
|
|
+ this.setState({ sentenceInput: true });
|
|
|
+ }}>输入</a></div>}
|
|
|
+ <Module>
|
|
|
+ <Step
|
|
|
+ list={chapterSteps}
|
|
|
+ step={chapterStep}
|
|
|
+ onClick={(step) => {
|
|
|
+ this.setState({ chapterStep: step });
|
|
|
+ }}
|
|
|
+ message='请购买后访问'
|
|
|
+ maxStep={maxStep}
|
|
|
+ />
|
|
|
+ </Module>
|
|
|
+ {/* 正常前言 */}
|
|
|
+ {sentence.code && chapter === 0 && <List
|
|
|
+ // title={chapterInfo.title}
|
|
|
+ list={[introduction]}
|
|
|
+ onClick={() => {
|
|
|
+ this.sentenceRead();
|
|
|
+ }}
|
|
|
+ />}
|
|
|
+ {/* 正常文章 */}
|
|
|
+ {sentence.code && chapter && !isExercise && <List
|
|
|
+ position={`Chapter${chapter}`}
|
|
|
+ title={chapterInfo.title}
|
|
|
+ list={articleMap[chapter]}
|
|
|
+ onClick={(part) => {
|
|
|
+ this.sentenceRead(part);
|
|
|
+ }}
|
|
|
+ />}
|
|
|
+ {/* 正常练习 */}
|
|
|
+ {sentence.code && isExercise && <ListTable
|
|
|
+ position={`Chapter${chapter}`}
|
|
|
+ title={chapterInfo.title}
|
|
|
+ filters={[{
|
|
|
+ type: 'radio',
|
|
|
+ checked: paperChecked,
|
|
|
+ list: [{ key: 0, title: '未完成' }, { key: 1, title: '已完成' }],
|
|
|
+ onChange: (item) => {
|
|
|
+ this.sentenceFilter(item.key);
|
|
|
+ },
|
|
|
+ }]}
|
|
|
+ data={paperFilterList}
|
|
|
+ columns={this.sentenceColums}
|
|
|
+ />}
|
|
|
+ {/* 试读文章 */}
|
|
|
+ {sentenceTrail && trailArticles.map((info) => {
|
|
|
+ return <List
|
|
|
+ position={info.value ? `Chapter${info.value}` : null}
|
|
|
+ title={info.title}
|
|
|
+ list={info.articles}
|
|
|
+ onClick={(part) => {
|
|
|
+ this.sentenceRead(part);
|
|
|
+ }}
|
|
|
+ />;
|
|
|
+ })}
|
|
|
+ {/* 试练 */}
|
|
|
+ {sentenceTrail && <ListTable
|
|
|
+ position={`Chapter${exerciseChapter.value}`}
|
|
|
+ title={exerciseChapter.title}
|
|
|
+ data={paperList}
|
|
|
+ columns={this.sentenceColums}
|
|
|
+ />}
|
|
|
+ </div>;
|
|
|
}
|
|
|
|
|
|
renderInputCode() {
|
|
@@ -398,7 +725,7 @@ export default class extends Page {
|
|
|
去获取 >>
|
|
|
</Link>
|
|
|
<a onClick={() => {
|
|
|
- this.setState({ trail: true });
|
|
|
+ this.trailSentence();
|
|
|
}} className="right link">
|
|
|
试用 >>
|
|
|
</a>
|