|
@@ -428,7 +428,7 @@ export class EditAvatar extends Component {
|
|
|
};
|
|
|
} else {
|
|
|
const img = new Image();
|
|
|
- img.onload = function () {
|
|
|
+ img.onload = function() {
|
|
|
const canvas = document.createElement('canvas');
|
|
|
canvas.height = img.height;
|
|
|
canvas.width = img.width;
|
|
@@ -584,30 +584,51 @@ export class DownloadModal extends Component {
|
|
|
<div className="download-modal-wrapper">
|
|
|
<div className="t-2 t-s-18 m-b-1">请选择下载科目</div>
|
|
|
<div className="m-b-1">
|
|
|
- {quantVersion > 0 && <div className="t-2 t-s-16">
|
|
|
- <Checkbox checked={checkMap.quant} onChange={() => {
|
|
|
- checkMap.quant = !checkMap.quant;
|
|
|
- this.setState({ checkMap });
|
|
|
- }} />
|
|
|
- <span className="m-l-5">数学</span>
|
|
|
- <span className="t-8">(版本{quantVersion} 最后更新:{formatDate(data.quantTime, 'YYYY-MM-DD HH:mm:ss')})</span>
|
|
|
- </div>}
|
|
|
- {irVersion > 0 && <div className="t-2 t-s-16">
|
|
|
- <Checkbox checked={checkMap.ir} onChange={() => {
|
|
|
- checkMap.ir = !checkMap.ir;
|
|
|
- this.setState({ checkMap });
|
|
|
- }} />
|
|
|
- <span className="m-l-5">逻辑</span>
|
|
|
- <span className="t-8">(版本{irVersion} 最后更新:{formatDate(data.irTime, 'YYYY-MM-DD HH:mm:ss')})</span>
|
|
|
- </div>}
|
|
|
- {rcVersion > 0 && <div className="t-2 t-s-16">
|
|
|
- <Checkbox checked={checkMap.rc} onChange={() => {
|
|
|
- checkMap.rc = !checkMap.rc;
|
|
|
- this.setState({ checkMap });
|
|
|
- }} />
|
|
|
- <span className="m-l-5">阅读</span>
|
|
|
- <span className="t-8">(版本{rcVersion} 最后更新:{formatDate(data.rcTime, 'YYYY-MM-DD HH:mm:ss')})</span>
|
|
|
- </div>}
|
|
|
+ {quantVersion > 0 && (
|
|
|
+ <div className="t-2 t-s-16">
|
|
|
+ <Checkbox
|
|
|
+ checked={checkMap.quant}
|
|
|
+ onChange={() => {
|
|
|
+ checkMap.quant = !checkMap.quant;
|
|
|
+ this.setState({ checkMap });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <span className="m-l-5">数学</span>
|
|
|
+ <span className="t-8">
|
|
|
+ (版本{quantVersion} 最后更新:{formatDate(data.quantTime, 'YYYY-MM-DD HH:mm:ss')})
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {irVersion > 0 && (
|
|
|
+ <div className="t-2 t-s-16">
|
|
|
+ <Checkbox
|
|
|
+ checked={checkMap.ir}
|
|
|
+ onChange={() => {
|
|
|
+ checkMap.ir = !checkMap.ir;
|
|
|
+ this.setState({ checkMap });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <span className="m-l-5">逻辑</span>
|
|
|
+ <span className="t-8">
|
|
|
+ (版本{irVersion} 最后更新:{formatDate(data.irTime, 'YYYY-MM-DD HH:mm:ss')})
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {rcVersion > 0 && (
|
|
|
+ <div className="t-2 t-s-16">
|
|
|
+ <Checkbox
|
|
|
+ checked={checkMap.rc}
|
|
|
+ onChange={() => {
|
|
|
+ checkMap.rc = !checkMap.rc;
|
|
|
+ this.setState({ checkMap });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <span className="m-l-5">阅读</span>
|
|
|
+ <span className="t-8">
|
|
|
+ (版本{rcVersion} 最后更新:{formatDate(data.rcTime, 'YYYY-MM-DD HH:mm:ss')})
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
</div>
|
|
|
</div>
|
|
|
</Modal>
|
|
@@ -680,16 +701,12 @@ export class FeedbackErrorDataModal extends Component {
|
|
|
const { onConfirm } = this.props;
|
|
|
const { data } = this.state;
|
|
|
if (!data.content || !data.originContent) return;
|
|
|
- My.addFeedbackErrorData(
|
|
|
- data.dataId,
|
|
|
- data.title,
|
|
|
- data.position.join(','),
|
|
|
- data.originContent,
|
|
|
- data.content,
|
|
|
- ).then(() => {
|
|
|
- if (onConfirm) onConfirm();
|
|
|
- this.setState({ data: { position: ['', '', ''] } });
|
|
|
- });
|
|
|
+ My.addFeedbackErrorData(data.dataId, data.title, data.position.join(','), data.originContent, data.content).then(
|
|
|
+ () => {
|
|
|
+ if (onConfirm) onConfirm();
|
|
|
+ this.setState({ data: { position: ['', '', ''] } });
|
|
|
+ },
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
onCancel() {
|
|
@@ -786,13 +803,7 @@ export class AskCourseModal extends Component {
|
|
|
const { course, courseNo, onConfirm } = this.props;
|
|
|
const { data } = this.state;
|
|
|
if (!data.position || !data.originContent || !data.content) return;
|
|
|
- My.addCourseAsk(
|
|
|
- course.id,
|
|
|
- courseNo.id,
|
|
|
- data.position.join(','),
|
|
|
- data.originContent,
|
|
|
- data.content,
|
|
|
- ).then(() => {
|
|
|
+ My.addCourseAsk(course.id, courseNo.id, data.position.join(','), data.originContent, data.content).then(() => {
|
|
|
if (onConfirm) onConfirm();
|
|
|
this.setState({ data: { position: [] } });
|
|
|
});
|
|
@@ -818,10 +829,16 @@ export class AskCourseModal extends Component {
|
|
|
onCancel={() => this.onCancel()}
|
|
|
>
|
|
|
<div className="t-2 m-b-1 t-s-16">
|
|
|
- 针对<span className="t-4">课时{courseNo.no}</span>的 <Select value={data.position} theme="white" list={selectList} onChange={(item) => {
|
|
|
- data.position = item.key;
|
|
|
- this.setState({ data });
|
|
|
- }} />
|
|
|
+ 针对<span className="t-4">课时{courseNo.no}</span>的{' '}
|
|
|
+ <Select
|
|
|
+ value={data.position}
|
|
|
+ theme="white"
|
|
|
+ list={selectList}
|
|
|
+ onChange={item => {
|
|
|
+ data.position = item.key;
|
|
|
+ this.setState({ data });
|
|
|
+ }}
|
|
|
+ />
|
|
|
进行提问.
|
|
|
</div>
|
|
|
<div className="t-2 t-s-16">老师讲解的内容是:</div>
|
|
@@ -868,11 +885,7 @@ export class CourseNoteModal extends Component {
|
|
|
const { course, onConfirm } = this.props;
|
|
|
const { data } = this.state;
|
|
|
if (!data.content) return;
|
|
|
- My.updateCourseNote(
|
|
|
- course.id,
|
|
|
- data.courseNoId,
|
|
|
- data.content,
|
|
|
- ).then(() => {
|
|
|
+ My.updateCourseNote(course.id, data.courseNoId, data.content).then(() => {
|
|
|
if (onConfirm) onConfirm();
|
|
|
this.setState({ data: {} });
|
|
|
});
|
|
@@ -898,18 +911,23 @@ export class CourseNoteModal extends Component {
|
|
|
>
|
|
|
<div className="t-2 m-b-1 t-s-16">
|
|
|
{course.title}
|
|
|
- <Select theme="white" value={data.courseNoId} list={courseNos.map(row => {
|
|
|
- return {
|
|
|
- title: `课时${row.no}`,
|
|
|
- key: row.id,
|
|
|
- };
|
|
|
- })} onChange={(item) => {
|
|
|
- if (data.courseNoId !== item.key) {
|
|
|
- data.courseNoId = item.key;
|
|
|
- data.content = noteMap[item.key] ? noteMap[item.key].content : '';
|
|
|
- }
|
|
|
- this.setState({ data });
|
|
|
- }} />
|
|
|
+ <Select
|
|
|
+ theme="white"
|
|
|
+ value={data.courseNoId}
|
|
|
+ list={courseNos.map(row => {
|
|
|
+ return {
|
|
|
+ title: `课时${row.no}`,
|
|
|
+ key: row.id,
|
|
|
+ };
|
|
|
+ })}
|
|
|
+ onChange={item => {
|
|
|
+ if (data.courseNoId !== item.key) {
|
|
|
+ data.courseNoId = item.key;
|
|
|
+ data.content = noteMap[item.key] ? noteMap[item.key].content : '';
|
|
|
+ }
|
|
|
+ this.setState({ data });
|
|
|
+ }}
|
|
|
+ />
|
|
|
</div>
|
|
|
<textarea
|
|
|
value={data.content}
|
|
@@ -960,36 +978,44 @@ export class TextbookFeedbackModal extends Component {
|
|
|
const { show } = this.props;
|
|
|
const { data } = this.state;
|
|
|
return (
|
|
|
- <Modal
|
|
|
- show={show}
|
|
|
- title="反馈"
|
|
|
- width={630}
|
|
|
- onConfirm={() => this.onConfirm()}
|
|
|
- onCancel={() => this.onCancel()}
|
|
|
- >
|
|
|
+ <Modal show={show} title="反馈" width={630} onConfirm={() => this.onConfirm()} onCancel={() => this.onCancel()}>
|
|
|
<div className="t-2 t-s-16 m-b-1">
|
|
|
- 机经类别: <Select
|
|
|
+ 机经类别:{' '}
|
|
|
+ <Select
|
|
|
value={data.questionSubject}
|
|
|
theme="white"
|
|
|
- list={[{ title: '数学机经', key: 'quant' }, { title: '逻辑机经', key: 'rc' }, { title: '阅读机经', key: 'ir' }]}
|
|
|
- onChange={(value) => {
|
|
|
+ list={[
|
|
|
+ { title: '数学机经', key: 'quant' },
|
|
|
+ { title: '逻辑机经', key: 'rc' },
|
|
|
+ { title: '阅读机经', key: 'ir' },
|
|
|
+ ]}
|
|
|
+ onChange={value => {
|
|
|
data.questionSubject = value;
|
|
|
this.setState({ data });
|
|
|
}}
|
|
|
/>
|
|
|
- 反馈类型: <Select
|
|
|
+ 反馈类型:{' '}
|
|
|
+ <Select
|
|
|
value={data.target}
|
|
|
theme="white"
|
|
|
list={TextbookFeedbackTarget}
|
|
|
- onChange={(value) => {
|
|
|
+ onChange={value => {
|
|
|
data.target = value;
|
|
|
this.setState({ data });
|
|
|
}}
|
|
|
/>
|
|
|
- <span hidden={data.target === 'new'}> 题号是 <input value={data.no} style={{ width: 80 }} className="m-l-1 b-c-1 t-c" onChange={e => {
|
|
|
- data.no = e.target.value;
|
|
|
- this.setState({ data });
|
|
|
- }} />
|
|
|
+ <span hidden={data.target === 'new'}>
|
|
|
+ {' '}
|
|
|
+ 题号是{' '}
|
|
|
+ <input
|
|
|
+ value={data.no}
|
|
|
+ style={{ width: 80 }}
|
|
|
+ className="m-l-1 b-c-1 t-c"
|
|
|
+ onChange={e => {
|
|
|
+ data.no = e.target.value;
|
|
|
+ this.setState({ data });
|
|
|
+ }}
|
|
|
+ />
|
|
|
</span>
|
|
|
</div>
|
|
|
<div className="t-2 t-s-16">{TextbookFeedbackTargetMap[data.target]}:</div>
|
|
@@ -1035,12 +1061,7 @@ export class FaqModal extends Component {
|
|
|
const { show } = this.props;
|
|
|
const { data } = this.state;
|
|
|
return (
|
|
|
- <Modal
|
|
|
- show={show}
|
|
|
- title="咨询"
|
|
|
- onConfirm={() => this.onConfirm()}
|
|
|
- onCancel={() => this.onCancel()}
|
|
|
- >
|
|
|
+ <Modal show={show} title="咨询" onConfirm={() => this.onConfirm()} onCancel={() => this.onCancel()}>
|
|
|
<textarea
|
|
|
value={data.content}
|
|
|
className="b-c-1 w-10 p-10"
|
|
@@ -1083,12 +1104,7 @@ export class CommentModal extends Component {
|
|
|
const { show } = this.props;
|
|
|
const { data } = this.state;
|
|
|
return (
|
|
|
- <Modal
|
|
|
- show={show}
|
|
|
- title="评价"
|
|
|
- onConfirm={() => this.onConfirm()}
|
|
|
- onCancel={() => this.onCancel()}
|
|
|
- >
|
|
|
+ <Modal show={show} title="评价" onConfirm={() => this.onConfirm()} onCancel={() => this.onCancel()}>
|
|
|
<textarea
|
|
|
value={data.content}
|
|
|
className="b-c-1 w-10 p-10"
|
|
@@ -1109,17 +1125,64 @@ export class FinishModal extends Component {
|
|
|
render() {
|
|
|
const { show, onConfirm } = this.props;
|
|
|
return (
|
|
|
- <Modal
|
|
|
- show={show}
|
|
|
- title="提交成功"
|
|
|
- confirmText="好的,知道了"
|
|
|
- btnAlign="center"
|
|
|
- onConfirm={() => onConfirm()}
|
|
|
- >
|
|
|
+ <Modal show={show} title="提交成功" confirmText="好的,知道了" btnAlign="center" onConfirm={() => onConfirm()}>
|
|
|
<div className="t-2 t-s-18">
|
|
|
<Icon type="check" className="t-5 m-r-5" />
|
|
|
您的每一次反馈都是千行进步的动力。
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ </Modal>
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class SuppleModal extends Component {
|
|
|
+ constructor(props) {
|
|
|
+ super(props);
|
|
|
+ this.state = { data: {} };
|
|
|
+ }
|
|
|
+
|
|
|
+ onConfirm() {
|
|
|
+ const { onConfirm } = this.props;
|
|
|
+ if (onConfirm) onConfirm();
|
|
|
+ }
|
|
|
+
|
|
|
+ onCancel() {
|
|
|
+ const { onCancel } = this.props;
|
|
|
+ if (onCancel) onCancel();
|
|
|
+ this.setState({ data: {} });
|
|
|
+ }
|
|
|
+
|
|
|
+ render() {
|
|
|
+ const { show } = this.props;
|
|
|
+ const { data } = this.state;
|
|
|
+ return (
|
|
|
+ <Modal show={show} title="考场信息" onConfirm={() => this.onConfirm()} onCancel={() => this.onCancel()}>
|
|
|
+ <div className="t-2 t-s-16">考场位置: 中国 上海 XXXXXXXXXXX</div>
|
|
|
+ <div className="t-2 t-s-16">补充内容:</div>
|
|
|
+ <textarea
|
|
|
+ value={data.content}
|
|
|
+ className="b-c-1 w-10 p-10"
|
|
|
+ rows={6}
|
|
|
+ onChange={e => {
|
|
|
+ data.content = e.target.value;
|
|
|
+ this.setState({ data });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <div className="b-b m-t-2" />
|
|
|
+ </Modal>
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class SuppleFinishModal extends Component {
|
|
|
+ render() {
|
|
|
+ const { show, onConfirm } = this.props;
|
|
|
+ return (
|
|
|
+ <Modal show={show} title="提交成功" confirmText="好的,知道了" btnAlign="center" onConfirm={() => onConfirm()}>
|
|
|
+ <div className="t-2 t-s-18">
|
|
|
+ <Icon type="check" className="t-5 m-r-5" />
|
|
|
+ 您的每一次反馈都是千行进步的动力。
|
|
|
+ </div>
|
|
|
</Modal>
|
|
|
);
|
|
|
}
|