Commit 49c5d2b4 by maolipeng

Merge branch 'feature/zhujian/0726/qwLiving' into dev

parents 96ebc795 c5e9fc45
......@@ -96,6 +96,12 @@ class Axios {
content: `当前企业购买的${window.brandName}服务已到期,如需继续使用学院功能,请尽快续费购买`,
okText: "我知道了"
})
} else if (resultCode === "LIVE_START_FORBID_DEL") {
Modal.warning({
title:"提示",
content: "直播进行中,无法删除直播",
okText: "我知道了"
})
} else if (success || resultCode === 0) {
return response;
} else if (!options.reject) {
......
......@@ -6,7 +6,7 @@
* @Description: 大班互动-添加/编辑直播课
*/
import React, { ReactElement, useEffect, useState } from 'react';
import React, { ReactElement, useEffect, useRef, useState } from 'react';
import { withRouter } from 'react-router-dom';
import { Button, message, Modal } from 'antd';
......@@ -62,6 +62,7 @@ function CreateWorkWXCourse() {
const [getInfo, setGetInfo] = useState(false)
const [previewLiveCourseModal, setPreviewLiveCourseModal] = useState()
const [exItems, setExItems] = useState([])
const [enableSubmit, setEnableSubmit] = useState(true)
useEffect(()=> {
routeHook.addSaveCase();
......@@ -244,11 +245,7 @@ function CreateWorkWXCourse() {
};
function submitRemote({ introduceId, id }) {
if (type === 'add') {
} else {
}
console.log('取消')
setEnableSubmit(false)
routeHook.cancel()
if (type === 'add') {
......@@ -263,6 +260,7 @@ function CreateWorkWXCourse() {
...basicInfo
};
CourseService.createWorkWXLiveCourse(params).then((res) => {
setEnableSubmit(true)
if (res.success) {
message.success('新建成功');
Bus.trigger('freshCourseList')
......@@ -284,6 +282,7 @@ function CreateWorkWXCourse() {
liveCourseId: id
};
CourseService.updateWorkWXLiveCourse(params).then((res) => {
setEnableSubmit(true)
if (res.success) {
Bus.trigger('freshCourseList')
message.success('更新成功');
......@@ -458,8 +457,8 @@ function CreateWorkWXCourse() {
<div className='footer shrink-footer'>
<Button onClick={handleGoBack}>取消</Button>
<Button onClick={handleShowPreviewModal}>预览</Button>
<Button type='primary' onClick={_.debounce(() => handleSubmit(), 3000, true)}>
保存
<Button type='primary' onClick={_.debounce(() => handleSubmit(), 3000, true)} disabled={!enableSubmit}>
{enableSubmit?"保存":"正在提交"}
</Button>
</div>
{previewLiveCourseModal}
......
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