|
@@ -1,7 +1,7 @@
|
|
|
import React, { Component } from 'react';
|
|
|
import { Link } from 'react-router-dom';
|
|
|
import './index.less';
|
|
|
-import { Icon } from 'antd';
|
|
|
+import { Icon, Dropdown } from 'antd';
|
|
|
import FileUpload from '@src/components/FileUpload';
|
|
|
import Page from '@src/containers/Page';
|
|
|
import Assets from '@src/components/Assets';
|
|
@@ -10,6 +10,7 @@ import { formatDate, formatSeconds, formatPercent } from '@src/services/Tools';
|
|
|
import UserLayout from '../../../layouts/User';
|
|
|
import Button from '../../../components/Button';
|
|
|
import ProgressText from '../../../components/ProgressText';
|
|
|
+import IconButton from '../../../components/IconButton';
|
|
|
import { Icon as GIcon } from '../../../components/Icon';
|
|
|
import menu from '../index';
|
|
|
import Tabs from '../../../components/Tabs';
|
|
@@ -148,7 +149,7 @@ export default class extends Page {
|
|
|
const courseMap = {};
|
|
|
const previewMap = {};
|
|
|
const stopMap = {};
|
|
|
- result.forEach((row) => {
|
|
|
+ result.forEach(row => {
|
|
|
const date = formatDate(row.day, 'YYYY-MM-DD');
|
|
|
if (row.type === 'stop') {
|
|
|
stopMap[date] = true;
|
|
@@ -166,24 +167,24 @@ export default class extends Page {
|
|
|
}
|
|
|
|
|
|
refreshDetail(recordId) {
|
|
|
- My.detailCourse(recordId)
|
|
|
- .then(result => {
|
|
|
- let { list } = this.state;
|
|
|
- list = list.map(row => {
|
|
|
- if (row.id === recordId) return this.formatRecord(result);
|
|
|
- return row;
|
|
|
- });
|
|
|
- this.setState({ list });
|
|
|
+ My.detailCourse(recordId).then(result => {
|
|
|
+ let { list } = this.state;
|
|
|
+ list = list.map(row => {
|
|
|
+ if (row.id === recordId) return this.formatRecord(result);
|
|
|
+ return row;
|
|
|
});
|
|
|
+ this.setState({ list });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
suspend() {
|
|
|
const { suspend } = this.state;
|
|
|
- My.suspendCourse(suspend.id).then(() => {
|
|
|
- asyncSMessage('停课成功');
|
|
|
- this.setState({ showSuspend: false });
|
|
|
- this.refreshDetail(suspend.id);
|
|
|
- })
|
|
|
+ My.suspendCourse(suspend.id)
|
|
|
+ .then(() => {
|
|
|
+ asyncSMessage('停课成功');
|
|
|
+ this.setState({ showSuspend: false });
|
|
|
+ this.refreshDetail(suspend.id);
|
|
|
+ })
|
|
|
.catch(err => {
|
|
|
asyncSMessage(err.message, 'error');
|
|
|
});
|
|
@@ -191,11 +192,12 @@ export default class extends Page {
|
|
|
|
|
|
restore() {
|
|
|
const { restore } = this.state;
|
|
|
- My.restoreCourse(restore.id).then(() => {
|
|
|
- asyncSMessage('恢复成功');
|
|
|
- this.setState({ showRestore: false });
|
|
|
- this.refreshDetail(restore.id);
|
|
|
- })
|
|
|
+ My.restoreCourse(restore.id)
|
|
|
+ .then(() => {
|
|
|
+ asyncSMessage('恢复成功');
|
|
|
+ this.setState({ showRestore: false });
|
|
|
+ this.refreshDetail(restore.id);
|
|
|
+ })
|
|
|
.catch(err => {
|
|
|
asyncSMessage(err.message, 'error');
|
|
|
});
|
|
@@ -204,15 +206,13 @@ export default class extends Page {
|
|
|
submitAppointmentComment(data, type) {
|
|
|
data.type = type;
|
|
|
if (data.id) {
|
|
|
- My.editAppointmentComment(data)
|
|
|
- .then(() => {
|
|
|
- this.refreshDetail(data.recordId);
|
|
|
- });
|
|
|
+ My.editAppointmentComment(data).then(() => {
|
|
|
+ this.refreshDetail(data.recordId);
|
|
|
+ });
|
|
|
} else {
|
|
|
- My.addAppointmentComment(data)
|
|
|
- .then(() => {
|
|
|
- this.refreshDetail(data.recordId);
|
|
|
- });
|
|
|
+ My.addAppointmentComment(data).then(() => {
|
|
|
+ this.refreshDetail(data.recordId);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -252,18 +252,56 @@ export default class extends Page {
|
|
|
My.courseCommentTips(recordId);
|
|
|
}
|
|
|
|
|
|
+ uploadNote(file) {
|
|
|
+ const { note = {} } = this.state;
|
|
|
+ Common.uploadImage(file).then(result => {
|
|
|
+ note.file = result.url;
|
|
|
+ note.name = file.name;
|
|
|
+ this.setState({ note });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ uploadSupply(file) {
|
|
|
+ const { supply = {} } = this.state;
|
|
|
+ Common.uploadImage(file).then(result => {
|
|
|
+ supply.file = result.url;
|
|
|
+ supply.name = file.name;
|
|
|
+ this.setState({ supply });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
renderView() {
|
|
|
const { config } = this.props;
|
|
|
return <UserLayout active={config.key} menu={menu} center={this.renderDetail()} />;
|
|
|
}
|
|
|
|
|
|
renderDetail() {
|
|
|
- const { tab, status, showTips, showTime, showSuspend, showRestore, showUploadNote, showUploadSupply, showSupply, showNote, showComment, showFinish, comment = {}, data = {}, note = {}, supply = {}, appointment = {} } = this.state;
|
|
|
+ const {
|
|
|
+ tab,
|
|
|
+ status,
|
|
|
+ showTips,
|
|
|
+ showTime,
|
|
|
+ showSuspend,
|
|
|
+ showRestore,
|
|
|
+ showUploadNote,
|
|
|
+ showUploadSupply,
|
|
|
+ showSupply,
|
|
|
+ showNote,
|
|
|
+ showComment,
|
|
|
+ showFinish,
|
|
|
+ comment = {},
|
|
|
+ data = {},
|
|
|
+ note = {},
|
|
|
+ supply = {},
|
|
|
+ appointment = {},
|
|
|
+ } = this.state;
|
|
|
return (
|
|
|
<div className="detail-layout">
|
|
|
<div hidden={!showTips} className="tip">
|
|
|
<div className="text">理清备考思路,避开常见误区,让学习的每一分钟发光发热!</div>
|
|
|
- <a href="" target="_blank">去填写 ></a>
|
|
|
+ <a href="" target="_blank">
|
|
|
+ 去填写 >
|
|
|
+ </a>
|
|
|
<Icon type="close-circle" theme="filled" onClick={() => this.setState({ showTips: false })} />
|
|
|
</div>
|
|
|
<Tabs
|
|
@@ -331,7 +369,7 @@ export default class extends Page {
|
|
|
return (
|
|
|
<div className="ant-calendar-date">
|
|
|
{current.get('date')}
|
|
|
- {data.courseTimeMap[date] && < i className="s1" style={{ background: '#6865FD' }} />}
|
|
|
+ {data.courseTimeMap[date] && <i className="s1" style={{ background: '#6865FD' }} />}
|
|
|
{data.previewTimeMap[date] && <i className="s2" style={{ background: '#4299FF' }} />}
|
|
|
</div>
|
|
|
);
|
|
@@ -375,13 +413,32 @@ export default class extends Page {
|
|
|
您的每一次反馈都是千行进步的动力。
|
|
|
</div>
|
|
|
</Modal>
|
|
|
- <Modal show={showSuspend} title="申请停课" onConfirm={() => this.suspend()} onCancel={() => this.setState({ showSuspend: false })}>
|
|
|
- <div className="t-2 t-s-18">最长停课时间为1个月,截止日期将顺延。</div>
|
|
|
- <div className="t-2 t-s-18">停课不影响学习频率计算。</div>
|
|
|
- <div className="t-2 t-s-18">停课期间可随时恢复学习,</div>
|
|
|
+ <Modal
|
|
|
+ show={showSuspend}
|
|
|
+ title="申请停课"
|
|
|
+ width={630}
|
|
|
+ confirmText="立即停课"
|
|
|
+ onConfirm={() => this.suspend()}
|
|
|
+ onCancel={() => this.setState({ showSuspend: false })}
|
|
|
+ >
|
|
|
+ <div className="t-2 t-s-18">最长停课周期为1个月,到期后系统自动恢复至“学习中”状态。</div>
|
|
|
<div className="t-2 t-s-18">每门课程只有一次申请机会,是否需要停课?</div>
|
|
|
+ <div style={{ bottom: 20, left: 0 }} className="p-a t-3 t-s-14">
|
|
|
+ *停课不影响听课频率的计算;
|
|
|
+ </div>
|
|
|
+ <div style={{ bottom: 0, left: 0 }} className="p-a t-3 t-s-14">
|
|
|
+ {' '}
|
|
|
+ 停课期间可随时恢复学习。
|
|
|
+ </div>
|
|
|
</Modal>
|
|
|
- <Modal show={showRestore} title="恢复学习" onConfirm={() => this.restore()} onCancel={() => this.setState({ showRestore: false })}>
|
|
|
+ <Modal
|
|
|
+ show={showRestore}
|
|
|
+ title="恢复学习"
|
|
|
+ width={630}
|
|
|
+ confirmText="立即恢复"
|
|
|
+ onConfirm={() => this.restore()}
|
|
|
+ onCancel={() => this.setState({ showRestore: false })}
|
|
|
+ >
|
|
|
<div className="t-2 t-s-18">恢复学习后,本课程的停课功能将无法使用。是否恢复学习?</div>
|
|
|
</Modal>
|
|
|
<Modal
|
|
@@ -421,19 +478,38 @@ export default class extends Page {
|
|
|
</div>
|
|
|
<div className="b-b m-t-2" />
|
|
|
</Modal>
|
|
|
- <Modal show={showNote} title="课后笔记" width={500} height={500} onClose={() => this.setState({ showNote: false })}>
|
|
|
- {appointment.noteList && appointment.noteList.map(row => {
|
|
|
- return <Note user={this.props.user} teacher={data.teacher} data={row} />;
|
|
|
- })}
|
|
|
+ <Modal
|
|
|
+ show={showNote}
|
|
|
+ title="课后笔记"
|
|
|
+ width={500}
|
|
|
+ height={500}
|
|
|
+ onClose={() => this.setState({ showNote: false })}
|
|
|
+ >
|
|
|
+ {appointment.noteList &&
|
|
|
+ appointment.noteList.map(row => {
|
|
|
+ return <Note user={this.props.user} teacher={data.teacher} data={row} />;
|
|
|
+ })}
|
|
|
</Modal>
|
|
|
- <Modal show={showSupply} title="课后留言" width={500} height={500} onClose={() => this.setState({ showSupply: false })}>
|
|
|
- {appointment.supplyList && appointment.supplyList.map(row => {
|
|
|
- return <Note user={this.props.user} teacher={data.teacher} data={row} />;
|
|
|
- })}
|
|
|
+ <Modal
|
|
|
+ show={showSupply}
|
|
|
+ title="课后留言"
|
|
|
+ width={500}
|
|
|
+ height={500}
|
|
|
+ onClose={() => this.setState({ showSupply: false })}
|
|
|
+ >
|
|
|
+ {appointment.supplyList &&
|
|
|
+ appointment.supplyList.map(row => {
|
|
|
+ return <Note user={this.props.user} teacher={data.teacher} data={row} />;
|
|
|
+ })}
|
|
|
</Modal>
|
|
|
- <Modal show={showUploadSupply} title="上传留言"
|
|
|
+ <Modal
|
|
|
+ show={showUploadSupply}
|
|
|
+ title="上传留言"
|
|
|
width={630}
|
|
|
- confirmText="提交" onConfirm={() => this.submitAppointmentComment(supply, 'supply')} onCancel={() => this.setState({ showUploadSupply: false, supply: {} })}>
|
|
|
+ confirmText="提交"
|
|
|
+ onConfirm={() => this.submitAppointmentComment(supply, 'supply')}
|
|
|
+ onCancel={() => this.setState({ showUploadSupply: false, supply: {} })}
|
|
|
+ >
|
|
|
<textarea
|
|
|
className="b-c-1 w-10 p-10 m-b-1"
|
|
|
rows={6}
|
|
@@ -470,17 +546,28 @@ export default class extends Page {
|
|
|
renderTabonline() {
|
|
|
const { list = [] } = this.state;
|
|
|
return list.map(item => {
|
|
|
- return <CourseOnline data={item} user={this.props.user} refreshDetail={(recordId) => {
|
|
|
- this.refreshDetail(recordId);
|
|
|
- }} onRestore={() => {
|
|
|
- this.setState({ showRestore: true, restore: item });
|
|
|
- }} onSuspend={() => {
|
|
|
- this.setState({ showSuspend: true, suspend: item });
|
|
|
- }} onTime={() => {
|
|
|
- this.openTime(item);
|
|
|
- }} onComment={() => {
|
|
|
- this.setState({ showComment: true, comment: { channel: 'course-video', position: item.course.id } });
|
|
|
- }} closeCommentTips={() => this.closeCommentTips(item.id)} />;
|
|
|
+ return (
|
|
|
+ <CourseOnline
|
|
|
+ data={item}
|
|
|
+ user={this.props.user}
|
|
|
+ refreshDetail={recordId => {
|
|
|
+ this.refreshDetail(recordId);
|
|
|
+ }}
|
|
|
+ onRestore={() => {
|
|
|
+ this.setState({ showRestore: true, restore: item });
|
|
|
+ }}
|
|
|
+ onSuspend={() => {
|
|
|
+ this.setState({ showSuspend: true, suspend: item });
|
|
|
+ }}
|
|
|
+ onTime={() => {
|
|
|
+ this.openTime(item);
|
|
|
+ }}
|
|
|
+ onComment={() => {
|
|
|
+ this.setState({ showComment: true, comment: { channel: 'course-video', position: item.course.id } });
|
|
|
+ }}
|
|
|
+ closeCommentTips={() => this.closeCommentTips(item.id)}
|
|
|
+ />
|
|
|
+ );
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -524,14 +611,26 @@ class CourseOnline extends Component {
|
|
|
key: 'paper',
|
|
|
render: (text, record) => {
|
|
|
const { paper = {} } = record;
|
|
|
- return `${paper.paper && paper.paper.times > 0 ? `${paper.paper.times}次+` : ''}${paper.report ? formatPercent(paper.report.userNumber, paper.report.questionNumber, false) : '0%'}`;
|
|
|
+ return `${paper.paper && paper.paper.times > 0 ? `${paper.paper.times}次+` : ''}${
|
|
|
+ paper.report ? formatPercent(paper.report.userNumber, paper.report.questionNumber, false) : '0%'
|
|
|
+ }`;
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
title: '进度',
|
|
|
key: 'progress',
|
|
|
render: (text, record) => {
|
|
|
- return `${record.progress && record.progress.times > 0 ? `${record.progress.times}次+` : ''}${record.progress ? record.progress.progress : 0}%`;
|
|
|
+ return record.progress ? (
|
|
|
+ <div>
|
|
|
+ <div className="v-a-m d-i-b">
|
|
|
+ <ProgressText width={50} size="small" times={1} progress={20} unit="次" />
|
|
|
+ </div>
|
|
|
+ <IconButton className="m-l-2" type="start" />
|
|
|
+ <IconButton className="m-l-5" type="report" />
|
|
|
+ </div>
|
|
|
+ ) : (
|
|
|
+ '-'
|
|
|
+ );
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -545,15 +644,18 @@ class CourseOnline extends Component {
|
|
|
{
|
|
|
title: '笔记',
|
|
|
key: 'note',
|
|
|
- render: (text) => {
|
|
|
- return text;
|
|
|
+ render: () => {
|
|
|
+ return <GIcon name="note" active />;
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
title: '问答',
|
|
|
key: 'ask',
|
|
|
render: (text, record) => {
|
|
|
- return <Link to={`/course/ask/${record.courseId}?no=${record.id}`}>{`${record.answerNumber || 0}/${record.askNumber || 0}`}</Link>;
|
|
|
+ return (
|
|
|
+ <Link to={`/course/ask/${record.courseId}?no=${record.id}`}>{`${record.answerNumber ||
|
|
|
+ 0}/${record.askNumber || 0}`}</Link>
|
|
|
+ );
|
|
|
},
|
|
|
},
|
|
|
];
|
|
@@ -585,7 +687,8 @@ class CourseOnline extends Component {
|
|
|
<div className="tag">学习中</div>
|
|
|
<div className="text">{data.course.title}</div>
|
|
|
<div className="right">
|
|
|
- <More menu={[{ label: '评价', key: 'comment' }, { label: '停课', key: 'suspend' }]}
|
|
|
+ <More
|
|
|
+ menu={[{ label: '评价', key: 'comment' }, { label: '停课', key: 'suspend' }]}
|
|
|
onClick={value => {
|
|
|
const { key } = value;
|
|
|
if (key === 'comment') {
|
|
@@ -593,15 +696,21 @@ class CourseOnline extends Component {
|
|
|
} else if (key === 'suspend') {
|
|
|
onSuspend();
|
|
|
}
|
|
|
- }} />
|
|
|
+ }}
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
- {data.currentCourseNo && <div className="continue" onClick={() => {
|
|
|
- linkTo(`/course/detail/${data.course.id}`);
|
|
|
- }}>
|
|
|
- <Assets name="notice" />
|
|
|
- 继续学习:课时 {data.currentNo}:{data.currentCourseNo.title}
|
|
|
- </div>}
|
|
|
+ {data.currentCourseNo && (
|
|
|
+ <div
|
|
|
+ className="continue"
|
|
|
+ onClick={() => {
|
|
|
+ linkTo(`/course/detail/${data.course.id}`);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Assets name="notice" />
|
|
|
+ 继续学习:课时 {data.currentNo}:{data.currentCourseNo.title}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
<div className="detail">
|
|
|
<div className="left">
|
|
|
<Assets name="sun_blue" src={data.course.cover} />
|
|
@@ -633,9 +742,7 @@ class CourseOnline extends Component {
|
|
|
</div>
|
|
|
<div className="item">
|
|
|
<GIcon name="note-block" active noHover />
|
|
|
- <div className="text">
|
|
|
- {data.noteNumber}
|
|
|
- </div>
|
|
|
+ <div className="text">{data.noteNumber}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="open">
|
|
@@ -662,22 +769,26 @@ class CourseOnline extends Component {
|
|
|
<div className="t1">授课老师</div>
|
|
|
<div className="t2">{data.course.teacher}</div>
|
|
|
<div>
|
|
|
- <div className='d-i-b m-r-2'>
|
|
|
- <div className='t-2'>课时</div>
|
|
|
- <div className='t-1 t-s-16'>{data.courseNos.length}</div>
|
|
|
+ <div className="d-i-b m-r-2">
|
|
|
+ <div className="t-2">课时</div>
|
|
|
+ <div className="t-1 t-s-16">{data.courseNos.length}</div>
|
|
|
</div>
|
|
|
- <div className='d-i-b'>
|
|
|
- <div className='t-2'>总时长</div>
|
|
|
- <div className='t-1 t-s-16'>{formatSeconds(data.courseTime)}</div>
|
|
|
+ <div className="d-i-b">
|
|
|
+ <div className="t-2">总时长</div>
|
|
|
+ <div className="t-1 t-s-16">{formatSeconds(data.courseTime)}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="right t-c">
|
|
|
<div className="text">请于 {formatDate(data.endTime, 'YYYY-MM-DD')} 前开通</div>
|
|
|
- <Button size="lager" radius onClick={() => {
|
|
|
- this.open(data.id);
|
|
|
- }}>
|
|
|
+ <Button
|
|
|
+ size="lager"
|
|
|
+ radius
|
|
|
+ onClick={() => {
|
|
|
+ this.open(data.id);
|
|
|
+ }}
|
|
|
+ >
|
|
|
立即开通
|
|
|
</Button>
|
|
|
</div>
|
|
@@ -695,13 +806,15 @@ class CourseOnline extends Component {
|
|
|
<div className="tag">已结束</div>
|
|
|
<div className="text">{data.course.title}</div>
|
|
|
<div className="right">
|
|
|
- <More menu={[{ label: '评价', key: 'comment' }]}
|
|
|
+ <More
|
|
|
+ menu={[{ label: '评价', key: 'comment' }]}
|
|
|
onClick={value => {
|
|
|
const { key } = value;
|
|
|
if (key === 'comment') {
|
|
|
onComment();
|
|
|
}
|
|
|
- }} />
|
|
|
+ }}
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="detail">
|
|
@@ -729,14 +842,14 @@ class CourseOnline extends Component {
|
|
|
</div>
|
|
|
<div className="item">
|
|
|
<GIcon name="note-block" active noHover />
|
|
|
- <div className="text">
|
|
|
- {data.noteNumber}
|
|
|
- </div>
|
|
|
+ <div className="text">{data.noteNumber}</div>
|
|
|
</div>
|
|
|
- {data.courseAward > 0 && <div className="item">
|
|
|
- <GIcon name="gift-block" active />
|
|
|
- <div className="text">赠送{data.courseAward}天</div>
|
|
|
- </div>}
|
|
|
+ {data.courseAward > 0 && (
|
|
|
+ <div className="item">
|
|
|
+ <GIcon name="gift-block" active />
|
|
|
+ <div className="text">赠送{data.courseAward}天</div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
</div>
|
|
|
<div className="open">
|
|
|
<GIcon name={open ? 'up' : 'down'} onClick={() => this.setState({ open: !open })} />
|
|
@@ -754,16 +867,28 @@ class CourseOnline extends Component {
|
|
|
<div className="course-item end">
|
|
|
<div className="title">
|
|
|
<div className="tag">已停课</div>
|
|
|
- <div className="text">{data.course.title}<Button size="small" radius onClick={() => onRestore()} >恢复上课</Button></div>
|
|
|
- <div className='t-s-12'><span className='t-3'>申请时间:</span><span className='t-2 m-r-1'>{formatDate(data.suspendTime, 'YYYY-MM-DD HH:mm:ss')}</span><span className='t-3'>已停课:</span><span>{parseInt((new Date().getTime() - new Date(data.suspendTime).getTime()) / 86400000, 10)}Days/30</span></div>
|
|
|
+ <div className="text">
|
|
|
+ {data.course.title}
|
|
|
+ <Button size="small" radius onClick={() => onRestore()}>
|
|
|
+ 恢复上课
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ <div className="t-s-12">
|
|
|
+ <span className="t-3">申请时间:</span>
|
|
|
+ <span className="t-2 m-r-1">{formatDate(data.suspendTime, 'YYYY-MM-DD HH:mm:ss')}</span>
|
|
|
+ <span className="t-3">已停课:</span>
|
|
|
+ <span>{parseInt((new Date().getTime() - new Date(data.suspendTime).getTime()) / 86400000, 10)}Days/30</span>
|
|
|
+ </div>
|
|
|
<div className="right">
|
|
|
- <More menu={[{ label: '评价', key: 'comment' }]}
|
|
|
+ <More
|
|
|
+ menu={[{ label: '评价', key: 'comment' }]}
|
|
|
onClick={value => {
|
|
|
const { key } = value;
|
|
|
if (key === 'comment') {
|
|
|
onComment();
|
|
|
}
|
|
|
- }} />
|
|
|
+ }}
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -798,9 +923,7 @@ class CourseOnline extends Component {
|
|
|
</div>
|
|
|
<div className="item">
|
|
|
<GIcon name="note-block" active noHover />
|
|
|
- <div className="text">
|
|
|
- {data.noteNumber}
|
|
|
- </div>
|
|
|
+ <div className="text">{data.noteNumber}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="open">
|
|
@@ -819,7 +942,6 @@ class CourseOnline extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
const titleMap = {
|
|
|
1: '预约时间',
|
|
|
2: '答疑文档',
|
|
@@ -840,11 +962,11 @@ const iconMap = {
|
|
|
};
|
|
|
|
|
|
const statusMap = {
|
|
|
- 1: (appointment) => {
|
|
|
+ 1: appointment => {
|
|
|
if (!appointment.id) return 'end';
|
|
|
return '';
|
|
|
},
|
|
|
- 2: (appointment) => {
|
|
|
+ 2: appointment => {
|
|
|
if (!appointment.questionFile) return 'not';
|
|
|
return '';
|
|
|
},
|
|
@@ -879,8 +1001,18 @@ class CourseVs extends Component {
|
|
|
{
|
|
|
title: '预习作业',
|
|
|
key: 'paper',
|
|
|
- render: () => {
|
|
|
-
|
|
|
+ render: (text, record) => {
|
|
|
+ return record.progress ? (
|
|
|
+ <div>
|
|
|
+ <div className="v-a-m d-i-b">
|
|
|
+ <ProgressText width={50} size="small" times={1} progress={20} unit="次" />
|
|
|
+ </div>
|
|
|
+ <IconButton className="m-l-2" type="start" />
|
|
|
+ <IconButton className="m-l-5" type="report" />
|
|
|
+ </div>
|
|
|
+ ) : (
|
|
|
+ '-'
|
|
|
+ );
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -911,7 +1043,11 @@ class CourseVs extends Component {
|
|
|
title: '答疑文档',
|
|
|
key: 'questionFile',
|
|
|
render: (text, record) => {
|
|
|
- return <a href={text} target="_blank">{record.questionFileName}</a>;
|
|
|
+ return (
|
|
|
+ <a href={text} target="_blank">
|
|
|
+ {record.questionFileName}
|
|
|
+ </a>
|
|
|
+ );
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -938,14 +1074,22 @@ class CourseVs extends Component {
|
|
|
answer: [1, 2, 3],
|
|
|
};
|
|
|
const index = props.data.appointments.length - 1;
|
|
|
- this.state = { open: false, tab: 'ing', index, list: this.listMap[this.props.data.course.vsType], showTips: props.data.commentTips === 0 && (props.data.appointments.length === parseInt(props.data.number / 2, 10) || props.data.appointments.length === props.data.number) };
|
|
|
+ this.state = {
|
|
|
+ open: false,
|
|
|
+ tab: 'ing',
|
|
|
+ index,
|
|
|
+ list: this.listMap[this.props.data.course.vsType],
|
|
|
+ showTips:
|
|
|
+ props.data.commentTips === 0 &&
|
|
|
+ (props.data.appointments.length === parseInt(props.data.number / 2, 10) ||
|
|
|
+ props.data.appointments.length === props.data.number),
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
closeCommentTips() {
|
|
|
- My.courseCommentTips(this.props.data.id)
|
|
|
- .then(() => {
|
|
|
- this.setState({ showTips: false });
|
|
|
- });
|
|
|
+ My.courseCommentTips(this.props.data.id).then(() => {
|
|
|
+ this.setState({ showTips: false });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
render() {
|
|
@@ -971,15 +1115,21 @@ class CourseVs extends Component {
|
|
|
<div className="education-item ing">
|
|
|
<div className="title">
|
|
|
<div className="tag">学习中</div>
|
|
|
- <div className="text">{data.course.title}{data.vsNo > 0 ? `V${data.vsNo}` : ''}{data.number > 0 ? `(${data.number}课时)` : ''}</div>
|
|
|
+ <div className="text">
|
|
|
+ {data.course.title}
|
|
|
+ {data.vsNo > 0 ? `V${data.vsNo}` : ''}
|
|
|
+ {data.number > 0 ? `(${data.number}课时)` : ''}
|
|
|
+ </div>
|
|
|
<div className="right">
|
|
|
- <More menu={[{ label: '评价', key: 'comment' }, { label: '停课', key: 'suspend' }]}
|
|
|
+ <More
|
|
|
+ menu={[{ label: '评价', key: 'comment' }, { label: '停课', key: 'suspend' }]}
|
|
|
onClick={value => {
|
|
|
const { key } = value;
|
|
|
if (key === 'comment') {
|
|
|
onComment();
|
|
|
}
|
|
|
- }} />
|
|
|
+ }}
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
{showTips && <div className="continue">
|
|
@@ -1035,7 +1185,11 @@ class CourseVs extends Component {
|
|
|
<div className="education-item not">
|
|
|
<div className="title">
|
|
|
<div className="tag">未开通</div>
|
|
|
- <div className="text">{data.course.title}{data.vsNo > 0 ? `V${data.vsNo}` : ''}{data.number > 0 ? `(${data.number}课时)` : ''}</div>
|
|
|
+ <div className="text">
|
|
|
+ {data.course.title}
|
|
|
+ {data.vsNo > 0 ? `V${data.vsNo}` : ''}
|
|
|
+ {data.number > 0 ? `(${data.number}课时)` : ''}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div className="detail">
|
|
|
<div className="left">
|
|
@@ -1044,13 +1198,13 @@ class CourseVs extends Component {
|
|
|
<div className="t1">授课老师</div>
|
|
|
<div className="t2">{data.teacher.realname}</div>
|
|
|
<div>
|
|
|
- <div className='d-i-b m-r-2'>
|
|
|
- <div className='t-2'>课时</div>
|
|
|
- <div className='t-1 t-s-16'>{data.number}</div>
|
|
|
+ <div className="d-i-b m-r-2">
|
|
|
+ <div className="t-2">课时</div>
|
|
|
+ <div className="t-1 t-s-16">{data.number}</div>
|
|
|
</div>
|
|
|
- <div className='d-i-b'>
|
|
|
- <div className='t-2'>总时长</div>
|
|
|
- <div className='t-1 t-s-16'>{data.number}Hours</div>
|
|
|
+ <div className="d-i-b">
|
|
|
+ <div className="t-2">总时长</div>
|
|
|
+ <div className="t-1 t-s-16">{data.number}Hours</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -1077,15 +1231,21 @@ class CourseVs extends Component {
|
|
|
<div className="education-item end">
|
|
|
<div className="title">
|
|
|
<div className="tag">已结课</div>
|
|
|
- <div className="text">{data.course.title}{data.vsNo > 0 ? `V${data.vsNo}` : ''}{data.number > 0 ? `(${data.number}课时)` : ''}</div>
|
|
|
+ <div className="text">
|
|
|
+ {data.course.title}
|
|
|
+ {data.vsNo > 0 ? `V${data.vsNo}` : ''}
|
|
|
+ {data.number > 0 ? `(${data.number}课时)` : ''}
|
|
|
+ </div>
|
|
|
<div className="right">
|
|
|
- <More menu={[{ label: '评价', key: 'comment' }]}
|
|
|
+ <More
|
|
|
+ menu={[{ label: '评价', key: 'comment' }]}
|
|
|
onClick={value => {
|
|
|
const { key } = value;
|
|
|
if (key === 'comment') {
|
|
|
onComment();
|
|
|
}
|
|
|
- }} />
|
|
|
+ }}
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
{showTips && <div className="continue">
|
|
@@ -1141,16 +1301,30 @@ class CourseVs extends Component {
|
|
|
<div className="education-item end">
|
|
|
<div className="title">
|
|
|
<div className="tag">已停课</div>
|
|
|
- <div className="text">{data.course.title}{data.vsNo > 0 ? `V${data.vsNo}` : ''}{data.number > 0 ? `(${data.number}课时)` : ''}<Button size="small" onClick={() => onRestore()} >恢复上课</Button></div>
|
|
|
- <div className='t-s-12'><span className='t-3'>申请时间:</span><span className='t-2 m-r-1'>{formatDate(data.suspendTime, 'YYYY-MM-DD HH:mm:ss')}</span><span className='t-3'>已停课:</span><span>{parseInt((new Date().getTime() - new Date(data.suspendTime).getTime()) / 86400000, 10)}Days/30</span></div>
|
|
|
+ <div className="text">
|
|
|
+ {data.course.title}
|
|
|
+ {data.vsNo > 0 ? `V${data.vsNo}` : ''}
|
|
|
+ {data.number > 0 ? `(${data.number}课时)` : ''}
|
|
|
+ <Button size="small" onClick={() => onRestore()}>
|
|
|
+ 恢复上课
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ <div className="t-s-12">
|
|
|
+ <span className="t-3">申请时间:</span>
|
|
|
+ <span className="t-2 m-r-1">{formatDate(data.suspendTime, 'YYYY-MM-DD HH:mm:ss')}</span>
|
|
|
+ <span className="t-3">已停课:</span>
|
|
|
+ <span>{parseInt((new Date().getTime() - new Date(data.suspendTime).getTime()) / 86400000, 10)}Days/30</span>
|
|
|
+ </div>
|
|
|
<div className="right">
|
|
|
- <More menu={[{ label: '评价', key: 'comment' }]}
|
|
|
+ <More
|
|
|
+ menu={[{ label: '评价', key: 'comment' }]}
|
|
|
onClick={value => {
|
|
|
const { key } = value;
|
|
|
if (key === 'comment') {
|
|
|
onComment();
|
|
|
}
|
|
|
- }} />
|
|
|
+ }}
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="detail">
|
|
@@ -1187,7 +1361,7 @@ class CourseVs extends Component {
|
|
|
const { list = [], index } = this.state;
|
|
|
const appointment = data.appointments[index] || {};
|
|
|
let status = '';
|
|
|
- return ([
|
|
|
+ return [
|
|
|
<div className="class-hour">
|
|
|
{data.number > 1 && <div className="text">课时 {appointment.no}:{appointment.title}</div>}
|
|
|
{data.number > 1 && <div className="right">
|
|
@@ -1209,7 +1383,7 @@ class CourseVs extends Component {
|
|
|
return <TimeLineItem type={`${item}`} user={this.props.user} appointment={appointment} data={data} status={status} onUploadNote={onUploadNote} onUploadSupply={onUploadSupply} onUploadQuestion={onUploadQuestion} setCCTalkName={setCCTalkName} />;
|
|
|
})}
|
|
|
</div>,
|
|
|
- ]);
|
|
|
+ ];
|
|
|
}
|
|
|
|
|
|
renderTable() {
|
|
@@ -1246,7 +1420,17 @@ class TimeLineItem extends Component {
|
|
|
}
|
|
|
|
|
|
renderDetail() {
|
|
|
- const { data = {}, appointment = {}, type, onUploadNote, onUploadSupply, onDeleteNote, onDeleteSupply, onUploadQuestion, setCCTalkName } = this.props;
|
|
|
+ const {
|
|
|
+ data = {},
|
|
|
+ appointment = {},
|
|
|
+ type,
|
|
|
+ onUploadNote,
|
|
|
+ onUploadSupply,
|
|
|
+ onDeleteNote,
|
|
|
+ onDeleteSupply,
|
|
|
+ onUploadQuestion,
|
|
|
+ setCCTalkName,
|
|
|
+ } = this.props;
|
|
|
const { status } = this.props;
|
|
|
const { paper } = appointment;
|
|
|
switch (type) {
|
|
@@ -1254,9 +1438,23 @@ class TimeLineItem extends Component {
|
|
|
switch (status) {
|
|
|
case 'end':
|
|
|
case 'not':
|
|
|
- return <span>请尽快与老师预约上课时间,老师微信:{data.teacher.wechat}扫码加微信</span>;
|
|
|
+ return (
|
|
|
+ <span>
|
|
|
+ 请尽快与老师预约上课时间,老师微信:{data.teacher.wechat}扫码加微信{' '}
|
|
|
+ <Dropdown overlay={<Assets name="qrcode" src={data.teacher.qr} />}>
|
|
|
+ <span>
|
|
|
+ <Assets className="m-l-1" name="erweima" />
|
|
|
+ </span>
|
|
|
+ </Dropdown>
|
|
|
+ </span>
|
|
|
+ );
|
|
|
default:
|
|
|
- return <span>{formatDate(appointment.startTime, 'YYYY-MM-DD HH:mm:ss')} ~ {formatDate(appointment.endTime, 'HH:mm:ss')}</span>;
|
|
|
+ return (
|
|
|
+ <span>
|
|
|
+ {formatDate(appointment.startTime, 'YYYY-MM-DD HH:mm:ss')} ~{' '}
|
|
|
+ {formatDate(appointment.endTime, 'HH:mm:ss')}
|
|
|
+ </span>
|
|
|
+ );
|
|
|
}
|
|
|
case '2':
|
|
|
switch (status) {
|
|
@@ -1267,7 +1465,11 @@ class TimeLineItem extends Component {
|
|
|
return Common.upload({ file }).then((result => onUploadQuestion(appointment, result.url, file.name)));
|
|
|
}}><span className="link">点此上传</span></FileUpload>;
|
|
|
default:
|
|
|
- return <a href={appointment.questionFile} target="_blank">{appointment.questionFileName || '文件'}</a>;
|
|
|
+ return (
|
|
|
+ <a href={appointment.questionFile} target="_blank">
|
|
|
+ {appointment.questionFileName || '文件'}
|
|
|
+ </a>
|
|
|
+ );
|
|
|
}
|
|
|
case '3':
|
|
|
switch (status) {
|
|
@@ -1286,14 +1488,19 @@ class TimeLineItem extends Component {
|
|
|
if (this.state.cctalkName) setCCTalkName(appointment, this.state.cctalkName);
|
|
|
}} >提交</Button></div>;
|
|
|
default:
|
|
|
- return <span>
|
|
|
- CCtalk 频道号 :{appointment.cctalkChannel} <a className="link" href="" target="_black">CC talk使用手册</a>
|
|
|
- </span>;
|
|
|
+ return (
|
|
|
+ <span>
|
|
|
+ CCtalk 频道号 :{appointment.cctalkChannel}{' '}
|
|
|
+ <a className="link" href="" target="_black">
|
|
|
+ CC talk使用手册
|
|
|
+ </a>
|
|
|
+ </span>
|
|
|
+ );
|
|
|
}
|
|
|
case '4':
|
|
|
switch (status) {
|
|
|
case 'end':
|
|
|
- return <span className="link" >点此上传</span>;
|
|
|
+ return <span className="link">点此上传</span>;
|
|
|
case 'not':
|
|
|
return <span className="link" onClick={() => onUploadNote(appointment, { appointmentId: appointment.id, recordId: appointment.recordId })}>点此上传</span>;
|
|
|
default:
|
|
@@ -1327,7 +1534,7 @@ class TimeLineItem extends Component {
|
|
|
case '5':
|
|
|
switch (status) {
|
|
|
case 'end':
|
|
|
- return <span className="link" >写留言</span>;
|
|
|
+ return <span className="link">写留言</span>;
|
|
|
case 'not':
|
|
|
return <span className="link" onClick={() => onUploadSupply(appointment, { appointmentId: appointment.id, recordId: appointment.recordId })}>写留言</span>;
|
|
|
default:
|
|
@@ -1361,15 +1568,24 @@ class TimeLineItem extends Component {
|
|
|
return [
|
|
|
<div>
|
|
|
<span>基本情况</span>
|
|
|
- <a href={status !== 'end' ? '' : ''} className="link">填写</a>
|
|
|
+ <a href={status !== 'end' ? '' : ''} className="link">
|
|
|
+ 填写
|
|
|
+ </a>
|
|
|
</div>,
|
|
|
<div>
|
|
|
<span>备考细节</span>
|
|
|
- <a href={status !== 'end' ? '' : ''} className="link">填写</a>
|
|
|
+ <a href={status !== 'end' ? '' : ''} className="link">
|
|
|
+ 填写
|
|
|
+ </a>
|
|
|
</div>,
|
|
|
];
|
|
|
case '7':
|
|
|
- return <ProgressText progress={paper ? formatPercent(paper.report.userNumber, paper.report.questionNumber) : 0} size="small" />;
|
|
|
+ return (
|
|
|
+ <ProgressText
|
|
|
+ progress={paper ? formatPercent(paper.report.userNumber, paper.report.questionNumber) : 0}
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ );
|
|
|
default:
|
|
|
return <div />;
|
|
|
}
|