|
@@ -1,6 +1,6 @@
|
|
|
import React from 'react';
|
|
|
import './index.less';
|
|
|
-import { Modal } from 'antd';
|
|
|
+import { Modal, Tooltip } from 'antd';
|
|
|
import { Link } from 'react-router-dom';
|
|
|
import Page from '@src/containers/Page';
|
|
|
import { asyncConfirm } from '@src/services/AsyncTools';
|
|
@@ -96,9 +96,7 @@ const exerciseColumns = [
|
|
|
render: item => {
|
|
|
return (
|
|
|
<div className="table-row p-t-1">
|
|
|
- {!item.report && (
|
|
|
- <IconButton type="start" tip="Start" onClick={() => Question.startLink('preview', item)} />
|
|
|
- )}
|
|
|
+ {!item.report && <IconButton type="start" tip="Start" onClick={() => Question.startLink('preview', item)} />}
|
|
|
{item.report.id && !item.report.isFinish && (
|
|
|
<IconButton
|
|
|
className="m-r-2"
|
|
@@ -107,9 +105,7 @@ const exerciseColumns = [
|
|
|
onClick={() => Question.continueLink('preview', item)}
|
|
|
/>
|
|
|
)}
|
|
|
- {item.report.id && (
|
|
|
- <IconButton type="restart" tip="Restart" onClick={() => this.restart('preview', item)} />
|
|
|
- )}
|
|
|
+ {item.report.id && <IconButton type="restart" tip="Restart" onClick={() => this.restart('preview', item)} />}
|
|
|
</div>
|
|
|
);
|
|
|
},
|
|
@@ -136,7 +132,7 @@ export default class extends Page {
|
|
|
title: '练习册',
|
|
|
width: 250,
|
|
|
align: 'left',
|
|
|
- render: (record) => {
|
|
|
+ render: record => {
|
|
|
let progress = 0;
|
|
|
if (record.report) {
|
|
|
progress = formatPercent(record.report.userNumber, record.report.questionNumber);
|
|
@@ -155,7 +151,7 @@ export default class extends Page {
|
|
|
title: '正确率',
|
|
|
width: 150,
|
|
|
align: 'left',
|
|
|
- render: (record) => {
|
|
|
+ render: record => {
|
|
|
let correct = '--';
|
|
|
if (record.report) {
|
|
|
correct = formatPercent(record.report.userCorrect, record.report.userNumber, false);
|
|
@@ -163,7 +159,9 @@ export default class extends Page {
|
|
|
return (
|
|
|
<div className="table-row">
|
|
|
<div className="night f-s-16 f-w-b">{correct}</div>
|
|
|
- <div className="f-s-12">全站{formatPercent(record.stat.totalCorrect, record.stat.totalNumber, false)}</div>
|
|
|
+ <div className="f-s-12">
|
|
|
+ 全站{formatPercent(record.stat.totalCorrect, record.stat.totalNumber, false)}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
);
|
|
|
},
|
|
@@ -172,7 +170,7 @@ export default class extends Page {
|
|
|
title: '全站用时',
|
|
|
width: 150,
|
|
|
align: 'left',
|
|
|
- render: (record) => {
|
|
|
+ render: record => {
|
|
|
let time = '--';
|
|
|
if (record.report) {
|
|
|
time = formatSeconds(record.report.userTime / record.report.userNumber);
|
|
@@ -189,7 +187,7 @@ export default class extends Page {
|
|
|
title: '最近做题',
|
|
|
width: 150,
|
|
|
align: 'left',
|
|
|
- render: (record) => {
|
|
|
+ render: record => {
|
|
|
const time = record.report ? record.report.updateTime : record.paper ? record.paper.latestTime : null;
|
|
|
if (!time) return null;
|
|
|
return (
|
|
@@ -204,18 +202,37 @@ export default class extends Page {
|
|
|
title: '操作',
|
|
|
width: 180,
|
|
|
align: 'left',
|
|
|
- render: (record) => {
|
|
|
+ render: record => {
|
|
|
return (
|
|
|
<div className="table-row p-t-1">
|
|
|
- {!record.report && <IconButton type="start" tip="Start" onClick={() => {
|
|
|
- Question.startLink('sentence', record);
|
|
|
- }} />}
|
|
|
- {(record.report && !record.report.isFinish) && <IconButton className="m-r-2" type="continue" tip="Continue" onClick={() => {
|
|
|
- Question.continueLink('sentence', record);
|
|
|
- }} />}
|
|
|
- {(record.report && !!record.report.isFinish) && <IconButton type="restart" tip="Restart" onClick={() => {
|
|
|
- this.restart(record);
|
|
|
- }} />}
|
|
|
+ {!record.report && (
|
|
|
+ <IconButton
|
|
|
+ type="start"
|
|
|
+ tip="Start"
|
|
|
+ onClick={() => {
|
|
|
+ Question.startLink('sentence', record);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {record.report && !record.report.isFinish && (
|
|
|
+ <IconButton
|
|
|
+ className="m-r-2"
|
|
|
+ type="continue"
|
|
|
+ tip="Continue"
|
|
|
+ onClick={() => {
|
|
|
+ Question.continueLink('sentence', record);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {record.report && !!record.report.isFinish && (
|
|
|
+ <IconButton
|
|
|
+ type="restart"
|
|
|
+ tip="Restart"
|
|
|
+ onClick={() => {
|
|
|
+ this.restart(record);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
</div>
|
|
|
);
|
|
|
},
|
|
@@ -224,13 +241,17 @@ export default class extends Page {
|
|
|
title: '报告',
|
|
|
width: 30,
|
|
|
align: 'right',
|
|
|
- render: (record) => {
|
|
|
+ render: record => {
|
|
|
if (!record.report || !record.report.isFinish) return null;
|
|
|
return (
|
|
|
<div className="table-row p-t-1">
|
|
|
- <IconButton type="report" tip="Report" onClick={() => {
|
|
|
- Question.reportLink(record);
|
|
|
- }} />
|
|
|
+ <IconButton
|
|
|
+ type="report"
|
|
|
+ tip="Report"
|
|
|
+ onClick={() => {
|
|
|
+ Question.reportLink(record);
|
|
|
+ }}
|
|
|
+ />
|
|
|
</div>
|
|
|
);
|
|
|
},
|
|
@@ -255,7 +276,7 @@ export default class extends Page {
|
|
|
|
|
|
init() {
|
|
|
Main.getExercise().then(result => {
|
|
|
- const list = result.map((row) => {
|
|
|
+ const list = result.map(row => {
|
|
|
row.title = `${row.titleZh}${row.titleEn}`;
|
|
|
row.key = row.extend;
|
|
|
return row;
|
|
@@ -272,7 +293,7 @@ export default class extends Page {
|
|
|
const { info = {} } = this.props.user;
|
|
|
if (info.latestExercise) {
|
|
|
// 获取最后一次做题记录
|
|
|
- Question.baseReport(info.latestExercise).then((result) => {
|
|
|
+ Question.baseReport(info.latestExercise).then(result => {
|
|
|
this.setState({ latest: result });
|
|
|
});
|
|
|
}
|
|
@@ -299,12 +320,13 @@ export default class extends Page {
|
|
|
const { sentence } = this.state;
|
|
|
if (!sentence) {
|
|
|
User.clearSentenceTrail();
|
|
|
- Sentence.getInfo().then(result => {
|
|
|
- // result.code = '123123';
|
|
|
- // result.trailPages = 20;
|
|
|
- this.setState({ sentence: result });
|
|
|
- return result;
|
|
|
- })
|
|
|
+ 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 = [];
|
|
@@ -322,7 +344,7 @@ export default class extends Page {
|
|
|
if (row.exercise) exerciseChapter = row;
|
|
|
});
|
|
|
|
|
|
- result.forEach((article) => {
|
|
|
+ result.forEach(article => {
|
|
|
if (article.chapter === 0) introduction = article;
|
|
|
if (!map[article.chapter]) {
|
|
|
map[article.chapter] = [];
|
|
@@ -417,22 +439,26 @@ export default class extends Page {
|
|
|
this.setState({ tab2 });
|
|
|
}
|
|
|
const [type] = subject.children.filter(row => row.key === tab2);
|
|
|
- Question.getExerciseProgress(type.id).then((result => {
|
|
|
+ Question.getExerciseProgress(type.id).then(result => {
|
|
|
// const exerciseProgress = getMap(r, 'id');
|
|
|
result = result.map(row => {
|
|
|
- row.info = [{
|
|
|
- title: '已做',
|
|
|
- number: row.userNumber || 0,
|
|
|
- unit: '题',
|
|
|
- }, {
|
|
|
- title: '剩余',
|
|
|
- number: row.questionNumber - row.userNumber || 0,
|
|
|
- unit: '题',
|
|
|
- }, {
|
|
|
- title: '总计',
|
|
|
- number: row.questionNumber || 0,
|
|
|
- unit: '题',
|
|
|
- }];
|
|
|
+ row.info = [
|
|
|
+ {
|
|
|
+ title: '已做',
|
|
|
+ number: row.userNumber || 0,
|
|
|
+ unit: '题',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '剩余',
|
|
|
+ number: row.questionNumber - row.userNumber || 0,
|
|
|
+ unit: '题',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '总计',
|
|
|
+ number: row.questionNumber || 0,
|
|
|
+ unit: '题',
|
|
|
+ },
|
|
|
+ ];
|
|
|
if (row.userStat) {
|
|
|
row.correct = formatPercent(row.userStat.userCorrect, row.userStat.userNumber, false);
|
|
|
} else {
|
|
@@ -441,7 +467,7 @@ export default class extends Page {
|
|
|
row.progress = formatPercent(row.questionNumber - row.userNumber || 0, row.questionNumber);
|
|
|
row.totalCorrect = formatPercent(row.stat.totalCorrect, row.stat.totalNumber, false);
|
|
|
|
|
|
- row.children = row.children.map((r) => {
|
|
|
+ row.children = row.children.map(r => {
|
|
|
r.title = r.title || r.titleZh;
|
|
|
r.progress = formatPercent(r.userNumber, r.questionNumber);
|
|
|
return r;
|
|
@@ -449,7 +475,7 @@ export default class extends Page {
|
|
|
return row;
|
|
|
});
|
|
|
this.setState({ exerciseProgress: result });
|
|
|
- }));
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
onChangePreviewType(type) {
|
|
@@ -547,26 +573,36 @@ export default class extends Page {
|
|
|
const children = subject ? subject.children : [];
|
|
|
return (
|
|
|
<div>
|
|
|
- {latest && <Continue
|
|
|
- data={latest}
|
|
|
- onClose={() => {
|
|
|
- this.clearExercise();
|
|
|
- }}
|
|
|
- onContinue={() => {
|
|
|
- Question.continueLink('exercise', latest);
|
|
|
- }}
|
|
|
- onRestart={() => {
|
|
|
- this.restart(latest);
|
|
|
- }}
|
|
|
- onNext={() => {
|
|
|
- Question.continueLink('exercise', latest);
|
|
|
- }} />}
|
|
|
+ {latest && (
|
|
|
+ <Continue
|
|
|
+ data={latest}
|
|
|
+ onClose={() => {
|
|
|
+ this.clearExercise();
|
|
|
+ }}
|
|
|
+ onContinue={() => {
|
|
|
+ Question.continueLink('exercise', latest);
|
|
|
+ }}
|
|
|
+ onRestart={() => {
|
|
|
+ this.restart(latest);
|
|
|
+ }}
|
|
|
+ onNext={() => {
|
|
|
+ Question.continueLink('exercise', latest);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
<div className="content">
|
|
|
<Module className="m-t-2">
|
|
|
- <Tabs type="card" active={tab1} tabs={tabs} onChange={key => {
|
|
|
- this.onChangeTab(1, key);
|
|
|
- }} />
|
|
|
- {children.length > 1 && <Tabs active={tab2} tabs={children} onChange={key => this.onChangeTab(2, key)} />}
|
|
|
+ <Tabs
|
|
|
+ type="card"
|
|
|
+ active={tab1}
|
|
|
+ tabs={tabs}
|
|
|
+ onChange={key => {
|
|
|
+ this.onChangeTab(1, key);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ {children && children.length > 1 && (
|
|
|
+ <Tabs active={tab2} tabs={children} onChange={key => this.onChangeTab(2, key)} />
|
|
|
+ )}
|
|
|
</Module>
|
|
|
{tab1 !== SENTENCE && tab1 !== PREVIEW && this.renderExercise()}
|
|
|
{tab1 === SENTENCE && this.renderSentence()}
|
|
@@ -632,6 +668,18 @@ export default class extends Page {
|
|
|
},
|
|
|
{ type: 'select', checked: 'all', list: [{ key: 'all', title: '全部' }] },
|
|
|
]}
|
|
|
+ rightAction={
|
|
|
+ <div>
|
|
|
+ 有效期至:2019-11-13{' '}
|
|
|
+ <Tooltip overlayClassName="gray" placement="top" title="全部模考做完才可重置">
|
|
|
+ <a>
|
|
|
+ <Button size="small" disabled radius>
|
|
|
+ Reset
|
|
|
+ </Button>
|
|
|
+ </a>
|
|
|
+ </Tooltip>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
data={previews}
|
|
|
columns={this.columns}
|
|
|
/>
|
|
@@ -649,7 +697,19 @@ export default class extends Page {
|
|
|
}
|
|
|
|
|
|
renderSentenceArticle() {
|
|
|
- const { sentence = {}, introduction, chapterSteps, chapterStep = 1, exerciseChapter = {}, chapterMap = {}, articleMap = {}, trailArticles = [], paperFilterList = [], paperList = [], paperChecked } = this.state;
|
|
|
+ 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) {
|
|
@@ -664,73 +724,97 @@ export default class extends Page {
|
|
|
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({ sentenceModel: 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 > 0 && !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>;
|
|
|
+ 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({ sentenceModel: 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 > 0 && !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() {
|
|
@@ -739,13 +823,22 @@ export default class extends Page {
|
|
|
<Module className="code-module">
|
|
|
<div className="title">输入《千行GMAT长难句》专属 Code,解锁在线练习功能。</div>
|
|
|
<div className="input-block">
|
|
|
- <Input size="lager" placeholder="请输入CODE" onChange={(value) => {
|
|
|
- this.code = value;
|
|
|
- }} />
|
|
|
- <Button size="lager" onClick={() => {
|
|
|
- this.activeSentence();
|
|
|
- }}>解锁</Button>
|
|
|
- {sentenceError && <div className='error'>{sentenceError}</div>}
|
|
|
+ <Input
|
|
|
+ size="lager"
|
|
|
+ placeholder="请输入CODE"
|
|
|
+ onChange={value => {
|
|
|
+ this.code = value;
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Button
|
|
|
+ size="lager"
|
|
|
+ onClick={() => {
|
|
|
+ this.activeSentence();
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 解锁
|
|
|
+ </Button>
|
|
|
+ {sentenceError && <div className="error">{sentenceError}</div>}
|
|
|
</div>
|
|
|
<div className="tip">
|
|
|
<Link to="/" className="left link">
|
|
@@ -755,9 +848,12 @@ export default class extends Page {
|
|
|
<Link to="/" className="link">
|
|
|
去获取 >>
|
|
|
</Link>
|
|
|
- <a onClick={() => {
|
|
|
- this.trailSentence();
|
|
|
- }} className="right link">
|
|
|
+ <a
|
|
|
+ onClick={() => {
|
|
|
+ this.trailSentence();
|
|
|
+ }}
|
|
|
+ className="right link"
|
|
|
+ >
|
|
|
试用 >>
|
|
|
</a>
|
|
|
</div>
|
|
@@ -767,59 +863,76 @@ export default class extends Page {
|
|
|
|
|
|
renderInputCodeModel() {
|
|
|
const { sentenceError } = this.state;
|
|
|
- return <Modal visible closable={false} footer={false} title={false}>
|
|
|
- <div className="code-module-modal">
|
|
|
- <div className="title">请输入CODE</div>
|
|
|
- <div className="desc">
|
|
|
- <Input onChange={(value) => {
|
|
|
- this.code = value;
|
|
|
- }} />
|
|
|
- {sentenceError && <div className='error'>{sentenceError}</div>}
|
|
|
- <div className='tip'>
|
|
|
- <Link to="/" className="right link">
|
|
|
- 什么是CODE?
|
|
|
- </Link>
|
|
|
+ return (
|
|
|
+ <Modal visible closable={false} footer={false} title={false}>
|
|
|
+ <div className="code-module-modal">
|
|
|
+ <div className="title">请输入CODE</div>
|
|
|
+ <div className="desc">
|
|
|
+ <Input
|
|
|
+ onChange={value => {
|
|
|
+ this.code = value;
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ {sentenceError && <div className="error">{sentenceError}</div>}
|
|
|
+ <div className="tip">
|
|
|
+ <Link to="/" className="right link">
|
|
|
+ 什么是CODE?
|
|
|
+ </Link>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="btn-list">
|
|
|
+ <AnswerButton size="lager" theme="confirm" width={150} onClick={() => this.activeSentence()}>
|
|
|
+ 确认
|
|
|
+ </AnswerButton>
|
|
|
+ <AnswerButton
|
|
|
+ size="lager"
|
|
|
+ theme="cancel"
|
|
|
+ width={150}
|
|
|
+ onClick={() => this.setState({ sentenceModel: false })}
|
|
|
+ >
|
|
|
+ 取消
|
|
|
+ </AnswerButton>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div className="btn-list">
|
|
|
- <AnswerButton size="lager" theme="confirm" width={150} onClick={() => this.activeSentence()}>确认</AnswerButton>
|
|
|
- <AnswerButton size="lager" theme="cancel" width={150} onClick={() => this.setState({ sentenceModel: false })}>取消</AnswerButton>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </Modal>;
|
|
|
+ </Modal>
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
renderExercise() {
|
|
|
const { exerciseProgress = [] } = this.state;
|
|
|
- return <div >
|
|
|
- <Division col="2">
|
|
|
- {(exerciseProgress || []).map((struct) => {
|
|
|
- const [first] = struct.children;
|
|
|
- let col = 3;
|
|
|
- if (first && first.type === 'paper') {
|
|
|
- col = 5;
|
|
|
- }
|
|
|
- return <Panel
|
|
|
- title={struct.titleEn}
|
|
|
- message={struct.description}
|
|
|
- data={struct}
|
|
|
- col={col}
|
|
|
- onClick={(item) => {
|
|
|
- if (item.type === 'paper') {
|
|
|
- if (item.progress === 0) {
|
|
|
- Question.startLink('exercise', item);
|
|
|
- } else if (item.progress === 100) {
|
|
|
- Question.startLink('exercise', item);
|
|
|
- } else {
|
|
|
- Question.continueLink('exercise', item);
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.exerciseList(item);
|
|
|
- }
|
|
|
- }}
|
|
|
- />;
|
|
|
- })}
|
|
|
- </Division>
|
|
|
- </div>;
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ <Division col="2">
|
|
|
+ {(exerciseProgress || []).map(struct => {
|
|
|
+ const [first] = struct.children;
|
|
|
+ let col = 3;
|
|
|
+ if (first && first.type === 'paper') {
|
|
|
+ col = 5;
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <Panel
|
|
|
+ title={struct.titleEn}
|
|
|
+ message={struct.description}
|
|
|
+ data={struct}
|
|
|
+ col={col}
|
|
|
+ onClick={item => {
|
|
|
+ if (item.type === 'paper') {
|
|
|
+ if (item.progress === 0) {
|
|
|
+ Question.startLink('exercise', item);
|
|
|
+ } else if (item.progress === 100) {
|
|
|
+ Question.startLink('exercise', item);
|
|
|
+ } else {
|
|
|
+ Question.continueLink('exercise', item);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.exerciseList(item);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </Division>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
}
|
|
|
}
|