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
a6ced707
Commit
a6ced707
authored
Jul 05, 2021
by
wufan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:添加sort字段
parent
3dc6f992
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
43 deletions
+88
-43
src/bu-components/PreviewCourseModal.less
+3
-2
src/modules/course-manage/modal/PreviewCourseModal.jsx
+32
-33
src/modules/course-manage/modal/PreviewCourseModal.less
+12
-1
src/modules/course-manage/video-course/AddVideoCourse.jsx
+41
-7
No files found.
src/bu-components/PreviewCourseModal.less
View file @
a6ced707
...
...
@@ -13,8 +13,9 @@
}
.container {
overflow: scroll;
height: 100%;;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
.course-cover, .course-url {
width: 100%;
...
...
src/modules/course-manage/modal/PreviewCourseModal.jsx
View file @
a6ced707
...
...
@@ -108,7 +108,7 @@ class PreviewCourseModal extends React.Component {
timeHorizonEnd
,
teacherName
,
}
=
courseClassInfo
;
const
{
introduce
}
=
courseIntroInfo
;
const
{
introduce
,
categoryName
}
=
courseIntroInfo
;
let
{
activeTab
}
=
this
.
state
;
let
liveDateStr
,
startTimeStr
,
endTimeStr
;
...
...
@@ -163,54 +163,53 @@ class PreviewCourseModal extends React.Component {
>
<
div
className=
"container__wrap"
>
<
div
className=
"container"
>
<
div
className=
"container__header"
>
{
type
===
"videoCourse"
?
(
<
div
className=
'container__header'
>
<
Choose
>
<
When
condition=
{
type
===
'videoCourse'
}
>
<
video
controls
src=
{
courseChapterList
.
length
&&
courseChapterList
[
0
].
mediaUrl
||
scheduleVideoUrl
}
poster=
{
coverUrl
?
coverUrl
:
"https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png"
}
className=
"course-url"
poster=
{
coverUrl
?
coverUrl
:
`https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png`
}
className=
'course-url'
/>
)
:
(
<
img
src=
{
coverUrl
}
className=
"course-cover"
/>
)
}
</
div
>
{
type
===
"videoCourse"
?
(
<
div
className=
"container__body"
>
<
div
className=
"title__name"
>
{
courseName
}
</
div
>
{
videoDuration
&&
(
<
div
>
视频时长:
{
this
.
dealTimeDuration
(
videoDuration
)
}
</
div
>
)
}
</
When
>
<
Otherwise
>
<
img
src=
{
coverUrl
}
className=
'course-cover'
alt=
''
/>
</
Otherwise
>
</
Choose
>
</
div
>
)
:
(
<
div
className=
"container__body"
>
<
div
className=
"container__body__title"
>
<
div
className=
"title__name"
>
{
courseName
}
</
div
>
<
div
className=
"title__state"
>
{
courseStateShow
[
courseState
].
title
}
<
Choose
>
<
When
condition=
{
type
===
'videoCourse'
}
>
<
div
className=
'container__body'
>
<
div
className=
'title__name'
>
{
courseName
}
</
div
>
<
div
className=
'title__category'
>
{
categoryName
}
</
div
>
<
div
className=
'title__chapter'
>
共
{
courseChapterList
.
length
}
小节
</
div
>
</
div
>
</
When
>
<
Otherwise
>
<
div
className=
'container__body'
>
<
div
className=
'container__body__title'
>
<
div
className=
'title__name'
>
{
courseName
}
</
div
>
<
div
className=
'title__state'
>
{
courseStateShow
[
courseState
].
title
}
</
div
>
</
div
>
<
div
className=
"container__body__time"
>
<
span
className=
"time__label"
>
上课时间:
</
span
>
<
span
className=
"time__value"
>
<
div
className=
'container__body__time'
>
<
span
className=
'time__label'
>
上课时间:
</
span
>
<
span
className=
'time__value'
>
{
[
<
span
>
{
liveDateStr
}
</
span
>,
<
span
>
{
startTimeStr
}
~
{
endTimeStr
}
</
span
>,
</
span
>
]
}
</
span
>
</
div
>
<
div
className=
"container__body__teacher"
>
<
span
className=
"teacher__label"
>
上课老师:
</
span
>
<
span
className=
"teacher__value"
>
{
teacherName
}
</
span
>
<
div
className=
'container__body__teacher'
>
<
span
className=
'teacher__label'
>
上课老师:
</
span
>
<
span
className=
'teacher__value'
>
{
teacherName
}
</
span
>
</
div
>
</
div
>
)
}
</
Otherwise
>
</
Choose
>
<
div
className=
"container__introduction"
>
<
Choose
>
...
...
src/modules/course-manage/modal/PreviewCourseModal.less
View file @
a6ced707
...
...
@@ -13,7 +13,8 @@
}
.container {
overflow: scroll;
overflow-y: auto;
overflow-x: hidden;
height: 100%;;
.course-cover, .course-url {
...
...
@@ -30,6 +31,16 @@
color: #000;
}
.title__category {
color: #999999;
margin-top: 4px;
margin-bottom: 4px;
}
.title__chapter {
color: #999999;
margin-bottom: 4px;
}
.title__inst-name {
color: #666;
font-size: 12px;
...
...
src/modules/course-manage/video-course/AddVideoCourse.jsx
View file @
a6ced707
...
...
@@ -103,14 +103,14 @@ class AddVideoCourse extends React.Component {
})
}
catalogChange
=
(
value
)
=>
{
catalogChange
=
(
value
,
categoryName
)
=>
{
const
changeValueLength
=
value
.
length
switch
(
changeValueLength
)
{
case
1
:
this
.
setState
({
categoryId
:
value
[
0
]
})
this
.
setState
({
categoryId
:
value
[
0
]
,
categoryName
})
break
case
2
:
this
.
setState
({
categoryId
:
value
[
1
]
})
this
.
setState
({
categoryId
:
value
[
1
]
,
categoryName
})
break
default
:
this
.
setState
({
categoryId
:
null
})
...
...
@@ -269,7 +269,7 @@ class AddVideoCourse extends React.Component {
// 显示预览弹窗
handleShowPreviewModal
=
()
=>
{
const
{
coverUrl
,
scheduleVideoUrl
,
courseName
,
scheduleMedia
,
videoDuration
,
introduce
,
courseChapterList
}
=
this
.
state
const
{
coverUrl
,
scheduleVideoUrl
,
courseName
,
scheduleMedia
,
videoDuration
,
introduce
,
courseChapterList
,
categoryName
}
=
this
.
state
const
courseBasinInfo
=
{
coverUrl
,
...
...
@@ -279,7 +279,8 @@ class AddVideoCourse extends React.Component {
}
const
courseIntroInfo
=
{
liveCourseMediaRequests
:
scheduleMedia
,
introduce
introduce
,
categoryName
}
const
previewCourseModal
=
(
...
...
@@ -324,7 +325,8 @@ class AddVideoCourse extends React.Component {
mediaNameAlias
:
folderName
.
replace
(
'.mp4'
,
''
),
videoDuration
:
videoDom
.
duration
,
id
:
resourceId
,
mediaUrl
:
ossUrl
mediaUrl
:
ossUrl
,
sort
:
courseChapterList
.
length
})
this
.
setState
({
...
...
@@ -337,8 +339,40 @@ class AddVideoCourse extends React.Component {
})
}
})
}
// 校验课节名称
handleValidateChapterName
=
(
chapterName
)
=>
{
let
hasError
=
false
;
return
new
Promise
((
resolve
)
=>
{
if
(
!
chapterName
)
{
this
.
setState
({
chapterNameValidateStatus
:
"error"
,
chapterNameHelpMsg
:
'请输入课节名称'
})
hasError
=
true
;
resolve
(
false
)
return
false
}
if
(
chapterName
.
length
>
40
)
{
this
.
setState
({
chapterNameValidateStatus
:
"error"
,
chapterNameHelpMsg
:
'不要超过40字'
})
hasError
=
true
;
resolve
(
false
)
return
false
}
if
(
!
hasError
){
resolve
(
true
)
this
.
setState
({
chapterNameValidateStatus
:
""
,
chapterNameHelpMsg
:
""
})
}
})
}
// 保存
...
...
@@ -799,7 +833,7 @@ class AddVideoCourse extends React.Component {
<
span
className=
'label'
>
课程分类:
</
span
>
{
pageType
===
'add'
&&
(
<
Cascader
defaultValue=
{
[
categoryName
]
}
defaultValue=
{
[]
}
options=
{
courseCatalogList
}
displayRender=
{
(
label
)
=>
label
.
join
(
'-'
)
}
fieldNames=
{
fieldNames
}
...
...
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