Commit f4a87aac by zhangleyuan

feat:处理创建课程里的封面图的裁剪

parent f5198413
......@@ -117,6 +117,7 @@ class AddLive extends React.Component {
}).then((res) => {
const {
teacherId,
teacherName,
courseName,
startTime,
endTime,
......@@ -169,6 +170,7 @@ class AddLive extends React.Component {
liveDate,
nickname,
teacherId,
teacherName,
timeHorizonStart,
timeHorizonEnd,
startTime,
......@@ -213,12 +215,14 @@ handleChangeBasicInfo = (field, value) => {
}
// 修改上课信息
handleChangeClassInfo = (field, value) => {
handleChangeClassInfo = (field, value ,teacherName) => {
const _value = value ? value.valueOf() : null;
const { _teacherName } = this.state.addLiveClassInfo;
this.setState({
addLiveClassInfo: {
...this.state.addLiveClassInfo,
[field]: _value,
teacherName:teacherName?teacherName:_teacherName
}
});
// 批量开始时间改变,结束时间自动同步一致
......@@ -470,12 +474,13 @@ handleChangeBasicInfo = (field, value) => {
// 显示预览课程弹窗
handleShowPreviewModal = () => {
const { addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo } = this.state;
const { addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo,type} = this.state;
const previewLiveCourseModal = (
<PreviewCourseModal
courseBasinInfo={addLiveBasicInfo}
courseBasicInfo={addLiveBasicInfo}
courseClassInfo={addLiveClassInfo}
courseIntroInfo={addLiveIntroInfo}
type={type}
close={() => {
this.setState({
previewLiveCourseModal: null
......
......@@ -132,6 +132,9 @@ class AddLiveBasic extends React.Component {
},
loadComplete:(img)=>{
this.refs.headPicModal.click();
setTimeout(()=>{
this.refs.headPicModal.click();
},100)
this.setState({
previewUrl: img.src
})
......
......@@ -140,57 +140,6 @@ class AddLiveClass extends React.Component {
return (
<Spin spinning={loading}>
<div className="add-live__class-info">
{/* <div className="course">
<div className="day">
<span className="label">
<span className="require">*</span>
上课日期
<Tooltip
overlayStyle={{maxWidth: 300, zIndex: '9999'}}
title={<div style={{width: '266px'}}>支持按上课日期批量创建直播课,创建后按“课程名称_日期”命名,例如:<br/>张三的语文课_9月18日<br/>张三的语文课_9月19日......</div>}>
<InfoCircleFilled className="tip-icon"/>
</Tooltip>:
</span>
<div>
<div className='select-day'>
已选
<span className="mark-day">
{isLongArr(calendarTime)
? calendarTime.length : 0
}
</span> 天
</div>
<MultipleDatePicker
selectDateList={calendarTime}
onSelect={this.selectMultiDate}
canSelectTodayBefore={false}
/>
</div>
</div>
<div className="hour" id="hour">
<span className="label"><span className="require">*</span>上课时间:</span>
<TimePicker
format="HH:mm"
value={startTime ? moment(startTime) : null}
placeholder="开始时间"
style={{ width: 100, minWidth: 100}}
onChange={(time) => {
this.props.onChange('startTime', time);
}}
/>&nbsp;&nbsp;~&nbsp;&nbsp;
<TimePicker
format="HH:mm"
value={endTime ? moment(endTime) : null}
placeholder="结束时间"
style={{ width: 100, minWidth: 100 }}
onChange={(time) => {
this.props.onChange('endTime', time)
}}
/>
</div>
</div> */}
{pageType === 'add' &&
<div className="course">
<div className="day">
......@@ -231,9 +180,9 @@ class AddLiveClass extends React.Component {
onChange={(time) => {
this.props.onChange('startTime', time);
}}
renderExtraFooter={()=>{
return null
}}
// renderExtraFooter={()=>{
// return <div><button>测试</button></div>
// }}
/>&nbsp;&nbsp;~&nbsp;&nbsp;
<TimePicker
......@@ -304,8 +253,8 @@ class AddLiveClass extends React.Component {
value={teacherId}
filterOption={(input, option) => option}
onPopupScroll={this.handleScrollTeacherList}
onChange={(value) => {
this.props.onChange('teacherId', value)
onChange={(value,option) => {
this.props.onChange('teacherId', value,option.children)
}}
onSearch={(value) => {
teacherQuery.nickName = value
......
......@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-07-23 14:54:16
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-23 09:57:25
* @LastEditTime: 2020-12-23 13:41:31
* @Description: 大班直播课预览弹窗
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
......@@ -48,9 +48,9 @@ class PreviewCourseModal extends React.Component {
render() {
const { courseBasinInfo, courseClassInfo = {}, courseIntroInfo, type } = this.props;
const { coverUrl, courseName, scheduleVideoUrl } = courseBasinInfo;
const { liveDate, timeHorizonStart, timeHorizonEnd, teacherName } = courseClassInfo;
const { courseBasicInfo, courseClassInfo = {}, courseIntroInfo, type } = this.props;
const { coverUrl, courseName, scheduleVideoUrl } = courseBasicInfo;
const { liveDate, calendarTime,timeHorizonStart, timeHorizonEnd, teacherName } = courseClassInfo;
const { liveCourseMediaRequests } = courseIntroInfo;
let liveDateStr, startTimeStr, endTimeStr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment