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
7677176e
Commit
7677176e
authored
Aug 09, 2021
by
maolipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:sdadasdaf
parent
4149e59c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
4 deletions
+51
-4
src/modules/course-manage/components/AddLiveBasic.jsx
+7
-0
src/modules/course-manage/components/AddLiveClassInfoWorkWX.jsx
+12
-1
src/modules/course-manage/components/CreateWorkWXCourse.jsx
+32
-3
No files found.
src/modules/course-manage/components/AddLiveBasic.jsx
View file @
7677176e
...
@@ -124,6 +124,7 @@ class AddLiveBasic extends React.Component {
...
@@ -124,6 +124,7 @@ class AddLiveBasic extends React.Component {
<
span
className=
'label'
>
<
span
className=
'label'
>
<
span
className=
'require'
>
*
</
span
>
课程名称:
<
span
className=
'require'
>
*
</
span
>
课程名称:
</
span
>
</
span
>
<
div
style=
{
_
.
find
(
this
.
props
.
exItems
,(
item
)
=>
{
return
item
===
"courseName"
})?{
border
:
"1px solid red"
,
display
:
"inline-block"
}:{
display
:
"inline-block"
}
}
>
<
Input
<
Input
value=
{
courseName
}
value=
{
courseName
}
placeholder=
{
`请输入直播名称(${this.state.courseNameLimit}字以内)`
}
placeholder=
{
`请输入直播名称(${this.state.courseNameLimit}字以内)`
}
...
@@ -133,6 +134,7 @@ class AddLiveBasic extends React.Component {
...
@@ -133,6 +134,7 @@ class AddLiveBasic extends React.Component {
this
.
props
.
onChange
(
'courseName'
,
e
.
target
.
value
);
this
.
props
.
onChange
(
'courseName'
,
e
.
target
.
value
);
}
}
}
}
/>
/>
</
div
>
</
div
>
</
div
>
<
div
className=
'course-cover'
>
<
div
className=
'course-cover'
>
<
span
className=
'label'
>
封面图:
</
span
>
<
span
className=
'label'
>
封面图:
</
span
>
...
@@ -164,6 +166,7 @@ class AddLiveBasic extends React.Component {
...
@@ -164,6 +166,7 @@ class AddLiveBasic extends React.Component {
<
span
className=
'require'
>
*
</
span
>
课程分类:
<
span
className=
'require'
>
*
</
span
>
课程分类:
</
span
>
</
span
>
{
pageType
===
'add'
&&
(
{
pageType
===
'add'
&&
(
<
div
style=
{
_
.
find
(
this
.
props
.
exItems
,(
item
)
=>
{
return
item
===
"categoryId"
})?{
border
:
"1px solid red"
,
display
:
"inline-block"
}:{
display
:
"inline-block"
}
}
>
<
Cascader
<
Cascader
options=
{
courseCatalogList
}
options=
{
courseCatalogList
}
displayRender=
{
(
label
)
=>
label
.
join
(
'-'
)
}
displayRender=
{
(
label
)
=>
label
.
join
(
'-'
)
}
...
@@ -177,8 +180,10 @@ class AddLiveBasic extends React.Component {
...
@@ -177,8 +180,10 @@ class AddLiveBasic extends React.Component {
</
span
>
</
span
>
}
}
/>
/>
</
div
>
)
}
)
}
{
pageType
===
'edit'
&&
categoryName
&&
(
{
pageType
===
'edit'
&&
categoryName
&&
(
<
div
style=
{
_
.
find
(
this
.
props
.
exItems
,(
item
)
=>
{
return
item
===
"categoryId"
})?{
border
:
"1px solid red"
,
display
:
"inline-block"
}:{
display
:
"inline-block"
}
}
>
<
Cascader
<
Cascader
disabled=
{
!
isEdit
?
true
:
false
}
disabled=
{
!
isEdit
?
true
:
false
}
defaultValue=
{
[
categoryName
]
}
defaultValue=
{
[
categoryName
]
}
...
@@ -194,7 +199,9 @@ class AddLiveBasic extends React.Component {
...
@@ -194,7 +199,9 @@ class AddLiveBasic extends React.Component {
</
span
>
</
span
>
}
}
/>
/>
</
div
>
)
}
)
}
</
div
>
</
div
>
{
showSelectFileModal
&&
{
showSelectFileModal
&&
<
SelectPrepareFileModal
<
SelectPrepareFileModal
...
...
src/modules/course-manage/components/AddLiveClassInfoWorkWX.jsx
View file @
7677176e
...
@@ -183,7 +183,6 @@ export default function AddLiveClassInfoWorkWX(props) {
...
@@ -183,7 +183,6 @@ export default function AddLiveClassInfoWorkWX(props) {
const
{
result
=
{}
}
=
res
;
const
{
result
=
{}
}
=
res
;
const
{
records
=
[],
total
=
0
,
hasNext
}
=
result
;
const
{
records
=
[],
total
=
0
,
hasNext
}
=
result
;
const
list
=
_query
.
current
>
1
?
teacherList
.
concat
(
records
)
:
records
;
const
list
=
_query
.
current
>
1
?
teacherList
.
concat
(
records
)
:
records
;
console
.
log
(
list
)
setTeacherList
(
list
)
setTeacherList
(
list
)
setHasNext
(
hasNext
)
setHasNext
(
hasNext
)
});
});
...
@@ -209,6 +208,7 @@ export default function AddLiveClassInfoWorkWX(props) {
...
@@ -209,6 +208,7 @@ export default function AddLiveClassInfoWorkWX(props) {
<
div
className=
"AddLiveClassInfoWorkWX"
>
<
div
className=
"AddLiveClassInfoWorkWX"
>
<
div
className=
"begin-time item"
>
<
div
className=
"begin-time item"
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
开始时间:
</
span
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
开始时间:
</
span
>
<
div
style=
{
_
.
find
(
props
.
exItems
,(
item
)
=>
{
return
item
===
"startTime"
})?{
border
:
"1px solid red"
,
display
:
"inline-block"
}:{
display
:
"inline-block"
}
}
>
<
DatePicker
<
DatePicker
placeholder=
"请选择开始日期"
placeholder=
"请选择开始日期"
value=
{
beginDate
===
0
?
undefined
:
moment
(
beginDate
)
}
value=
{
beginDate
===
0
?
undefined
:
moment
(
beginDate
)
}
...
@@ -225,6 +225,7 @@ export default function AddLiveClassInfoWorkWX(props) {
...
@@ -225,6 +225,7 @@ export default function AddLiveClassInfoWorkWX(props) {
format=
"HH:mm"
format=
"HH:mm"
style=
{
{
width
:
"120px"
}
}
style=
{
{
width
:
"120px"
}
}
/>
/>
</
div
>
</
div
>
</
div
>
<
div
className=
"duration-time item"
>
<
div
className=
"duration-time item"
>
...
@@ -232,6 +233,7 @@ export default function AddLiveClassInfoWorkWX(props) {
...
@@ -232,6 +233,7 @@ export default function AddLiveClassInfoWorkWX(props) {
cusTime
||
props
.
type
===
"edit"
?
(
cusTime
||
props
.
type
===
"edit"
?
(
<>
<>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
结束时间:
</
span
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
结束时间:
</
span
>
<
div
style=
{
_
.
find
(
props
.
exItems
,(
item
)
=>
{
return
item
===
"endTime"
})?{
border
:
"1px solid red"
,
display
:
"inline-block"
}:{
display
:
"inline-block"
}
}
>
<
DatePicker
<
DatePicker
placeholder=
"请选择结束日期"
placeholder=
"请选择结束日期"
value=
{
endDate
===
0
?
undefined
:
moment
(
endDate
)
}
value=
{
endDate
===
0
?
undefined
:
moment
(
endDate
)
}
...
@@ -250,6 +252,7 @@ export default function AddLiveClassInfoWorkWX(props) {
...
@@ -250,6 +252,7 @@ export default function AddLiveClassInfoWorkWX(props) {
format=
"HH:mm"
format=
"HH:mm"
style=
{
{
width
:
"120px"
}
}
style=
{
{
width
:
"120px"
}
}
/>
/>
</
div
>
</>
</>
)
:
(
)
:
(
<>
<>
...
@@ -268,6 +271,7 @@ export default function AddLiveClassInfoWorkWX(props) {
...
@@ -268,6 +271,7 @@ export default function AddLiveClassInfoWorkWX(props) {
</
div
>
</
div
>
<
div
className=
"teacher item"
>
<
div
className=
"teacher item"
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
讲师:
</
span
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
讲师:
</
span
>
<
div
style=
{
_
.
find
(
props
.
exItems
,(
item
)
=>
{
return
item
===
"teacherId"
})?{
border
:
"1px solid red"
,
display
:
"inline-block"
}:{
display
:
"inline-block"
}
}
>
<
Select
<
Select
value=
{
teacherId
}
value=
{
teacherId
}
onChange=
{
onTeacherChange
}
onChange=
{
onTeacherChange
}
...
@@ -291,6 +295,12 @@ export default function AddLiveClassInfoWorkWX(props) {
...
@@ -291,6 +295,12 @@ export default function AddLiveClassInfoWorkWX(props) {
size
:
15
size
:
15
})
})
}
}
}
}
onDropdownVisibleChange=
{
(
open
)
=>
{
if
(
open
)
{
let
query
=
{...
teacherQuery
,
nickName
:
null
}
setTeacherQuery
(
query
)
}
}
}
>
>
{
{
teacherList
.
map
((
item
,
index
)
=>
{
teacherList
.
map
((
item
,
index
)
=>
{
...
@@ -300,6 +310,7 @@ export default function AddLiveClassInfoWorkWX(props) {
...
@@ -300,6 +310,7 @@ export default function AddLiveClassInfoWorkWX(props) {
})
})
}
}
</
Select
>
</
Select
>
</
div
>
</
div
>
</
div
>
<
div
className=
"remind-time item"
>
<
div
className=
"remind-time item"
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
提醒时间:
</
span
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
提醒时间:
</
span
>
...
...
src/modules/course-manage/components/CreateWorkWXCourse.jsx
View file @
7677176e
...
@@ -61,6 +61,7 @@ function CreateWorkWXCourse() {
...
@@ -61,6 +61,7 @@ function CreateWorkWXCourse() {
const
[
introduce
,
setIntroduce
]
=
useState
(
''
)
const
[
introduce
,
setIntroduce
]
=
useState
(
''
)
const
[
getInfo
,
setGetInfo
]
=
useState
(
false
)
const
[
getInfo
,
setGetInfo
]
=
useState
(
false
)
const
[
previewLiveCourseModal
,
setPreviewLiveCourseModal
]
=
useState
()
const
[
previewLiveCourseModal
,
setPreviewLiveCourseModal
]
=
useState
()
const
[
exItems
,
setExItems
]
=
useState
([])
useEffect
(()
=>
{
useEffect
(()
=>
{
routeHook
.
addSaveCase
();
routeHook
.
addSaveCase
();
...
@@ -171,6 +172,7 @@ function CreateWorkWXCourse() {
...
@@ -171,6 +172,7 @@ function CreateWorkWXCourse() {
//课程信息变更回调
//课程信息变更回调
function
onClassInfoChange
(
field
,
value
)
{
function
onClassInfoChange
(
field
,
value
)
{
let
classinfo
=
{...
classInfo
}
let
classinfo
=
{...
classInfo
}
console
.
log
(
field
,
value
)
switch
(
field
)
{
switch
(
field
)
{
case
'intro'
:
case
'intro'
:
setIntroduce
(
value
)
setIntroduce
(
value
)
...
@@ -205,6 +207,7 @@ function CreateWorkWXCourse() {
...
@@ -205,6 +207,7 @@ function CreateWorkWXCourse() {
// 完成创建/编辑
// 完成创建/编辑
function
handleSubmit
()
{
function
handleSubmit
()
{
setExItems
([])
//过期判断
//过期判断
if
(
User
.
getExpirationTime
()
&&
moment
().
valueOf
()
>
Number
(
User
.
getExpirationTime
()))
{
if
(
User
.
getExpirationTime
()
&&
moment
().
valueOf
()
>
Number
(
User
.
getExpirationTime
()))
{
Modal
.
warning
({
Modal
.
warning
({
...
@@ -294,6 +297,32 @@ function CreateWorkWXCourse() {
...
@@ -294,6 +297,32 @@ function CreateWorkWXCourse() {
function
handleValidate
()
{
function
handleValidate
()
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
_exitem
=
[]
if
(
_
.
isEmpty
(
basicInfo
.
courseName
))
{
_exitem
.
push
(
"courseName"
)
}
if
(
_
.
isEmpty
(
basicInfo
.
categoryId
))
{
_exitem
.
push
(
"categoryId"
)
}
if
(
!
classInfo
.
startTime
)
{
_exitem
.
push
(
"startTime"
)
}
if
(
classInfo
.
startTime
<
new
Date
().
getTime
())
{
_exitem
.
push
(
"startTime"
)
}
if
(
endTime
<
classInfo
.
startTime
)
{
_exitem
.
push
(
"endTime"
)
}
if
(
_
.
isEmpty
(
classInfo
.
teacherId
))
{
_exitem
.
push
(
"teacherId"
)
}
if
(
editorTextLength
>
1000
)
{
_exitem
.
push
(
"intro"
)
}
setExItems
(
_exitem
)
if
(
_
.
isEmpty
(
basicInfo
.
courseName
))
{
if
(
_
.
isEmpty
(
basicInfo
.
courseName
))
{
message
.
warning
(
"课程名称不能为空"
)
message
.
warning
(
"课程名称不能为空"
)
resolve
(
false
)
resolve
(
false
)
...
@@ -314,7 +343,7 @@ function CreateWorkWXCourse() {
...
@@ -314,7 +343,7 @@ function CreateWorkWXCourse() {
resolve
(
false
)
resolve
(
false
)
return
return
}
}
if
(
classInfo
.
endTime
<
classInfo
.
startTime
)
{
if
(
endTime
<
classInfo
.
startTime
)
{
message
.
warning
(
"结束时间不能早于开始时间"
)
message
.
warning
(
"结束时间不能早于开始时间"
)
resolve
(
false
)
resolve
(
false
)
return
return
...
@@ -383,14 +412,14 @@ function CreateWorkWXCourse() {
...
@@ -383,14 +412,14 @@ function CreateWorkWXCourse() {
<
div
className=
'add-live-page__form'
>
<
div
className=
'add-live-page__form'
>
<
div
className=
'basic-info__wrap'
>
<
div
className=
'basic-info__wrap'
>
<
div
className=
'title'
>
基本信息
<
span
style=
{
{
marginLeft
:
"24px"
,
color
:
"#2966FF"
,
fontSize
:
"14px"
}
}
>
温馨提示:在直播间可控制回放录制功能。
</
span
></
div
>
<
div
className=
'title'
>
基本信息
<
span
style=
{
{
marginLeft
:
"24px"
,
color
:
"#2966FF"
,
fontSize
:
"14px"
}
}
>
温馨提示:在直播间可控制回放录制功能。
</
span
></
div
>
<
AddLiveBasic
isEdit=
{
isEdit
}
pageType=
{
type
}
data=
{
basicInfo
}
onChange=
{
handleChangeBasicInfo
}
courseNameLimit=
{
20
}
/>
<
AddLiveBasic
isEdit=
{
isEdit
}
pageType=
{
type
}
data=
{
basicInfo
}
onChange=
{
handleChangeBasicInfo
}
courseNameLimit=
{
20
}
exItems=
{
exItems
}
/>
</
div
>
</
div
>
<
div
className=
'class-info__wrap'
>
<
div
className=
'class-info__wrap'
>
<
div
className=
'title'
>
上课信息
</
div
>
<
div
className=
'title'
>
上课信息
</
div
>
{
/* <AddLiveClass isEdit={isEdit} pageType={type} data={{ ...addLiveClassInfo, id }} onChange={handleChangeClassInfo} /> */
}
{
/* <AddLiveClass isEdit={isEdit} pageType={type} data={{ ...addLiveClassInfo, id }} onChange={handleChangeClassInfo} /> */
}
{
{
getInfo
&&
<
AddLiveClassInfoWorkWX
type=
{
type
}
data=
{
classInfo
}
isEdit=
{
isEdit
}
introduce=
{
introduce
}
onChange=
{
onClassInfoChange
}
/>
getInfo
&&
<
AddLiveClassInfoWorkWX
type=
{
type
}
data=
{
classInfo
}
isEdit=
{
isEdit
}
introduce=
{
introduce
}
onChange=
{
onClassInfoChange
}
exItems=
{
exItems
}
/>
}
}
</
div
>
</
div
>
...
...
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