Commit 5254c186 by zhangleyuan

feat:调整上下架的接口

parent f6dd4e5e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-12-12 11:57:10 * @Date: 2020-12-12 11:57:10
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-16 15:49:11 * @LastEditTime: 2020-12-16 16:14:42
* @Description: Description * @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -43,6 +43,9 @@ export function updateLiveCloudCourse(params: object) { ...@@ -43,6 +43,9 @@ export function updateLiveCloudCourse(params: object) {
return Service.Hades("public/courseCloud/updateLiveCloudCourse", params); return Service.Hades("public/courseCloud/updateLiveCloudCourse", params);
} }
export function delOrRecoverLiveCloudCourse(params: object) { export function turnOnOrOffLiveCloudCourse(params: object) {
return Service.Hades("public/courseCloud/delOrRecoverLiveCloudCourse", params); return Service.Hades("public/courseCloud/turnOnOrOffLiveCloudCourse", params);
} }
export function delLiveCloudCourse(params: object) {
return Service.Hades("public/courseCloud/delLiveCloudCourse", params);
}
\ No newline at end of file
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-11-25 18:25:02 * @Date: 2020-11-25 18:25:02
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-16 15:50:43 * @LastEditTime: 2020-12-16 16:15:15
* @Description: Description * @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import { fetchLecturerData, fetchUserData, exportStudentCourseData,exportPlayBackCourseData, fetchPlaybackList,createLiveCloudCourse,getLiveCloudCoursePage,getLiveCloudCourseDetail,updateLiveCloudCourse,delOrRecoverLiveCloudCourse} from '@/data-source/course/request-api'; import { fetchLecturerData, fetchUserData, exportStudentCourseData,exportPlayBackCourseData, fetchPlaybackList,createLiveCloudCourse,getLiveCloudCoursePage,getLiveCloudCourseDetail,updateLiveCloudCourse,turnOnOrOffLiveCloudCourse,delLiveCloudCourse} from '@/data-source/course/request-api';
export default class courseService { export default class courseService {
// 获取讲师上课数据 // 获取讲师上课数据
...@@ -46,7 +46,10 @@ export default class courseService { ...@@ -46,7 +46,10 @@ export default class courseService {
static updateLiveCloudCourse(params: any) { static updateLiveCloudCourse(params: any) {
return updateLiveCloudCourse(params); return updateLiveCloudCourse(params);
} }
static delOrRecoverLiveCloudCourse(params: any) { static turnOnOrOffLiveCloudCourse(params: any) {
return delOrRecoverLiveCloudCourse(params); return turnOnOrOffLiveCloudCourse(params);
}
static delLiveCloudCourse(params: any) {
return delLiveCloudCourse(params);
} }
} }
\ No newline at end of file
...@@ -48,6 +48,7 @@ const defaultClassInfo = { ...@@ -48,6 +48,7 @@ const defaultClassInfo = {
const defaultIntroInfo = { const defaultIntroInfo = {
needRecord: 'YES', needRecord: 'YES',
whetherVisitorsJoin:'NO',
liveCourseWarmMedia: {}, liveCourseWarmMedia: {},
// 讲师简介 // 讲师简介
liveCourseMediaRequests: [{ liveCourseMediaRequests: [{
...@@ -91,6 +92,7 @@ class AddLive extends React.Component { ...@@ -91,6 +92,7 @@ class AddLive extends React.Component {
// 直播课简介 // 直播课简介
addLiveIntroInfo: { addLiveIntroInfo: {
needRecord: 'YES', needRecord: 'YES',
whetherVisitorsJoin:'NO',
liveCourseWarmMedia: {}, liveCourseWarmMedia: {},
liveCourseMediaRequests: [{ liveCourseMediaRequests: [{
mediaType: 'TEXT', mediaType: 'TEXT',
......
...@@ -24,7 +24,9 @@ class LiveCoursePage extends React.Component { ...@@ -24,7 +24,9 @@ class LiveCoursePage extends React.Component {
} }
// 获取直播课列表 // 获取直播课列表
handleFetchLiveList = (_query) => { handleFetchLiveList = (_query) => {
const { query } = this.state;
const params = { const params = {
...query,
..._query, ..._query,
storeId:User.getStoreId() storeId:User.getStoreId()
}; };
......
...@@ -207,7 +207,7 @@ class AddLiveIntro extends React.Component { ...@@ -207,7 +207,7 @@ class AddLiveIntro extends React.Component {
} }
render() { render() {
const {liveType, isXiaomai, isEdit, data: { introduction, needRecord, whetherRecord, liveCourseMediaRequests = [], liveCourseWarmMedia = {}, isAutoSendReport } } = this.props; const {liveType, isXiaomai, isEdit, data: { introduction, needRecord,whetherVisitorsJoin, liveCourseMediaRequests = [], liveCourseWarmMedia = {}, isAutoSendReport } } = this.props;
const { showCutModal, warmUrl, showSelectFileModal, diskList, imageFile } = this.state const { showCutModal, warmUrl, showSelectFileModal, diskList, imageFile } = this.state
return ( return (
<div className="add-live__intro-info"> <div className="add-live__intro-info">
...@@ -244,7 +244,7 @@ class AddLiveIntro extends React.Component { ...@@ -244,7 +244,7 @@ class AddLiveIntro extends React.Component {
<div className="content"> <div className="content">
<Row> <Row>
<Col span={3}> <Col span={3}>
<Switch /> <Switch defaultChecked={whetherVisitorsJoin==="YES"?true:false}/>
</Col> </Col>
<Col span={21}> <Col span={21}>
<div>开启:用户可直接进入直播间观看直播</div> <div>开启:用户可直接进入直播间观看直播</div>
......
...@@ -29,6 +29,7 @@ import ShareLiveModal from '../modal/ShareLiveModal'; ...@@ -29,6 +29,7 @@ import ShareLiveModal from '../modal/ShareLiveModal';
import './LiveCourseList.less'; import './LiveCourseList.less';
import { QuestionCircleOutlined } from '@ant-design/icons'; import { QuestionCircleOutlined } from '@ant-design/icons';
import { appId, shareUrl, LIVE_SHARE } from '@/domains/course-domain/constants'; import { appId, shareUrl, LIVE_SHARE } from '@/domains/course-domain/constants';
import CourseService from "@/domains/course-domain/CourseService";
const { confirm } = Modal; const { confirm } = Modal;
const courseStateShow = { const courseStateShow = {
UN_START: { UN_START: {
...@@ -106,15 +107,32 @@ class LiveCourseList extends React.Component { ...@@ -106,15 +107,32 @@ class LiveCourseList extends React.Component {
this.setState({ shareLiveModal }) this.setState({ shareLiveModal })
} }
//改变上架状态 //改变上架状态
changeShelfState = (item) =>{ changeShelfState = (item) =>{
if(item.shelfState==='NO'){ let _shelfState = item.shelfState
if(_shelfState==='NO'){
_shelfState = "YES";
item.shelfState = "YES" item.shelfState = "YES"
}else{ }else{
_shelfState = "NO"
item.shelfState = "NO"
} }
const params={
"liveCourseId": item.liveCourseId,
"shelfState":_shelfState
}
CourseService.turnOnOrOffLiveCloudCourse(params).then((res)=>{
if(res.success){
if(_shelfState === "YES"){
message.success("上架成功");
}else{
message.success("已下架");
}
}
})
} }
// 前往上课数据页面 // 前往上课数据页面
handleLinkToClassData = (item) => { handleLinkToClassData = (item) => {
// TODOLIST 确定后端是否是根据liveCourseId 返回数据 // TODOLIST 确定后端是否是根据liveCourseId 返回数据
...@@ -202,7 +220,7 @@ class LiveCourseList extends React.Component { ...@@ -202,7 +220,7 @@ class LiveCourseList extends React.Component {
dataIndex: "courseware", dataIndex: "courseware",
render: (val, item, index) => { render: (val, item, index) => {
return ( return (
<Switch checked={item.shelfState==="YES"?true:false} onChange={()=>this.changeShelfState(item)}/> <Switch defaultChecked={item.shelfState==="YES"?true:false} onChange={()=>this.changeShelfState(item)}/>
) )
}, },
}, },
...@@ -267,7 +285,7 @@ class LiveCourseList extends React.Component { ...@@ -267,7 +285,7 @@ class LiveCourseList extends React.Component {
{ item.courseState==="EXPIRED" && { item.courseState==="EXPIRED" &&
<div <div
className="operate__item" className="operate__item"
onClick={this.handleDelete} onClick={()=>this.handleDelete(item)}
>删除</div> >删除</div>
} }
</div> </div>
...@@ -288,7 +306,7 @@ class LiveCourseList extends React.Component { ...@@ -288,7 +306,7 @@ class LiveCourseList extends React.Component {
{ item.courseState !=="STARTING" && { item.courseState !=="STARTING" &&
<div <div
className="operate__item" className="operate__item"
onClick={this.handleDelete} onClick={()=>this.handleDelete(item)}
>删除</div> >删除</div>
} }
</div> </div>
...@@ -303,13 +321,20 @@ class LiveCourseList extends React.Component { ...@@ -303,13 +321,20 @@ class LiveCourseList extends React.Component {
okType: 'danger', okType: 'danger',
cancelText: '取消', cancelText: '取消',
onOk: () => { onOk: () => {
this.deleteConfirm(item); this.deleteConfirm(record);
} }
}) })
} }
deleteConfirm = (item)=>{ deleteConfirm = (item)=>{
const params={
message.success("已删除"); "liveCourseId": item.liveCourseId,
}
CourseService.delLiveCloudCourse(params).then((res)=>{
if(res.success){
message.success("已删除");
this.props.onChange();
}
})
} }
toEditCoursePage =(item)=>{ toEditCoursePage =(item)=>{
window.RCHistory.push({ window.RCHistory.push({
......
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