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
5ca73a22
Commit
5ca73a22
authored
Jul 06, 2021
by
wufan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:线上课列表默认图
parent
79ea4fff
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
43 deletions
+21
-43
src/common/constants/academic/lessonEnum.js
+1
-0
src/modules/course-manage/video-course/AddVideoCourse.jsx
+17
-38
src/modules/course-manage/video-course/components/VideoCourseList.jsx
+3
-5
No files found.
src/common/constants/academic/lessonEnum.js
View file @
5ca73a22
...
...
@@ -139,6 +139,7 @@ const FileTypeIcon = {
PNG
:
"https://image.xiaomaiketang.com/xm/XRkX8JBTPs.png"
,
GIF
:
"https://image.xiaomaiketang.com/xm/XRkX8JBTPs.png"
,
BMP
:
"https://image.xiaomaiketang.com/xm/XRkX8JBTPs.png"
,
VIDEO
:
"https://image.xiaomaiketang.com/xm/TKwbQGYDBR.png"
};
const
UploadIcon
=
"https://image.xiaomaiketang.com/xm/4DXNrZWWsd.png"
;
...
...
src/modules/course-manage/video-course/AddVideoCourse.jsx
View file @
5ca73a22
...
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-05 10:07:47
* @LastEditors: wufan
* @LastEditTime: 2021-07-0
5 15:59:51
* @LastEditTime: 2021-07-0
6 13:45:55
* @Description: 线上课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -56,7 +56,6 @@ class AddVideoCourse extends React.Component {
pageType
,
// 页面类型: add->新建 edit->编辑
imageFile
:
null
,
// 需要被截取的图片
courseName
:
null
,
// 线上课名称
scheduleVideoIds
:
null
,
// 线上课链接
coverId
:
null
,
// 视频封面的recourceId
coverUrl
:
null
,
// 线上课封面
studentList
:
[],
// 上课学员列表
...
...
@@ -83,7 +82,8 @@ class AddVideoCourse extends React.Component {
cutImageBlob
:
null
,
introduce
:
''
,
courseChapterList
:[
]
// 课节列表
],
// 课节列表
videoType
:
"MP4"
,
}
}
...
...
@@ -124,14 +124,12 @@ class AddVideoCourse extends React.Component {
courseId
}).
then
((
res
)
=>
{
const
{
result
=
{}
}
=
res
||
{}
const
{
courseName
,
shelfState
,
whetherVisitorsJoin
,
courseMediaVOS
,
categoryOneName
,
categoryTwoName
,
categoryId
,
courseChapterList
=
[]
}
=
result
const
{
courseName
,
shelfState
,
whetherVisitorsJoin
,
courseMediaVOS
,
categoryOneName
,
categoryTwoName
,
categoryId
,
courseChapter
VO
List
=
[]
}
=
result
let
coverId
let
coverUrl
let
videoType
let
videoDuration
let
videoName
let
scheduleMedia
=
[]
let
scheduleVideoIds
let
scheduleVideoUrl
let
hasIntro
...
...
@@ -141,13 +139,6 @@ class AddVideoCourse extends React.Component {
coverId
=
item
.
mediaContent
coverUrl
=
item
.
mediaUrl
break
case
'SCHEDULE'
:
videoDuration
=
item
.
videoDuration
videoName
=
item
.
mediaName
scheduleVideoIds
=
item
.
mediaContent
scheduleVideoUrl
=
item
.
mediaUrl
videoType
=
item
.
mediaType
break
case
'INTRO'
:
hasIntro
=
true
this
.
getTextDetail
(
'introduce'
,
item
.
mediaUrl
)
...
...
@@ -164,22 +155,27 @@ class AddVideoCourse extends React.Component {
}
else
{
categoryName
=
`
${
categoryOneName
}
`
}
const
_courseChapterVOList
=
courseChapterVOList
.
map
(
item
=>
{
item
.
mediaName
=
item
.
name
;
item
.
mediaNameAlias
=
item
.
name
;
return
item
})
this
.
setState
({
loadintroduce
:
!
hasIntro
,
coverId
,
coverUrl
,
videoType
,
videoName
,
videoDuration
,
scheduleMedia
,
courseName
,
scheduleVideoIds
,
scheduleVideoUrl
,
shelfState
,
whetherVisitorsJoin
,
categoryName
,
categoryId
,
courseChapterList
courseChapterList
:
_courseChapterVOList
})
})
}
...
...
@@ -197,11 +193,11 @@ class AddVideoCourse extends React.Component {
}
handleGoBack
=
()
=>
{
const
{
coverId
,
videoName
,
videoDuration
,
courseName
,
scheduleMedia
,
scheduleVideoIds
,
categoryId
,
shelfState
,
whetherVisitorsJoin
}
=
this
.
state
const
{
coverId
,
videoName
,
videoDuration
,
courseName
,
scheduleMedia
,
courseChapterList
,
categoryId
,
shelfState
,
whetherVisitorsJoin
}
=
this
.
state
if
(
videoName
||
videoDuration
||
scheduleVideoIds
||
!
courseChapterList
.
length
||
!
_
.
isEqual
(
scheduleMedia
,
defaultScheduleMedia
)
||
categoryId
||
courseName
||
...
...
@@ -334,8 +330,6 @@ class AddVideoCourse extends React.Component {
size
:
folderSize
,
videoName
:
folderName
,
videoType
:
folderFormat
,
scheduleVideoUrl
:
ossUrl
,
scheduleVideoIds
:
resourceId
,
courseChapterList
:
_courseChapterList
})
}
...
...
@@ -391,18 +385,12 @@ class AddVideoCourse extends React.Component {
const
{
id
,
size
,
coverId
,
coverUrl
,
pageType
,
joinType
,
videoName
,
videoDuration
,
studentList
,
courseName
,
scheduleMedia
,
scheduleVideoIds
,
scheduleVideoUrl
,
categoryId
,
shelfState
,
whetherVisitorsJoin
,
...
...
@@ -413,7 +401,6 @@ class AddVideoCourse extends React.Component {
const
commonParams
=
{
videoName
,
videoDuration
,
courseMediaId
:
scheduleVideoIds
,
scheduleMedia
:
scheduleMedia
.
filter
((
item
)
=>
!!
item
.
mediaContent
),
categoryId
,
courseName
,
...
...
@@ -426,7 +413,7 @@ class AddVideoCourse extends React.Component {
courseChapterList
}
// 校验必填字段:课程名称, 课程视频
this
.
handleValidate
(
courseName
,
scheduleVideoIds
,
categoryId
,
scheduleMedia
).
then
((
res
)
=>
{
this
.
handleValidate
(
courseName
,
courseChapterList
,
categoryId
,
scheduleMedia
).
then
((
res
)
=>
{
if
(
!
res
)
return
Upload
.
uploadTextToOSS
(
introduce
,
`
${
randomString
()}
.txt`
,
(
introduceId
)
=>
{
this
.
submitRemote
({
id
,
pageType
,
commonParams
:
{
...
commonParams
,
introduceId
}
})
...
...
@@ -458,14 +445,14 @@ class AddVideoCourse extends React.Component {
}
}
handleValidate
=
(
courseName
,
scheduleVideoIds
,
categoryId
,
scheduleMedia
)
=>
{
handleValidate
=
(
courseName
,
courseChapterList
,
categoryId
,
scheduleMedia
)
=>
{
return
new
Promise
((
resolve
)
=>
{
if
(
!
courseName
)
{
message
.
warning
(
'请输入课程名称'
)
resolve
(
false
)
return
false
}
if
(
!
scheduleVideoIds
)
{
if
(
!
courseChapterList
.
length
)
{
message
.
warning
(
'请上传视频'
)
resolve
(
false
)
return
false
...
...
@@ -690,18 +677,10 @@ class AddVideoCourse extends React.Component {
const
{
pageType
,
courseName
,
scheduleVideoIds
,
coverId
,
coverUrl
,
scheduleVideoUrl
,
studentList
,
scheduleMedia
,
showCutModal
,
showSelectFileModal
,
diskList
,
imageFile
,
joinType
,
videoName
,
videoType
,
shelfState
,
categoryName
,
...
...
src/modules/course-manage/video-course/components/VideoCourseList.jsx
View file @
5ca73a22
...
...
@@ -63,17 +63,15 @@ class VideoCourseList extends React.Component {
width
:
321
,
fixed
:
'left'
,
render
:
(
val
,
record
)
=>
{
const
{
coverUrl
,
scheduleVideoUrl
}
=
record
;
const
{
coverUrl
}
=
record
;
return
(
<
div
className=
'record__item'
>
{
/* 上传了封面的话就用上传的封面, 没有的话就取视频的第一帧 */
}
<
img
className=
'course-cover'
src=
{
coverUrl
||
(
type
===
'internal'
?
`${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast`
:
'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png'
)
coverUrl
||
'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png'
}
alt=
''
alt=
'
封面图
'
/>
<
Choose
>
<
When
condition=
{
record
.
courseName
.
length
>
25
}
>
...
...
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