|
@@ -17,7 +17,7 @@ import { Main } from '../../../stores/main';
|
|
|
import { Textbook } from '../../../stores/textbook';
|
|
|
import { Order } from '../../../stores/order';
|
|
|
import { User } from '../../../stores/user';
|
|
|
-import { TextbookFeedbackTarget } from '../../../../Constant';
|
|
|
+import { TextbookFeedbackTarget, TextbookSubject } from '../../../../Constant';
|
|
|
|
|
|
const textbookHistoryColumns = [
|
|
|
{
|
|
@@ -42,6 +42,13 @@ export default class extends Page {
|
|
|
list: [],
|
|
|
enroll: {},
|
|
|
load: 0,
|
|
|
+ subject: TextbookSubject[0].value,
|
|
|
+ textbookSubject: TextbookSubject.map(row => {
|
|
|
+ return {
|
|
|
+ title: row.label,
|
|
|
+ key: row.value,
|
|
|
+ };
|
|
|
+ }),
|
|
|
};
|
|
|
}
|
|
|
|
|
@@ -66,6 +73,10 @@ export default class extends Page {
|
|
|
list.push({ subject: 'rc', number: latest.rcNumber, time: latest.rcTime, version: latest.rcVersion });
|
|
|
list.push({ subject: 'ir', number: latest.irNumber, time: latest.irTime, version: latest.irVersion });
|
|
|
this.setState({ data: result, list });
|
|
|
+
|
|
|
+ if (!result.hasService && result.unUseRecord) {
|
|
|
+ this.textbookHistory({ subject: this.state.subject, showUpdate: false });
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -142,11 +153,11 @@ export default class extends Page {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- textbookHistory({ page, size, subject }) {
|
|
|
+ textbookHistory({ page, size, subject, showUpdate = true }) {
|
|
|
this.setState({ subject });
|
|
|
Textbook.allHistory(subject).then(result => {
|
|
|
this.setState({
|
|
|
- showUpdate: true,
|
|
|
+ showUpdate,
|
|
|
updateList: result.map(row => {
|
|
|
row.version = row[`${subject}Version`];
|
|
|
row.content = row[`${subject}Content`];
|
|
@@ -238,13 +249,12 @@ export default class extends Page {
|
|
|
onTabChange={(key) => this.onTabChange(key)}
|
|
|
/>
|
|
|
<CommentFalls list={comments} />
|
|
|
- <Consultation />
|
|
|
+ <Consultation data={base.contact} />
|
|
|
<Contact data={base.contact} />
|
|
|
<Footer />
|
|
|
-
|
|
|
<Modal show={showWarn} title={warn.title} confirmText="好的,知道了" btnAlign="center" onConfirm={() => this.setState({ showWarn: false })}>
|
|
|
<div className="t-2 t-s-18">{warn.content}</div>
|
|
|
- </Modal>,
|
|
|
+ </Modal>
|
|
|
<Modal
|
|
|
show={showUpdate}
|
|
|
maskClosable
|
|
@@ -394,7 +404,7 @@ export default class extends Page {
|
|
|
}
|
|
|
|
|
|
renderLog() {
|
|
|
- const { data, subject, updateList } = this.state;
|
|
|
+ const { data, subject, updateList, textbookSubject } = this.state;
|
|
|
return (
|
|
|
<div className="table-layout">
|
|
|
<div className="content">
|
|
@@ -402,18 +412,14 @@ export default class extends Page {
|
|
|
<span className="d-i-b t-1 t-s-18">更新日志</span>
|
|
|
<Tabs
|
|
|
type="text"
|
|
|
- tabs={[{ title: '数学', key: 'quant' }, { title: '阅读RC', key: 'rc' }, { title: '逻辑IR', key: 'ir' }]}
|
|
|
+ tabs={textbookSubject}
|
|
|
active={subject}
|
|
|
- onTabChange={(key) => this.textbookHistory({ subject: key })}
|
|
|
+ onChange={(key) => this.textbookHistory({ subject: key, showUpdate: false })}
|
|
|
/>
|
|
|
</div>
|
|
|
<UserTable
|
|
|
size="small"
|
|
|
- columns={[
|
|
|
- { title: '更新时间', key: 'date' },
|
|
|
- { title: '版本', key: 'version' },
|
|
|
- { title: '更新内容', key: 'content' },
|
|
|
- ]}
|
|
|
+ columns={textbookHistoryColumns}
|
|
|
data={updateList}
|
|
|
/>
|
|
|
<Assets name="textbook_banner" onClick={() => this.open(data.unUseRecord.id)} />
|