|
@@ -133,7 +133,7 @@ export default class extends Page {
|
|
|
title: '练习册',
|
|
|
width: 250,
|
|
|
align: 'left',
|
|
|
- render: (row) => {
|
|
|
+ render: row => {
|
|
|
return (
|
|
|
<div className="table-row">
|
|
|
<div className="night f-s-16">{row.title}</div>
|
|
@@ -228,7 +228,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;
|
|
@@ -246,7 +246,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 });
|
|
|
});
|
|
|
}
|
|
@@ -292,7 +292,7 @@ export default class extends Page {
|
|
|
if (!articleMap) {
|
|
|
Sentence.listArticle().then(result => {
|
|
|
const map = {};
|
|
|
- result.forEach((article) => {
|
|
|
+ result.forEach(article => {
|
|
|
if (!map[article.chapter]) {
|
|
|
map[article.chapter] = [];
|
|
|
}
|
|
@@ -360,10 +360,10 @@ export default class extends Page {
|
|
|
const exerciseChild = result;
|
|
|
this.setState({ exerciseChild });
|
|
|
});
|
|
|
- Question.getExerciseProcess(type.id).then((r => {
|
|
|
+ Question.getExerciseProcess(type.id).then(r => {
|
|
|
const exerciseProcess = getMap(r, 'id');
|
|
|
this.setState({ exerciseProcess });
|
|
|
- }));
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
onChangePreviewType(type) {
|
|
@@ -411,13 +411,12 @@ export default class extends Page {
|
|
|
}
|
|
|
|
|
|
activeSentence() {
|
|
|
- Sentence.active(this.code)
|
|
|
- .then(() => {
|
|
|
- // 重新获取长难句信息
|
|
|
- this.clearSentenceTrail();
|
|
|
- this.setState({ sentence: null, articleMap: null, paperList: null });
|
|
|
- this.refresh();
|
|
|
- });
|
|
|
+ Sentence.active(this.code).then(() => {
|
|
|
+ // 重新获取长难句信息
|
|
|
+ this.clearSentenceTrail();
|
|
|
+ this.setState({ sentence: null, articleMap: null, paperList: null });
|
|
|
+ this.refresh();
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
trailSentence() {
|
|
@@ -447,27 +446,28 @@ export default class extends Page {
|
|
|
const children = (map[tab1] || {}).children || [];
|
|
|
return (
|
|
|
<div>
|
|
|
- {latest && <Continue
|
|
|
- data={latest}
|
|
|
- onClose={() => {
|
|
|
- this.clearExercise();
|
|
|
- }}
|
|
|
- onContinue={() => {
|
|
|
-
|
|
|
- }}
|
|
|
- onRestart={() => {
|
|
|
-
|
|
|
- }}
|
|
|
- onNext={() => {
|
|
|
-
|
|
|
- }} />}
|
|
|
+ {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 => {
|
|
|
- this.onChangeTab(1, key);
|
|
|
- }} />
|
|
|
+ <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)} />}
|
|
|
-
|
|
|
</Module>
|
|
|
{tab1 !== SENTENCE && tab1 !== PREVIEW && this.renderExercise()}
|
|
|
{tab1 === SENTENCE && this.renderSentence()}
|
|
@@ -549,7 +549,17 @@ export default class extends Page {
|
|
|
}
|
|
|
|
|
|
renderSentenceArticle() {
|
|
|
- const { sentence = {}, chapters, chapter, exerciseChapter = {}, chapterMap = {}, articleMap = {}, paperFilterList = [], paperList = [], paperChecked } = this.state;
|
|
|
+ const {
|
|
|
+ sentence = {},
|
|
|
+ chapters,
|
|
|
+ chapter,
|
|
|
+ exerciseChapter = {},
|
|
|
+ chapterMap = {},
|
|
|
+ articleMap = {},
|
|
|
+ paperFilterList = [],
|
|
|
+ paperList = [],
|
|
|
+ paperChecked,
|
|
|
+ } = this.state;
|
|
|
const { sentenceTrail } = this.props.user;
|
|
|
let maxStep = 0;
|
|
|
if (sentenceTrail) {
|
|
@@ -562,62 +572,83 @@ 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({ sentenceInput: true });
|
|
|
- }}>输入</a></div>}
|
|
|
- <Module>
|
|
|
- <Step
|
|
|
- list={chapters}
|
|
|
- step={chapter}
|
|
|
- onClick={(step) => {
|
|
|
- this.setState({ chapter: step });
|
|
|
- }}
|
|
|
- message='请购买后访问'
|
|
|
- maxStep={maxStep}
|
|
|
- />
|
|
|
- </Module>
|
|
|
- {/* 正常文章 */}
|
|
|
- {sentence.code && !isExercise && <List
|
|
|
- title={`Chapter${chapter}`}
|
|
|
- subTitle={chapterInfo.title}
|
|
|
- list={articleMap[chapter]}
|
|
|
- onClick={(part) => {
|
|
|
- this.sentenceRead(part);
|
|
|
- }}
|
|
|
- />}
|
|
|
- {/* 正常练习 */}
|
|
|
- {sentence.code && isExercise && <ListTable
|
|
|
- title={`Chapter${chapter}`}
|
|
|
- subTitle={chapterInfo.title}
|
|
|
- filters={[{
|
|
|
- type: 'radio',
|
|
|
- checked: paperChecked,
|
|
|
- list: [{ key: 0, title: '未完成' }, { key: 1, title: '已完成' }],
|
|
|
- onChange: (item) => {
|
|
|
- console.log(item);
|
|
|
- this.sentenceFilter(item);
|
|
|
- },
|
|
|
- }]}
|
|
|
- data={paperFilterList}
|
|
|
- columns={this.sentenceColums}
|
|
|
- />}
|
|
|
- {/* 试读文章 */}
|
|
|
- {sentenceTrail && <List
|
|
|
- list={[]}
|
|
|
- onClick={(part) => {
|
|
|
- this.sentenceRead(part);
|
|
|
- }}
|
|
|
- />}
|
|
|
- {/* 试练 */}
|
|
|
- {sentenceTrail && <ListTable
|
|
|
- title={`Chapter${exerciseChapter.value}`}
|
|
|
- subTitle={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({ sentenceInput: true });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 输入
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ <Module>
|
|
|
+ <Step
|
|
|
+ list={chapters}
|
|
|
+ step={chapter}
|
|
|
+ onClick={step => {
|
|
|
+ this.setState({ chapter: step });
|
|
|
+ }}
|
|
|
+ message="请购买后访问"
|
|
|
+ maxStep={maxStep}
|
|
|
+ />
|
|
|
+ </Module>
|
|
|
+ {/* 正常文章 */}
|
|
|
+ {sentence.code && !isExercise && (
|
|
|
+ <List
|
|
|
+ title={`Chapter${chapter}`}
|
|
|
+ subTitle={chapterInfo.title}
|
|
|
+ list={articleMap[chapter]}
|
|
|
+ onClick={part => {
|
|
|
+ this.sentenceRead(part);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {/* 正常练习 */}
|
|
|
+ {sentence.code && isExercise && (
|
|
|
+ <ListTable
|
|
|
+ title={`Chapter${chapter}`}
|
|
|
+ subTitle={chapterInfo.title}
|
|
|
+ filters={[
|
|
|
+ {
|
|
|
+ type: 'radio',
|
|
|
+ checked: paperChecked,
|
|
|
+ list: [{ key: 0, title: '未完成' }, { key: 1, title: '已完成' }],
|
|
|
+ onChange: item => {
|
|
|
+ console.log(item);
|
|
|
+ this.sentenceFilter(item);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ]}
|
|
|
+ data={paperFilterList}
|
|
|
+ columns={this.sentenceColums}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {/* 试读文章 */}
|
|
|
+ {sentenceTrail && (
|
|
|
+ <List
|
|
|
+ list={[]}
|
|
|
+ onClick={part => {
|
|
|
+ this.sentenceRead(part);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {/* 试练 */}
|
|
|
+ {sentenceTrail && (
|
|
|
+ <ListTable
|
|
|
+ title={`Chapter${exerciseChapter.value}`}
|
|
|
+ subTitle={exerciseChapter.title}
|
|
|
+ data={paperList}
|
|
|
+ columns={this.sentenceColums}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
renderInputCode() {
|
|
@@ -625,12 +656,21 @@ 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>
|
|
|
+ <Input
|
|
|
+ size="lager"
|
|
|
+ placeholder="请输入CODE"
|
|
|
+ onChange={value => {
|
|
|
+ this.code = value;
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Button
|
|
|
+ size="lager"
|
|
|
+ onClick={() => {
|
|
|
+ this.activeSentence();
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 解锁
|
|
|
+ </Button>
|
|
|
</div>
|
|
|
<div className="tip">
|
|
|
<Link to="/" className="left link">
|
|
@@ -640,9 +680,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>
|