Commit 0dae0773 by chenshu

feat:初始化

parent 5eddd1bd
...@@ -73,7 +73,6 @@ class AddOfflineCourse extends React.Component { ...@@ -73,7 +73,6 @@ class AddOfflineCourse extends React.Component {
diskList: [], // 机构可见磁盘目录 diskList: [], // 机构可见磁盘目录
selectedFileList: [], // 已经从资料云盘中勾选的文件 selectedFileList: [], // 已经从资料云盘中勾选的文件
showCutModal: false, // 是否显示截图弹窗 showCutModal: false, // 是否显示截图弹窗
showSelectVideoModal: false,
studentModal: false, studentModal: false,
categoryName:null, //分类名称 categoryName:null, //分类名称
courseCatalogList:[], //分类列表 courseCatalogList:[], //分类列表
...@@ -116,22 +115,16 @@ class AddOfflineCourse extends React.Component { ...@@ -116,22 +115,16 @@ class AddOfflineCourse extends React.Component {
initBus = () => { initBus = () => {
Bus.bind('offlineEditorImage', this.uploadImage) Bus.bind('offlineEditorImage', this.uploadImage)
Bus.bind('offlineEditorVideo', this.uploadVideo)
} }
removeBus = () => { removeBus = () => {
Bus.unbind('offlineEditorImage', this.uploadImage) Bus.unbind('offlineEditorImage', this.uploadImage)
Bus.unbind('offlineEditorVideo', this.uploadVideo)
} }
uploadImage = () => { uploadImage = () => {
this.setState({ showSelectImageModal: true }) this.setState({ showSelectImageModal: true })
} }
uploadVideo = () => {
this.setState({ showSelectVideoModal: true })
}
//获取分类列表 //获取分类列表
getCourseCatalogList = ()=>{ getCourseCatalogList = ()=>{
Service.Hades('public/hades/queryCategoryTree', { source: 0, tenantId: User.getStoreId(), count: false, userId: User.getUserId() }).then((res) => { Service.Hades('public/hades/queryCategoryTree', { source: 0, tenantId: User.getStoreId(), count: false, userId: User.getUserId() }).then((res) => {
...@@ -144,6 +137,7 @@ class AddOfflineCourse extends React.Component { ...@@ -144,6 +137,7 @@ class AddOfflineCourse extends React.Component {
catalogChange= (value, options) => { catalogChange= (value, options) => {
this.setState({ categoryId: _.last(value), categoryName: _.pluck(options, 'categoryName').join('-') }) this.setState({ categoryId: _.last(value), categoryName: _.pluck(options, 'categoryName').join('-') })
} }
// 获取线下课详情 // 获取线下课详情
handleFetchScheudleDetail = (courseId) => { handleFetchScheudleDetail = (courseId) => {
Service.Hades('public/hades/getOfflineCourseDetail',{ Service.Hades('public/hades/getOfflineCourseDetail',{
...@@ -232,7 +226,7 @@ class AddOfflineCourse extends React.Component { ...@@ -232,7 +226,7 @@ class AddOfflineCourse extends React.Component {
signInType, signInType,
signOutType, signOutType,
isEditDisablie: whetherHaveApply === 'YES', isEditDisablie: whetherHaveApply === 'YES',
}); }, () => this.handleShowPreviewModal());
}) })
} }
...@@ -276,49 +270,6 @@ class AddOfflineCourse extends React.Component { ...@@ -276,49 +270,6 @@ class AddOfflineCourse extends React.Component {
}); });
} }
} }
// 修改表单
handleChangeForm = (field, value, coverUrl) => {
this.setState({
[field]: value,
coverUrl: coverUrl ? coverUrl : this.state.coverUrl
});
}
// 显示选择学员弹窗
handleShowSelectStuModal = () => {
this.setState({ studentModal : true });
const { studentList, selectedStuList } = this.state;
// const _studentList = _.map(studentList, (item) => {
// return item.studentId
// })
const studentModal = (
<SelectStudent
showTabs={true}
type="videoCourse"
onSelect={this.handleSelectStudent}
after={true} //表明是不是上课后的状态
studentList={studentList}
close={() => {
this.setState({
studentModal: null,
});
}}
/>
)
this.setState({ studentModal });
}
handleSelectStudent = (studentIds) => {
let studentList = [];
_.each(studentIds, (item) => {
studentList.push({ studentId: item });
});
// this.setState({ studentModal: null });
this.setState({ studentList });
this.setState({ studentModal : false });
}
// 显示预览弹窗 // 显示预览弹窗
handleShowPreviewModal = () => { handleShowPreviewModal = () => {
...@@ -775,7 +726,7 @@ class AddOfflineCourse extends React.Component { ...@@ -775,7 +726,7 @@ class AddOfflineCourse extends React.Component {
placeholder="请输入线下课的名称(40字以内)" placeholder="请输入线下课的名称(40字以内)"
maxLength={40} maxLength={40}
style={{ width: 240 }} style={{ width: 240 }}
onChange={(e) => { this.handleChangeForm('courseName', e.target.value)}} onChange={(e) => { this.setState({ courseName: e.target.value }) }}
/> />
</div> </div>
<div className="course-cover"> <div className="course-cover">
......
...@@ -137,7 +137,7 @@ class OfflineCourseFilter extends React.Component { ...@@ -137,7 +137,7 @@ class OfflineCourseFilter extends React.Component {
enterButton={<span className="icon iconfont">&#xe832;</span>} enterButton={<span className="icon iconfont">&#xe832;</span>}
/> />
</div> </div>
<div className="search-condition__item"> {/* <div className="search-condition__item">
<span className="select-status">课程状态:</span> <span className="select-status">课程状态:</span>
<Select <Select
style={{ width: "calc(100% - 70px)" }} style={{ width: "calc(100% - 70px)" }}
...@@ -152,7 +152,7 @@ class OfflineCourseFilter extends React.Component { ...@@ -152,7 +152,7 @@ class OfflineCourseFilter extends React.Component {
<Option value="FINISH">已结束</Option> <Option value="FINISH">已结束</Option>
<Option value="EXPIRED">已取消</Option> <Option value="EXPIRED">已取消</Option>
</Select> </Select>
</div> </div> */}
<div className="search-condition__item"> <div className="search-condition__item">
<span className="shelf-status">学院展示:</span> <span className="shelf-status">学院展示:</span>
<Select <Select
......
...@@ -273,7 +273,7 @@ class OfflineCourseList extends React.Component { ...@@ -273,7 +273,7 @@ class OfflineCourseList extends React.Component {
this.handleShowPreviewModal(item); this.handleShowPreviewModal(item);
}} }}
>预览</div> >预览</div>
{item.courseState === 'UN_START' && item.courseState === 'STARTING' && <div {(item.courseState === 'UN_START' || item.courseState === 'STARTING') && <div
className="operate__item" className="operate__item"
key="cancel" key="cancel"
onClick={() => { onClick={() => {
......
...@@ -40,9 +40,18 @@ class PreviewOfflineModal extends React.Component { ...@@ -40,9 +40,18 @@ class PreviewOfflineModal extends React.Component {
</div> </div>
<div className="container__body"> <div className="container__body">
<div className="title__name">{courseName}</div> <div className="title__name">{courseName}</div>
<div className="title__categery">课程分类:{categoryName}</div> <div className="title__categery">
<div className="title__categery">上课时间:{startTime ? moment(startTime).format('HH:mm') : ''}~{endTime ? moment(endTime).format('HH:mm') : ''}</div> <img className="item-icon" src="https://image.xiaomaiketang.com/xm/cDMwz3jzaX.png" />
<div className="title__categery">上课地点:{offlinePlace}</div> 课程分类:{categoryName}
</div>
<div className="title__categery">
<img className="item-icon" src="https://image.xiaomaiketang.com/xm/BfTBK3dGda.png" />
上课时间:{startTime ? moment(startTime).format('HH:mm') : ''}~{endTime ? moment(endTime).format('HH:mm') : ''}
</div>
<div className="title__categery">
<img className="item-icon" src="https://image.xiaomaiketang.com/xm/KhFNBTtAKR.png" />
上课地点:{offlinePlace}
</div>
</div> </div>
<div className="container__introduction"> <div className="container__introduction">
......
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