Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
202c0875
Commit
202c0875
authored
Jul 07, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:线上课模块统一观看设置、编辑器保存,修复默认分享图破裂
parent
1e2f3e0e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
19 deletions
+27
-19
src/modules/course-manage/modal/ShareLiveModal.jsx
+1
-5
src/modules/course-manage/video-course/AddVideoCourse.jsx
+24
-12
src/modules/course-manage/video-course/components/AddVideoIntro.jsx
+2
-2
No files found.
src/modules/course-manage/modal/ShareLiveModal.jsx
View file @
202c0875
...
@@ -116,11 +116,7 @@ class ShareLiveModal extends React.Component {
...
@@ -116,11 +116,7 @@ class ShareLiveModal extends React.Component {
}
}
break
;
break
;
case
'videoClass'
:
// 视频课
case
'videoClass'
:
// 视频课
coverImgSrc
=
coverImgSrc
=
coverUrl
||
'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png'
;
coverUrl
||
(
courseDivision
===
'internal'
?
`
${
scheduleVideoUrl
}
?x-oss-process=video/snapshot,t_0,m_fast&anystring=anystring`
:
'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png'
);
break
;
break
;
case
'graphicsClass'
:
// 图文课
case
'graphicsClass'
:
// 图文课
coverImgSrc
=
coverUrl
||
'https://image.xiaomaiketang.com/xm/wFnpZtp2yB.png'
;
coverImgSrc
=
coverUrl
||
'https://image.xiaomaiketang.com/xm/wFnpZtp2yB.png'
;
...
...
src/modules/course-manage/video-course/AddVideoCourse.jsx
View file @
202c0875
/*
/*
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-08-05 10:07:47
* @Date: 2020-08-05 10:07:47
* @LastEditors:
wufan
* @LastEditors:
yuananting
* @LastEditTime: 2021-07-0
6 13:45:55
* @LastEditTime: 2021-07-0
7 12:05:07
* @Description: 线上课新增/编辑页
* @Description: 线上课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -26,6 +26,7 @@ import Upload from '@/core/upload'
...
@@ -26,6 +26,7 @@ import Upload from '@/core/upload'
import
{
randomString
}
from
'@/domains/basic-domain/utils'
import
{
randomString
}
from
'@/domains/basic-domain/utils'
import
$
from
'jquery'
import
$
from
'jquery'
import
'./AddVideoCourse.less'
import
'./AddVideoCourse.less'
import
Bus
from
'@/core/bus'
const
{
TextArea
}
=
Input
;
const
{
TextArea
}
=
Input
;
const
EDIT_BOX_KEY
=
Math
.
random
()
const
EDIT_BOX_KEY
=
Math
.
random
()
...
@@ -93,6 +94,11 @@ class AddVideoCourse extends React.Component {
...
@@ -93,6 +94,11 @@ class AddVideoCourse extends React.Component {
if
(
pageType
===
'edit'
)
{
if
(
pageType
===
'edit'
)
{
this
.
handleFetchScheudleDetail
(
id
)
this
.
handleFetchScheudleDetail
(
id
)
}
}
Bus
.
bind
(
'editorLimit'
,
(
textLength
)
=>
{
this
.
setState
({
textLength
,
});
});
}
}
//获取分类列表
//获取分类列表
...
@@ -395,7 +401,8 @@ class AddVideoCourse extends React.Component {
...
@@ -395,7 +401,8 @@ class AddVideoCourse extends React.Component {
shelfState
,
shelfState
,
whetherVisitorsJoin
,
whetherVisitorsJoin
,
introduce
,
introduce
,
courseChapterList
courseChapterList
,
textLength
,
}
=
this
.
state
}
=
this
.
state
const
commonParams
=
{
const
commonParams
=
{
...
@@ -413,7 +420,7 @@ class AddVideoCourse extends React.Component {
...
@@ -413,7 +420,7 @@ class AddVideoCourse extends React.Component {
courseChapterList
courseChapterList
}
}
// 校验必填字段:课程名称, 课程视频
// 校验必填字段:课程名称, 课程视频
this
.
handleValidate
(
courseName
,
courseChapterList
,
categoryId
,
scheduleMedia
).
then
((
res
)
=>
{
this
.
handleValidate
(
courseName
,
courseChapterList
,
categoryId
,
scheduleMedia
,
textLength
).
then
((
res
)
=>
{
if
(
!
res
)
return
if
(
!
res
)
return
Upload
.
uploadTextToOSS
(
introduce
,
`
${
randomString
()}
.txt`
,
(
introduceId
)
=>
{
Upload
.
uploadTextToOSS
(
introduce
,
`
${
randomString
()}
.txt`
,
(
introduceId
)
=>
{
this
.
submitRemote
({
id
,
pageType
,
commonParams
:
{
...
commonParams
,
introduceId
}
})
this
.
submitRemote
({
id
,
pageType
,
commonParams
:
{
...
commonParams
,
introduceId
}
})
...
@@ -445,7 +452,7 @@ class AddVideoCourse extends React.Component {
...
@@ -445,7 +452,7 @@ class AddVideoCourse extends React.Component {
}
}
}
}
handleValidate
=
(
courseName
,
courseChapterList
,
categoryId
,
scheduleMedia
)
=>
{
handleValidate
=
(
courseName
,
courseChapterList
,
categoryId
,
scheduleMedia
,
textLength
)
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
if
(
!
courseName
)
{
if
(
!
courseName
)
{
message
.
warning
(
'请输入课程名称'
)
message
.
warning
(
'请输入课程名称'
)
...
@@ -462,14 +469,19 @@ class AddVideoCourse extends React.Component {
...
@@ -462,14 +469,19 @@ class AddVideoCourse extends React.Component {
resolve
(
false
)
resolve
(
false
)
return
false
return
false
}
}
const
textMedia
=
scheduleMedia
.
filter
((
item
)
=>
item
.
mediaType
===
'TEXT'
)
if
(
textLength
>
1000
)
{
for
(
let
i
=
0
,
len
=
textMedia
.
length
;
i
<
len
;
i
++
)
{
message
.
warning
(
'课程简介超过字数限定'
);
if
(
textMedia
[
i
].
mediaContentLength
&&
textMedia
[
i
].
mediaContentLength
.
length
>
1000
)
{
resolve
(
false
);
message
.
warning
(
`第
${
i
+
1
}
个文字简介的字数超过了1000个字`
)
return
;
resolve
(
false
)
return
false
}
}
}
// const textMedia = scheduleMedia.filter((item) => item.mediaType === 'TEXT')
// for (let i = 0, len = textMedia.length; i < len; i++) {
// if (textMedia[i].mediaContentLength && textMedia[i].mediaContentLength.length > 1000) {
// message.warning(`第${i + 1}个文字简介的字数超过了1000个字`)
// resolve(false)
// return false
// }
// }
resolve
(
true
)
resolve
(
true
)
})
})
}
}
...
...
src/modules/course-manage/video-course/components/AddVideoIntro.jsx
View file @
202c0875
...
@@ -117,12 +117,12 @@ class AddVideoIntro extends React.Component {
...
@@ -117,12 +117,12 @@ class AddVideoIntro extends React.Component {
<
span
className=
"label"
>
观看设置:
</
span
>
<
span
className=
"label"
>
观看设置:
</
span
>
<
div
className=
"content"
>
<
div
className=
"content"
>
<
div
>
<
div
>
<
Switch
checked=
{
whetherVisitorsJoin
===
"
YES
"
?
true
:
false
}
onChange=
{
this
.
whetherVisitorsJoinChange
}
/>
<
Switch
checked=
{
whetherVisitorsJoin
===
"
NO
"
?
true
:
false
}
onChange=
{
this
.
whetherVisitorsJoinChange
}
/>
</
div
>
</
div
>
<
div
>
<
div
>
<
div
className=
"desc"
>
<
div
className=
"desc"
>
<
Choose
>
<
Choose
>
<
When
condition=
{
whetherVisitorsJoin
===
"
YES
"
}
>
<
When
condition=
{
whetherVisitorsJoin
===
"
NO
"
}
>
<
div
>
已开启,学员需绑定手机号才可观看
</
div
>
<
div
>
已开启,学员需绑定手机号才可观看
</
div
>
</
When
>
</
When
>
<
Otherwise
>
<
Otherwise
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment