|
@@ -23,6 +23,7 @@ import { Textbook } from '../../../stores/textbook';
|
|
|
import { DataType, ServiceKey } from '../../../../Constant';
|
|
|
import { Main } from '../../../stores/main';
|
|
|
import { Question } from '../../../stores/question';
|
|
|
+import Select from '../../../components/Select';
|
|
|
|
|
|
const ServiceKeyMap = getMap(ServiceKey, 'value', 'label');
|
|
|
|
|
@@ -87,38 +88,37 @@ export default class extends Page {
|
|
|
Main.getService('textbook').then(result => {
|
|
|
this.setState({ service: result });
|
|
|
});
|
|
|
- Textbook.getInfo()
|
|
|
- .then(result => {
|
|
|
- const { latest } = result;
|
|
|
- result.day = parseInt((new Date().getTime() - new Date(result.latest.startDate).getTime()) / 86400000, 10);
|
|
|
+ Textbook.getInfo().then(result => {
|
|
|
+ const { latest } = result;
|
|
|
+ result.day = parseInt((new Date().getTime() - new Date(result.latest.startDate).getTime()) / 86400000, 10);
|
|
|
|
|
|
- result.expireDay = result.expireTime && parseInt((new Date().getTime() - new Date(result.expireTime).getTime()) / 86400000, 10);
|
|
|
+ result.expireDay =
|
|
|
+ result.expireTime && parseInt((new Date().getTime() - new Date(result.expireTime).getTime()) / 86400000, 10);
|
|
|
|
|
|
- const list = [];
|
|
|
+ const list = [];
|
|
|
|
|
|
- list.push({ subject: 'quant', number: latest.quantNumber, time: latest.quantTime, version: latest.quantVersion });
|
|
|
- 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 });
|
|
|
- });
|
|
|
+ list.push({ subject: 'quant', number: latest.quantNumber, time: latest.quantTime, version: latest.quantVersion });
|
|
|
+ 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 });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
textbookHistory({ page, size, subject }) {
|
|
|
- Textbook.listHistory({ subject })
|
|
|
- .then(result => {
|
|
|
- this.setState({
|
|
|
- updateList: result.map(row => {
|
|
|
- row.version = row[`${subject}Version`];
|
|
|
- row.content = row[`${subject}Content`];
|
|
|
- row.createTime = formatDate(row.createTime, 'YYYY-MM-DD\nHH:mm:ss');
|
|
|
- return row;
|
|
|
- }),
|
|
|
- // 不显示分页
|
|
|
- updateTotal: 0,
|
|
|
- updatePage: page,
|
|
|
- updateData: { page, size, subject, columns: textbookHistoryColumns, type: 'textbook' },
|
|
|
- });
|
|
|
+ Textbook.listHistory({ subject }).then(result => {
|
|
|
+ this.setState({
|
|
|
+ updateList: result.map(row => {
|
|
|
+ row.version = row[`${subject}Version`];
|
|
|
+ row.content = row[`${subject}Content`];
|
|
|
+ row.createTime = formatDate(row.createTime, 'YYYY-MM-DD\nHH:mm:ss');
|
|
|
+ return row;
|
|
|
+ }),
|
|
|
+ // 不显示分页
|
|
|
+ updateTotal: 0,
|
|
|
+ updatePage: page,
|
|
|
+ updateData: { page, size, subject, columns: textbookHistoryColumns, type: 'textbook' },
|
|
|
});
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
refreshExamination() {
|
|
@@ -126,7 +126,8 @@ export default class extends Page {
|
|
|
this.setState({ service: result });
|
|
|
});
|
|
|
Question.getExaminationInfo(result => {
|
|
|
- result.expireDay = result.expireTime && parseInt((new Date().getTime() - new Date(result.expireTime).getTime()) / 86400000, 10);
|
|
|
+ result.expireDay =
|
|
|
+ result.expireTime && parseInt((new Date().getTime() - new Date(result.expireTime).getTime()) / 86400000, 10);
|
|
|
this.setState({ data: result });
|
|
|
});
|
|
|
}
|
|
@@ -138,22 +139,27 @@ export default class extends Page {
|
|
|
}
|
|
|
|
|
|
recordList({ page, size, service, isUse, isExpire }) {
|
|
|
- Order.listRecord({ page, size, productType: 'service', service, isUse, isExpire })
|
|
|
- .then(result => {
|
|
|
- this.setState({
|
|
|
- updateList: result.map(row => {
|
|
|
- row.title = ServiceKeyMap[service];
|
|
|
- row.handler = <a onClick={() => {
|
|
|
- this.open(row.id);
|
|
|
- }}>立即开通</a>;
|
|
|
- row.endTime = `${formatDate(row.endTime, 'YYYY-MM-DD')} 前`;
|
|
|
- return row;
|
|
|
- }),
|
|
|
- updateTotal: result.length,
|
|
|
- updatePage: page,
|
|
|
- updateData: { page, size, service, isUse, columns: isUse ? [] : openColumns, type: 'record' },
|
|
|
- });
|
|
|
+ Order.listRecord({ page, size, productType: 'service', service, isUse, isExpire }).then(result => {
|
|
|
+ this.setState({
|
|
|
+ updateList: result.map(row => {
|
|
|
+ row.title = ServiceKeyMap[service];
|
|
|
+ row.handler = (
|
|
|
+ <a
|
|
|
+ onClick={() => {
|
|
|
+ this.open(row.id);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 立即开通
|
|
|
+ </a>
|
|
|
+ );
|
|
|
+ row.endTime = `${formatDate(row.endTime, 'YYYY-MM-DD')} 前`;
|
|
|
+ return row;
|
|
|
+ }),
|
|
|
+ updateTotal: result.length,
|
|
|
+ updatePage: page,
|
|
|
+ updateData: { page, size, service, isUse, columns: isUse ? [] : openColumns, type: 'record' },
|
|
|
});
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
refreshData() {
|
|
@@ -168,11 +174,13 @@ export default class extends Page {
|
|
|
});
|
|
|
this.setState({ dataTypeSelect });
|
|
|
Main.dataStruct().then(result => {
|
|
|
- const structs = result.filter(row => row.level === 1).map(row => {
|
|
|
- row.title = `${row.titleZh}${row.titleEn}`;
|
|
|
- row.key = `${row.id}`;
|
|
|
- return row;
|
|
|
- });
|
|
|
+ const structs = result
|
|
|
+ .filter(row => row.level === 1)
|
|
|
+ .map(row => {
|
|
|
+ row.title = `${row.titleZh}${row.titleEn}`;
|
|
|
+ row.key = `${row.id}`;
|
|
|
+ return row;
|
|
|
+ });
|
|
|
structs.unshift({
|
|
|
title: '全部',
|
|
|
key: '',
|
|
@@ -181,37 +189,42 @@ export default class extends Page {
|
|
|
structs,
|
|
|
});
|
|
|
});
|
|
|
- My.listData(Object.assign({}, this.state.search))
|
|
|
- .then(result => {
|
|
|
- result = {
|
|
|
- list: [{
|
|
|
+ My.listData(Object.assign({}, this.state.search)).then(result => {
|
|
|
+ result = {
|
|
|
+ list: [
|
|
|
+ {
|
|
|
title: '123123',
|
|
|
latestTime: '',
|
|
|
id: 1,
|
|
|
number: 10,
|
|
|
version: '1231',
|
|
|
- }],
|
|
|
- };
|
|
|
- this.setState({
|
|
|
- list: result.list.map(row => {
|
|
|
- row.time = formatDate(row.time, 'YYYY-MM-DD HH:mm:ss');
|
|
|
- return row;
|
|
|
- }),
|
|
|
- total: result.total,
|
|
|
- page: this.state.search.page,
|
|
|
- });
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ this.setState({
|
|
|
+ list: result.list.map(row => {
|
|
|
+ row.time = formatDate(row.time, 'YYYY-MM-DD HH:mm:ss');
|
|
|
+ return row;
|
|
|
+ }),
|
|
|
+ total: result.total,
|
|
|
+ page: this.state.search.page,
|
|
|
});
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
dataHistory({ dataId, page, size }) {
|
|
|
- My.listDataHistory({ page, size, dataId })
|
|
|
- .then(result => {
|
|
|
- result.list = result.list.map(row => {
|
|
|
- row.time = formatDate(row.time, 'YYYY-MM-DD\nHH:mm:ss');
|
|
|
- return row;
|
|
|
- });
|
|
|
- this.setState({ updateList: result.list, updateTotal: result.total, updatePage: page, updateData: { page, size, dataId, columns: dataHistoryColumns, type: 'data' } });
|
|
|
+ My.listDataHistory({ page, size, dataId }).then(result => {
|
|
|
+ result.list = result.list.map(row => {
|
|
|
+ row.time = formatDate(row.time, 'YYYY-MM-DD\nHH:mm:ss');
|
|
|
+ return row;
|
|
|
+ });
|
|
|
+ this.setState({
|
|
|
+ updateList: result.list,
|
|
|
+ updateTotal: result.total,
|
|
|
+ updatePage: page,
|
|
|
+ updateData: { page, size, dataId, columns: dataHistoryColumns, type: 'data' },
|
|
|
});
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
onFilter(value) {
|
|
@@ -232,26 +245,29 @@ export default class extends Page {
|
|
|
|
|
|
submitComment() {
|
|
|
const { comment } = this.state;
|
|
|
- My.addComment(comment.channel, comment.position, comment.content)
|
|
|
- .then(() => {
|
|
|
- this.setState({ showComment: false, showFinish: true, comment: {} });
|
|
|
- });
|
|
|
+ My.addComment(comment.channel, comment.position, comment.content).then(() => {
|
|
|
+ this.setState({ showComment: false, showFinish: true, comment: {} });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
submitFeedbackError() {
|
|
|
const { feedbackError } = this.state;
|
|
|
- My.addFeedbackErrorData(feedbackError.dataId, feedbackError.title, feedbackError.position, feedbackError.originContent, feedbackError.content)
|
|
|
- .then(() => {
|
|
|
- this.setState({ showFinish: true, showFeedbackError: false, feedbackError: {} });
|
|
|
- });
|
|
|
+ My.addFeedbackErrorData(
|
|
|
+ feedbackError.dataId,
|
|
|
+ feedbackError.title,
|
|
|
+ feedbackError.position,
|
|
|
+ feedbackError.originContent,
|
|
|
+ feedbackError.content,
|
|
|
+ ).then(() => {
|
|
|
+ this.setState({ showFinish: true, showFeedbackError: false, feedbackError: {} });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
submitFeedback() {
|
|
|
const { feedback } = this.state;
|
|
|
- My.addTextbookFeedback('', feedback.target, feedback.content)
|
|
|
- .then(() => {
|
|
|
- this.setState({ showFinish: true, showFeedback: false, feedbackError: {} });
|
|
|
- });
|
|
|
+ My.addTextbookFeedback('', feedback.target, feedback.content).then(() => {
|
|
|
+ this.setState({ showFinish: true, showFeedback: false, feedbackError: {} });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
subscribe(value) {
|
|
@@ -279,7 +295,18 @@ export default class extends Page {
|
|
|
}
|
|
|
|
|
|
renderDetail() {
|
|
|
- const { tab, comment = {}, showComment, showFinish, showUpdate, updateList, updateTotal, updateData = {} } = this.state;
|
|
|
+ const {
|
|
|
+ tab,
|
|
|
+ comment = {},
|
|
|
+ feedback = {},
|
|
|
+ showComment,
|
|
|
+ showFinish,
|
|
|
+ showUpdate,
|
|
|
+ showFeedback,
|
|
|
+ updateList,
|
|
|
+ updateTotal,
|
|
|
+ updateData = {},
|
|
|
+ } = this.state;
|
|
|
return (
|
|
|
<div className="table-layout">
|
|
|
<Tabs
|
|
@@ -300,13 +327,20 @@ export default class extends Page {
|
|
|
onChange={key => this.onTabChange(key)}
|
|
|
/>
|
|
|
{this[`renderTab${tab}`]()}
|
|
|
- <Modal show={showUpdate} maskClosable close={false} body={false} width={630} onClose={() => this.setState({ showUpdate: false, updateList: [] })} >
|
|
|
+ <Modal
|
|
|
+ show={showUpdate}
|
|
|
+ maskClosable
|
|
|
+ close={false}
|
|
|
+ body={false}
|
|
|
+ width={630}
|
|
|
+ onClose={() => this.setState({ showUpdate: false, updateList: [] })}
|
|
|
+ >
|
|
|
<UserTable
|
|
|
size="small"
|
|
|
columns={updateData.columns}
|
|
|
data={updateList}
|
|
|
current={updateData.page}
|
|
|
- onChange={(page) => {
|
|
|
+ onChange={page => {
|
|
|
updateData.page = page;
|
|
|
if (updateData.type === 'data') {
|
|
|
this.dataHistory(updateData);
|
|
@@ -319,19 +353,78 @@ export default class extends Page {
|
|
|
total={updateTotal}
|
|
|
/>
|
|
|
</Modal>
|
|
|
- <Modal show={showComment} title="评价" onConfirm={() => comment.content && this.submitComment()} onCancel={() => this.setState({ showComment: false, comment: {} })}>
|
|
|
- <textarea value={comment.content} className="b-c-1 w-10 p-10" rows={6} placeholder="您的看法对我们来说很重要!" onChange={(e) => {
|
|
|
- comment.content = e.target.value;
|
|
|
- this.setState({ comment });
|
|
|
- }} />
|
|
|
+ <Modal
|
|
|
+ show={showComment}
|
|
|
+ title="评价"
|
|
|
+ onConfirm={() => comment.content && this.submitComment()}
|
|
|
+ onCancel={() => this.setState({ showComment: false, comment: {} })}
|
|
|
+ >
|
|
|
+ <textarea
|
|
|
+ value={comment.content}
|
|
|
+ className="b-c-1 w-10 p-10"
|
|
|
+ rows={6}
|
|
|
+ placeholder="您的看法对我们来说很重要!"
|
|
|
+ onChange={e => {
|
|
|
+ comment.content = e.target.value;
|
|
|
+ this.setState({ comment });
|
|
|
+ }}
|
|
|
+ />
|
|
|
<div className="b-b m-t-2" />
|
|
|
</Modal>
|
|
|
- <Modal show={showFinish} title="提交成功" confirmText="好的,知道了" btnAlign="center" onConfirm={() => this.setState({ showFinish: false })} >
|
|
|
+ <Modal
|
|
|
+ show={showFinish}
|
|
|
+ title="提交成功"
|
|
|
+ confirmText="好的,知道了"
|
|
|
+ btnAlign="center"
|
|
|
+ onConfirm={() => this.setState({ showFinish: false })}
|
|
|
+ >
|
|
|
<div className="t-2 t-s-18">
|
|
|
<Icon type="check" className="t-5 m-r-5" />
|
|
|
您的每一次反馈都是千行进步的动力。
|
|
|
</div>
|
|
|
</Modal>
|
|
|
+ <Modal
|
|
|
+ show={showFeedback}
|
|
|
+ title="反馈"
|
|
|
+ width={630}
|
|
|
+ onConfirm={() => this.setState({ showFeedback: false })}
|
|
|
+ onCancel={() => this.setState({ showFeedback: false })}
|
|
|
+ >
|
|
|
+ <div className="t-2 t-s-16 m-b-1">
|
|
|
+ 机经类别:
|
|
|
+ <Select
|
|
|
+ value={feedback.type}
|
|
|
+ theme="white"
|
|
|
+ list={[{ title: '数学机经', key: '1' }, { title: '逻辑机经', key: '2' }, { title: '阅读机经', key: '3' }]}
|
|
|
+ />
|
|
|
+ 反馈类型:
|
|
|
+ <Select
|
|
|
+ value={feedback.cate}
|
|
|
+ theme="white"
|
|
|
+ list={[
|
|
|
+ { title: '纠正解析', key: '1' },
|
|
|
+ { title: '完善已有机经', key: '2' },
|
|
|
+ { title: '提供全新机经', key: '3' },
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ <span hidden={feedback.cate === 3}>
|
|
|
+ 题号是
|
|
|
+ <input style={{ width: 80 }} className="m-l-1 b-c-1 t-c" />
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div className="t-2 t-s-16">正确的解析和答案应该是:</div>
|
|
|
+ <textarea
|
|
|
+ value={comment.content}
|
|
|
+ className="b-c-1 w-10 p-10"
|
|
|
+ rows={10}
|
|
|
+ placeholder={{ 1: '正确的解析和答案是:', 2: '补充内容是:', 3: '新机经是:' }[feedback.cate]}
|
|
|
+ onChange={e => {
|
|
|
+ comment.content = e.target.value;
|
|
|
+ this.setState({ comment });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <div className="b-b m-t-2" />
|
|
|
+ </Modal>
|
|
|
</div>
|
|
|
);
|
|
|
}
|
|
@@ -342,26 +435,35 @@ export default class extends Page {
|
|
|
return (
|
|
|
<div className="tab-1-layout">
|
|
|
<UserAction
|
|
|
- selectList={[{
|
|
|
- label: '学科',
|
|
|
- key: 'structId',
|
|
|
- select: structs,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '资料形式',
|
|
|
- key: 'dataType',
|
|
|
- select: dataTypeSelect,
|
|
|
- }]}
|
|
|
- sortList={[{ right: true, label: '销量', key: 'sale_number' }, { right: true, label: '更新时间', key: 'latest_time' }]}
|
|
|
+ selectList={[
|
|
|
+ {
|
|
|
+ label: '学科',
|
|
|
+ key: 'structId',
|
|
|
+ select: structs,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '资料形式',
|
|
|
+ key: 'dataType',
|
|
|
+ select: dataTypeSelect,
|
|
|
+ },
|
|
|
+ ]}
|
|
|
+ sortList={[
|
|
|
+ { right: true, label: '销量', key: 'sale_number' },
|
|
|
+ { right: true, label: '更新时间', key: 'latest_time' },
|
|
|
+ ]}
|
|
|
sortMap={sortMap}
|
|
|
filterMap={filterMap}
|
|
|
onFilter={value => this.onFilter(value)}
|
|
|
onSort={value => this.onSort(value)}
|
|
|
right={
|
|
|
<div className="email">
|
|
|
- 邮箱订阅 <Switch checked={info.dataEmailSubscribe} onChange={() => {
|
|
|
- this.subscribe(!info.dataEmailSubscribe);
|
|
|
- }} />
|
|
|
+ 邮箱订阅{' '}
|
|
|
+ <Switch
|
|
|
+ checked={info.dataEmailSubscribe}
|
|
|
+ onChange={() => {
|
|
|
+ this.subscribe(!info.dataEmailSubscribe);
|
|
|
+ }}
|
|
|
+ />
|
|
|
</div>
|
|
|
}
|
|
|
/>
|
|
@@ -372,14 +474,23 @@ export default class extends Page {
|
|
|
<Assets name="sun_blue" src={item.cover} />
|
|
|
<div className="fixed">
|
|
|
<div className="btns">
|
|
|
- <Button size="small" radius onClick={() => {
|
|
|
- openLink(item.resource);
|
|
|
- }}>
|
|
|
+ <Button
|
|
|
+ size="small"
|
|
|
+ radius
|
|
|
+ onClick={() => {
|
|
|
+ openLink(item.resource);
|
|
|
+ }}
|
|
|
+ >
|
|
|
阅读
|
|
|
</Button>
|
|
|
- <div className="white" onClick={() => {
|
|
|
- openLink(item.resource);
|
|
|
- }}>下载</div>
|
|
|
+ <div
|
|
|
+ className="white"
|
|
|
+ onClick={() => {
|
|
|
+ openLink(item.resource);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 下载
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="title">
|
|
@@ -388,8 +499,12 @@ export default class extends Page {
|
|
|
</div>
|
|
|
<div className="date">{formatDate(item.latestTime, 'YYYY-MM-DD HH:mm:ss')}</div>
|
|
|
<More
|
|
|
- menu={[{ label: '纠错', key: 'feedback' }, { label: '评价', key: 'comment' }, { label: '更新', key: 'update' }]}
|
|
|
- onClick={(value) => {
|
|
|
+ menu={[
|
|
|
+ { label: '纠错', key: 'feedback' },
|
|
|
+ { label: '评价', key: 'comment' },
|
|
|
+ { label: '更新', key: 'update' },
|
|
|
+ ]}
|
|
|
+ onClick={value => {
|
|
|
const { key } = value;
|
|
|
if (key === 'comment') {
|
|
|
this.setState({ showComment: true, comment: { channel: 'course_data', position: item.id } });
|
|
@@ -405,7 +520,9 @@ export default class extends Page {
|
|
|
);
|
|
|
})}
|
|
|
</div>
|
|
|
- {total && list.length > 0 && <UserPagination total={total} current={page} onChange={(p) => this.onChangePage(p)} />}
|
|
|
+ {total && list.length > 0 && (
|
|
|
+ <UserPagination total={total} current={page} onChange={p => this.onChangePage(p)} />
|
|
|
+ )}
|
|
|
</div>
|
|
|
);
|
|
|
}
|
|
@@ -425,56 +542,83 @@ export default class extends Page {
|
|
|
</span>
|
|
|
</div>
|
|
|
}
|
|
|
- right={!data.hasService && data.unUseRecord && <div className="email" onClick={() => {
|
|
|
- this.recordList({ page: 1, size: 10, service: 'textbook', isUse: false, isExpire: false });
|
|
|
- }}>待开通</div>}
|
|
|
+ right={
|
|
|
+ !data.hasService &&
|
|
|
+ data.unUseRecord && (
|
|
|
+ <div
|
|
|
+ className="email"
|
|
|
+ onClick={() => {
|
|
|
+ this.recordList({ page: 1, size: 10, service: 'textbook', isUse: false, isExpire: false });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 待开通
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
/>
|
|
|
- {data.hasService && <div className="data-layout">
|
|
|
- {list.map(item => {
|
|
|
- return (
|
|
|
- <div className="data-item">
|
|
|
- <Assets name="sun_blue" />
|
|
|
- <div className="title">
|
|
|
- 已更新至<b>{item.num}</b>题
|
|
|
+ {data.hasService && (
|
|
|
+ <div className="data-layout">
|
|
|
+ {list.map(item => {
|
|
|
+ return (
|
|
|
+ <div className="data-item">
|
|
|
+ <Assets name="sun_blue" />
|
|
|
+ <div className="title">
|
|
|
+ 已更新至<b>{item.num}</b>题
|
|
|
+ </div>
|
|
|
+ <div className="date">{item.date}</div>
|
|
|
+ <More
|
|
|
+ menu={[
|
|
|
+ { label: '更新', key: 'update' },
|
|
|
+ { label: '反馈', key: 'feedback' },
|
|
|
+ { label: '评价', key: 'comment' },
|
|
|
+ ]}
|
|
|
+ onClick={value => {
|
|
|
+ const { key } = value;
|
|
|
+ if (key === 'comment') {
|
|
|
+ this.setState({ showComment: true, comment: { channel: 'library' } });
|
|
|
+ } else if (key === 'update') {
|
|
|
+ this.setState({ showUpdate: true });
|
|
|
+ this.textbookHistory({ page: 1, size: 100, subject: item.subject });
|
|
|
+ } else if (key === 'feedback') {
|
|
|
+ this.setState({ showFeedback: true });
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
</div>
|
|
|
- <div className="date">{item.date}</div>
|
|
|
- <More
|
|
|
- menu={[{ label: '更新', key: 'update' }, { label: '反馈', key: 'feedback' }, { label: '评价', key: 'comment' }]}
|
|
|
- onClick={(value) => {
|
|
|
- const { key } = value;
|
|
|
- if (key === 'comment') {
|
|
|
- this.setState({ showComment: true, comment: { channel: 'library' } });
|
|
|
- } else if (key === 'update') {
|
|
|
- this.setState({ showUpdate: true });
|
|
|
- this.textbookHistory({ page: 1, size: 100, subject: item.subject });
|
|
|
- } else if (key === 'feedback') {
|
|
|
- this.setState({ showFeedback: true });
|
|
|
- }
|
|
|
- }}
|
|
|
- />
|
|
|
- </div>
|
|
|
- );
|
|
|
- })}
|
|
|
- </div>}
|
|
|
- {!data.hasService && !data.unUseRecord && <div className="tip-layout">
|
|
|
- <div className="t1">还未购买本月机经</div>
|
|
|
- <div className="desc">¥ {service && service.package && service.package[0].price}</div>
|
|
|
- <Button radius size="lager" width={150}>
|
|
|
- 立即购买
|
|
|
- </Button>
|
|
|
- </div>}
|
|
|
- {data.hasService && <div className="tip-layout">
|
|
|
- <div className="t1">使用中</div>
|
|
|
- <div className="t2">距离到期还有 {data.expireDay} 天</div>
|
|
|
- </div>}
|
|
|
- {!data.hasService && data.unUseRecord && <div className="tip-layout">
|
|
|
- <div className="t2">请于{formatDate(data.unUseRecord.endTime, 'YYYY-MM-DD')}前开通</div>
|
|
|
- <Button radius size="lager" width={150} onClick={() => {
|
|
|
- this.open(data.unUseRecord.id);
|
|
|
- }}>
|
|
|
- 立即开通
|
|
|
- </Button>
|
|
|
- </div>}
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {!data.hasService && !data.unUseRecord && (
|
|
|
+ <div className="tip-layout">
|
|
|
+ <div className="t1">还未购买本月机经</div>
|
|
|
+ <div className="desc">¥ {service && service.package && service.package[0].price}</div>
|
|
|
+ <Button radius size="lager" width={150}>
|
|
|
+ 立即购买
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {data.hasService && (
|
|
|
+ <div className="tip-layout">
|
|
|
+ <div className="t1">使用中</div>
|
|
|
+ <div className="t2">距离到期还有 {data.expireDay} 天</div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {!data.hasService && data.unUseRecord && (
|
|
|
+ <div className="tip-layout">
|
|
|
+ <div className="t2">请于{formatDate(data.unUseRecord.endTime, 'YYYY-MM-DD')}前开通</div>
|
|
|
+ <Button
|
|
|
+ radius
|
|
|
+ size="lager"
|
|
|
+ width={150}
|
|
|
+ onClick={() => {
|
|
|
+ this.open(data.unUseRecord.id);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 立即开通
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
</div>
|
|
|
);
|
|
|
}
|
|
@@ -483,36 +627,63 @@ export default class extends Page {
|
|
|
const { data = {}, service } = this.state;
|
|
|
return (
|
|
|
<div className="tab-3-layout">
|
|
|
- <UserAction right={!data.hasService && data.unUseRecord && <div className="email" onClick={() => {
|
|
|
- this.recordList({ page: 1, size: 10, service: 'qx_cat', isUse: false, isExpire: false });
|
|
|
- }}>待开通</div>} />
|
|
|
- {!data.hasService && !data.unUseRecord && !data.expireTime && <div className="tip-layout">
|
|
|
- <div className="t1">未购买</div>
|
|
|
- <div className="desc">¥ {service && service.package && service.package[0].price}</div>
|
|
|
- <Button radius size="lager" width={150}>
|
|
|
- 立即购买
|
|
|
- </Button>
|
|
|
- </div>}
|
|
|
- {!data.hasService && data.unUseRecord && <div className="tip-layout">
|
|
|
- <div className="t2">请于{formatDate(data.unUseRecord.endTime, 'YYYY-MM-DD')}前开通</div>
|
|
|
- <Button radius size="lager" width={150} onClick={() => {
|
|
|
- this.open(data.unUseRecord.id);
|
|
|
- }}>
|
|
|
- 立即开通
|
|
|
- </Button>
|
|
|
- </div>}
|
|
|
- {data.hasService && <div className="tip-layout">
|
|
|
- <div className="t1">使用中</div>
|
|
|
- <div className="t2">距离到期还有 {data.expireDay} 天</div>
|
|
|
- </div>}
|
|
|
- {!data.hasService && !data.unUseRecord && data.expireTime && <div className="tip-layout">
|
|
|
- <div className="t3">已过期</div>
|
|
|
- <div className="date">{formatDate(data.startTime, 'YYYY-MM-DD')} ~ {formatDate(data.expireTime, 'YYYY-MM-DD')}</div>
|
|
|
- <div className="desc">¥ {service && service.package && service.package[0].price}</div>
|
|
|
- <Button radius size="lager" width={150}>
|
|
|
- 立即购买
|
|
|
- </Button>
|
|
|
- </div>}
|
|
|
+ <UserAction
|
|
|
+ right={
|
|
|
+ !data.hasService &&
|
|
|
+ data.unUseRecord && (
|
|
|
+ <div
|
|
|
+ className="email"
|
|
|
+ onClick={() => {
|
|
|
+ this.recordList({ page: 1, size: 10, service: 'qx_cat', isUse: false, isExpire: false });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 待开通
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ />
|
|
|
+ {!data.hasService && !data.unUseRecord && !data.expireTime && (
|
|
|
+ <div className="tip-layout">
|
|
|
+ <div className="t1">未购买</div>
|
|
|
+ <div className="desc">¥ {service && service.package && service.package[0].price}</div>
|
|
|
+ <Button radius size="lager" width={150}>
|
|
|
+ 立即购买
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {!data.hasService && data.unUseRecord && (
|
|
|
+ <div className="tip-layout">
|
|
|
+ <div className="t2">请于{formatDate(data.unUseRecord.endTime, 'YYYY-MM-DD')}前开通</div>
|
|
|
+ <Button
|
|
|
+ radius
|
|
|
+ size="lager"
|
|
|
+ width={150}
|
|
|
+ onClick={() => {
|
|
|
+ this.open(data.unUseRecord.id);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 立即开通
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {data.hasService && (
|
|
|
+ <div className="tip-layout">
|
|
|
+ <div className="t1">使用中</div>
|
|
|
+ <div className="t2">距离到期还有 {data.expireDay} 天</div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {!data.hasService && !data.unUseRecord && data.expireTime && (
|
|
|
+ <div className="tip-layout">
|
|
|
+ <div className="t3">已过期</div>
|
|
|
+ <div className="date">
|
|
|
+ {formatDate(data.startTime, 'YYYY-MM-DD')} ~ {formatDate(data.expireTime, 'YYYY-MM-DD')}
|
|
|
+ </div>
|
|
|
+ <div className="desc">¥ {service && service.package && service.package[0].price}</div>
|
|
|
+ <Button radius size="lager" width={150}>
|
|
|
+ 立即购买
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
</div>
|
|
|
);
|
|
|
}
|
|
@@ -521,26 +692,34 @@ export default class extends Page {
|
|
|
const { data } = this.state;
|
|
|
return (
|
|
|
<div className="tab-4-layout">
|
|
|
- {!data.hasService && !data.unUseRecord && !data.expireTime && <div className="tip-layout">
|
|
|
- <div className="t2">未购买</div>
|
|
|
- <Button radius size="lager" width={150}>
|
|
|
- 立即购买
|
|
|
- </Button>
|
|
|
- </div>}
|
|
|
- {data.hasService && <div className="tip-layout">
|
|
|
- <div className="t1">使用中</div>
|
|
|
- <div className="desc">{formatDate(data.expireTime, 'YYYY-MM-DD')} 到期</div>
|
|
|
- <Button radius size="lager" width={150}>
|
|
|
- 续费
|
|
|
- </Button>
|
|
|
- </div>}
|
|
|
- {!data.hasService && !data.unUseRecord && data.expireTime && <div className="tip-layout">
|
|
|
- <div className="t1">已过期</div>
|
|
|
- <div className="desc">{formatDate(data.startTime, 'YYYY-MM-DD')} ~ {formatDate(data.expireTime, 'YYYY-MM-DD')}</div>
|
|
|
- <Button radius size="lager" width={150}>
|
|
|
- 立即购买
|
|
|
- </Button>
|
|
|
- </div>}
|
|
|
+ {!data.hasService && !data.unUseRecord && !data.expireTime && (
|
|
|
+ <div className="tip-layout">
|
|
|
+ <div className="t2">未购买</div>
|
|
|
+ <Button radius size="lager" width={150}>
|
|
|
+ 立即购买
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {data.hasService && (
|
|
|
+ <div className="tip-layout">
|
|
|
+ <div className="t1">使用中</div>
|
|
|
+ <div className="desc">{formatDate(data.expireTime, 'YYYY-MM-DD')} 到期</div>
|
|
|
+ <Button radius size="lager" width={150}>
|
|
|
+ 续费
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {!data.hasService && !data.unUseRecord && data.expireTime && (
|
|
|
+ <div className="tip-layout">
|
|
|
+ <div className="t1">已过期</div>
|
|
|
+ <div className="desc">
|
|
|
+ {formatDate(data.startTime, 'YYYY-MM-DD')} ~ {formatDate(data.expireTime, 'YYYY-MM-DD')}
|
|
|
+ </div>
|
|
|
+ <Button radius size="lager" width={150}>
|
|
|
+ 立即购买
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
</div>
|
|
|
);
|
|
|
}
|
|
@@ -551,7 +730,7 @@ export default class extends Page {
|
|
|
<div className="tab-5-layout">
|
|
|
<TotalSort
|
|
|
value={data.value || 650}
|
|
|
- onChange={(value) => {
|
|
|
+ onChange={value => {
|
|
|
data.value = value;
|
|
|
this.setState({ data });
|
|
|
}}
|