Commit f4a87aac by zhangleyuan

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

parent f5198413
...@@ -117,6 +117,7 @@ class AddLive extends React.Component { ...@@ -117,6 +117,7 @@ class AddLive extends React.Component {
}).then((res) => { }).then((res) => {
const { const {
teacherId, teacherId,
teacherName,
courseName, courseName,
startTime, startTime,
endTime, endTime,
...@@ -169,6 +170,7 @@ class AddLive extends React.Component { ...@@ -169,6 +170,7 @@ class AddLive extends React.Component {
liveDate, liveDate,
nickname, nickname,
teacherId, teacherId,
teacherName,
timeHorizonStart, timeHorizonStart,
timeHorizonEnd, timeHorizonEnd,
startTime, startTime,
...@@ -213,12 +215,14 @@ handleChangeBasicInfo = (field, value) => { ...@@ -213,12 +215,14 @@ handleChangeBasicInfo = (field, value) => {
} }
// 修改上课信息 // 修改上课信息
handleChangeClassInfo = (field, value) => { handleChangeClassInfo = (field, value ,teacherName) => {
const _value = value ? value.valueOf() : null; const _value = value ? value.valueOf() : null;
const { _teacherName } = this.state.addLiveClassInfo;
this.setState({ this.setState({
addLiveClassInfo: { addLiveClassInfo: {
...this.state.addLiveClassInfo, ...this.state.addLiveClassInfo,
[field]: _value, [field]: _value,
teacherName:teacherName?teacherName:_teacherName
} }
}); });
// 批量开始时间改变,结束时间自动同步一致 // 批量开始时间改变,结束时间自动同步一致
...@@ -470,12 +474,13 @@ handleChangeBasicInfo = (field, value) => { ...@@ -470,12 +474,13 @@ handleChangeBasicInfo = (field, value) => {
// 显示预览课程弹窗 // 显示预览课程弹窗
handleShowPreviewModal = () => { handleShowPreviewModal = () => {
const { addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo } = this.state; const { addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo,type} = this.state;
const previewLiveCourseModal = ( const previewLiveCourseModal = (
<PreviewCourseModal <PreviewCourseModal
courseBasinInfo={addLiveBasicInfo} courseBasicInfo={addLiveBasicInfo}
courseClassInfo={addLiveClassInfo} courseClassInfo={addLiveClassInfo}
courseIntroInfo={addLiveIntroInfo} courseIntroInfo={addLiveIntroInfo}
type={type}
close={() => { close={() => {
this.setState({ this.setState({
previewLiveCourseModal: null previewLiveCourseModal: null
......
...@@ -132,6 +132,9 @@ class AddLiveBasic extends React.Component { ...@@ -132,6 +132,9 @@ class AddLiveBasic extends React.Component {
}, },
loadComplete:(img)=>{ loadComplete:(img)=>{
this.refs.headPicModal.click(); this.refs.headPicModal.click();
setTimeout(()=>{
this.refs.headPicModal.click();
},100)
this.setState({ this.setState({
previewUrl: img.src previewUrl: img.src
}) })
......
...@@ -140,57 +140,6 @@ class AddLiveClass extends React.Component { ...@@ -140,57 +140,6 @@ class AddLiveClass extends React.Component {
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
<div className="add-live__class-info"> <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' && {pageType === 'add' &&
<div className="course"> <div className="course">
<div className="day"> <div className="day">
...@@ -231,9 +180,9 @@ class AddLiveClass extends React.Component { ...@@ -231,9 +180,9 @@ class AddLiveClass extends React.Component {
onChange={(time) => { onChange={(time) => {
this.props.onChange('startTime', time); this.props.onChange('startTime', time);
}} }}
renderExtraFooter={()=>{ // renderExtraFooter={()=>{
return null // return <div><button>测试</button></div>
}} // }}
/>&nbsp;&nbsp;~&nbsp;&nbsp; />&nbsp;&nbsp;~&nbsp;&nbsp;
<TimePicker <TimePicker
...@@ -304,8 +253,8 @@ class AddLiveClass extends React.Component { ...@@ -304,8 +253,8 @@ class AddLiveClass extends React.Component {
value={teacherId} value={teacherId}
filterOption={(input, option) => option} filterOption={(input, option) => option}
onPopupScroll={this.handleScrollTeacherList} onPopupScroll={this.handleScrollTeacherList}
onChange={(value) => { onChange={(value,option) => {
this.props.onChange('teacherId', value) this.props.onChange('teacherId', value,option.children)
}} }}
onSearch={(value) => { onSearch={(value) => {
teacherQuery.nickName = value teacherQuery.nickName = value
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-07-23 14:54:16 * @Date: 2020-07-23 14:54:16
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-23 09:57:25 * @LastEditTime: 2020-12-23 13:41:31
* @Description: 大班直播课预览弹窗 * @Description: 大班直播课预览弹窗
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -48,9 +48,9 @@ class PreviewCourseModal extends React.Component { ...@@ -48,9 +48,9 @@ class PreviewCourseModal extends React.Component {
render() { render() {
const { courseBasinInfo, courseClassInfo = {}, courseIntroInfo, type } = this.props; const { courseBasicInfo, courseClassInfo = {}, courseIntroInfo, type } = this.props;
const { coverUrl, courseName, scheduleVideoUrl } = courseBasinInfo; const { coverUrl, courseName, scheduleVideoUrl } = courseBasicInfo;
const { liveDate, timeHorizonStart, timeHorizonEnd, teacherName } = courseClassInfo; const { liveDate, calendarTime,timeHorizonStart, timeHorizonEnd, teacherName } = courseClassInfo;
const { liveCourseMediaRequests } = courseIntroInfo; const { liveCourseMediaRequests } = courseIntroInfo;
let liveDateStr, startTimeStr, endTimeStr; 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