Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
biz.qingxiao.com
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
biz.qingxiao.com
Commits
c50ab2d7
Commit
c50ab2d7
authored
Nov 28, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
''
parent
2fedd899
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
223 additions
and
10 deletions
+223
-10
UploadCourseware.js
src/components/UploadCourseware.js
+9
-3
coursegatherdetail.js
src/models/coursegatherdetail.js
+1
-0
coursemateria.js
src/models/coursemateria.js
+17
-2
onlineclasses.js
src/models/onlineclasses.js
+1
-0
uploadcourseware.js
src/models/uploadcourseware.js
+2
-2
CourseBox.js
src/pages/coursegather/detail/CourseBox.js
+10
-1
CourseBox.less
src/pages/coursegather/detail/CourseBox.less
+36
-0
index.js
src/pages/coursegather/detail/index.js
+11
-0
MediaCard.js
src/pages/coursemateria/MediaCard.js
+27
-2
MediaCard.less
src/pages/coursemateria/MediaCard.less
+43
-0
index.js
src/pages/coursemateria/index.js
+11
-0
index.js
src/pages/onlineclasses/singleclass/index.js
+19
-0
index.less
src/pages/onlineclasses/singleclass/index.less
+36
-0
No files found.
src/components/UploadCourseware.js
View file @
c50ab2d7
...
...
@@ -93,11 +93,17 @@ class UploadCourseware extends React.Component {
const
img
=
new
Image
();
img
.
src
=
videoPoster
(
src
);
img
.
onload
=
()
=>
{
document
.
getElementById
(
'videoposter'
).
setAttribute
(
'src'
,
videoPoster
(
src
));
if
(
document
.
getElementById
(
'videoposter'
))
{
document
.
getElementById
(
'videoposter'
).
setAttribute
(
'src'
,
videoPoster
(
src
));
}
};
img
.
onerror
=
()
=>
{
document
.
getElementById
(
'videoposter'
).
setAttribute
(
'src'
,
`
${
__IMGCDN__
}
course/video_default.png`
);
that
.
reLoadVideoPoster
(
src
);
if
(
document
.
getElementById
(
'videoposter'
))
{
document
.
getElementById
(
'videoposter'
).
setAttribute
(
'src'
,
`
${
__IMGCDN__
}
course/video_default.png`
);
}
setTimeout
(()
=>
{
that
.
reLoadVideoPoster
(
src
);
},
500
);
};
}
pptSwiper
=
(
type
)
=>
{
...
...
src/models/coursegatherdetail.js
View file @
c50ab2d7
...
...
@@ -116,6 +116,7 @@ export default {
school_id
:
sid
,
...
queryParams
,
...
params
,
trans_status
:
2
,
});
const
{
code
,
msg
,
data
}
=
querymaterialistData
;
if
(
data
.
total
!=
undefined
)
{
...
...
src/models/coursemateria.js
View file @
c50ab2d7
...
...
@@ -207,15 +207,18 @@ export default {
params
=
{
type
:
1
,
token
:
userInfo
.
token
,
schoolId
:
sid
};
break
;
case
2
:
// 视频
if
(
file
.
size
>
5
00
*
1024
*
1024
)
{
if
(
file
.
size
>
6
00
*
1024
*
1024
)
{
// yield call(uploadMateriaLoading);
yield
put
({
type
:
'updateState'
,
payload
:
{
materiaUploading
:
false
,
uploadStatus
:
{
step
:
0
,
// 1 文件上传中 2 素材转换中 4 保存中
},
},
});
message
.
error
(
'视频的大小不能超过【
4
0MB】,请重新上传'
,
1
);
message
.
error
(
'视频的大小不能超过【
60
0MB】,请重新上传'
,
1
);
return
;
}
duration
=
yield
call
(
getVideoDuration
,
file
);
...
...
@@ -224,6 +227,9 @@ export default {
type
:
'updateState'
,
payload
:
{
materiaUploading
:
false
,
uploadStatus
:
{
step
:
0
,
// 1 文件上传中 2 素材转换中 4 保存中
},
},
});
// yield call(uploadMateriaLoading);
...
...
@@ -244,6 +250,9 @@ export default {
type
:
'updateState'
,
payload
:
{
materiaUploading
:
false
,
uploadStatus
:
{
step
:
0
,
// 1 文件上传中 2 素材转换中 4 保存中
},
},
});
message
.
error
(
'音频格式不支持,重新上传'
,
2
);
...
...
@@ -262,6 +271,9 @@ export default {
type
:
'updateState'
,
payload
:
{
materiaUploading
:
false
,
uploadStatus
:
{
step
:
0
,
// 1 文件上传中 2 素材转换中 4 保存中
},
},
});
message
.
error
(
'ppt的大小不能超过【40MB】,请重新上传'
,
1
);
...
...
@@ -277,6 +289,9 @@ export default {
type
:
'updateState'
,
payload
:
{
materiaUploading
:
false
,
uploadStatus
:
{
step
:
0
,
// 1 文件上传中 2 素材转换中 4 保存中
},
},
});
message
.
error
(
'pdf的大小不能超过【40MB】,请重新上传'
,
1
);
...
...
src/models/onlineclasses.js
View file @
c50ab2d7
...
...
@@ -78,6 +78,7 @@ export default {
school_id
:
sid
,
...
queryParams
,
...
params
,
trans_status
:
2
,
});
const
{
code
,
msg
,
data
}
=
querymaterialistData
;
if
(
data
.
total
!=
undefined
)
{
...
...
src/models/uploadcourseware.js
View file @
c50ab2d7
...
...
@@ -74,7 +74,7 @@ export default {
params
=
{
type
:
1
,
token
:
userInfo
.
token
,
schoolId
:
sid
};
break
;
case
2
:
// 视频
if
(
file
.
size
>
5
00
*
1024
*
1024
)
{
if
(
file
.
size
>
6
00
*
1024
*
1024
)
{
// yield call(uploadMateriaLoading);
yield
put
({
type
:
'updateState'
,
...
...
@@ -82,7 +82,7 @@ export default {
fileUploading
:
false
,
},
});
message
.
error
(
'视频的大小不能超过【
5
00MB】,请重新上传'
,
1
);
message
.
error
(
'视频的大小不能超过【
6
00MB】,请重新上传'
,
1
);
return
;
}
duration
=
yield
call
(
getVideoDuration
,
file
);
...
...
src/pages/coursegather/detail/CourseBox.js
View file @
c50ab2d7
import
React
from
'react'
;
import
{
List
,
Icon
,
DatePicker
,
Form
,
Card
,
Button
,
Menu
,
Dropdown
,
Input
,
Pagination
,
Row
,
Col
}
from
'antd'
;
import
{
List
,
Icon
,
DatePicker
,
Form
,
Card
,
Button
,
Menu
,
Dropdown
,
Input
,
Pagination
,
Row
,
Col
,
Popover
}
from
'antd'
;
import
moment
from
'moment'
;
import
pageStyle
from
'./CourseBox.less'
;
import
{
imagify
}
from
'../../../utils'
;
...
...
@@ -90,6 +90,7 @@ class CourseBoxForm extends React.Component {
courseQueryParams
,
sizeChange
,
onChangeCourseList
,
refresh
,
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
formItemModalLineLayout
=
{
...
...
@@ -173,6 +174,14 @@ class CourseBoxForm extends React.Component {
}
description
=
{
<
div
>
{
item
.
trans_status
==
1
&&
<
Popover
content
=
{
<
div
>
视频转码中
,
转码成功后课程发布成功,
<
br
/>
点击
&
nbsp
;
<
Icon
type
=
"sync"
className
=
{
pageStyle
.
refresh
}
/> 查看转码状态</
div
>
}
trigger
=
"hover"
>
<
div
className
=
{
pageStyle
.
tranlateStatus
}
>
<
span
>
转码中
<
/span
>
<
Icon
type
=
"sync"
className
=
{
pageStyle
.
refresh
}
style
=
{{
fontSize
:
'16px'
}}
onClick
=
{
refresh
}
/
>
<
/div
>
<
/Popover
>
}
<
span
className
=
{
pageStyle
.
itemTime
}
>
{
item
.
created_at
}
<
/span
>
<
div
>
<
span
...
...
src/pages/coursegather/detail/CourseBox.less
View file @
c50ab2d7
...
...
@@ -226,3 +226,39 @@
}
}
}
.tranlateStatus {
width: 87px;
height: 28px;
border-radius: 6px 0px 6px 0px;
background-color: #FF646B;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
z-index: 5;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently*/
cursor: pointer;
span {
padding-right: 3px;
}
@keyframes refreshRotate {
from {
transform: rotate(0);
}
to {
transform: rotate(90deg);
}
}
// .refresh:active {
// color: red;
// animation: refreshRotate 0.5s linear;
// }
}
\ No newline at end of file
src/pages/coursegather/detail/index.js
View file @
c50ab2d7
...
...
@@ -759,6 +759,16 @@ class StaticCenter extends React.Component {
choosedPoster
:
''
,
});
}
refreshCourseList
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'coursegatherdetail/selectCourseList'
,
payload
:
{
params
:
{
},
},
});
}
courseListSizeChange
=
(
page
,
perPage
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
...
...
@@ -879,6 +889,7 @@ class StaticCenter extends React.Component {
courseQueryParams
=
{
courseQueryParams
}
sizeChange
=
{
this
.
courseListSizeChange
}
onChangeCourseList
=
{
this
.
onChangeCourseList
}
refresh
=
{
this
.
refreshCourseList
}
/>
}
{
tabIndex
==
2
&&
<
StaticBox
staticTotalInfo
=
{
staticTotalInfo
}
...
...
src/pages/coursemateria/MediaCard.js
View file @
c50ab2d7
import
React
from
'react'
;
import
{
Icon
}
from
'antd'
;
import
{
Icon
,
Popover
}
from
'antd'
;
import
PropTypes
from
'prop-types'
;
import
pageStyle
from
'./MediaCard.less'
;
import
{
...
...
@@ -12,6 +12,24 @@ class MediaCard extends React.Component {
super
(
props
);
this
.
state
=
{};
}
reLoadVideoPoster
=
(
info
)
=>
{
const
that
=
this
;
const
img
=
new
Image
();
img
.
src
=
videoPoster
(
info
.
src
);
img
.
onload
=
()
=>
{
if
(
document
.
getElementById
(
`videoposter_
${
info
.
id
}
`
))
{
document
.
getElementById
(
`videoposter_
${
info
.
id
}
`
).
setAttribute
(
'src'
,
videoPoster
(
info
.
src
));
}
};
img
.
onerror
=
()
=>
{
if
(
document
.
getElementById
(
`videoposter_
${
info
.
id
}
`
))
{
document
.
getElementById
(
`videoposter_
${
info
.
id
}
`
).
setAttribute
(
'src'
,
`
${
__IMGCDN__
}
course/video_default.png`
);
}
setTimeout
(()
=>
{
that
.
reLoadVideoPoster
(
info
);
},
500
);
};
}
render
()
{
const
{
info
,
...
...
@@ -25,6 +43,13 @@ class MediaCard extends React.Component {
}
return
(
<
div
className
=
{
pageStyle
.
box
}
{...
this
.
props
}
>
{
info
.
trans_status
==
1
&&
info
.
type
&&
<
Popover
content
=
{
<
div
>
视频转码中
,
转码成功后可以使用该素材,
<
br
/>
点击
&
nbsp
;
<
Icon
type
=
"sync"
className
=
{
pageStyle
.
refresh
}
/> 查看状态</
div
>
}
trigger
=
"hover"
>
<
div
className
=
{
pageStyle
.
tranlateStatus
}
>
<
span
>
转码中
<
/span
>
<
Icon
type
=
"sync"
className
=
{
pageStyle
.
refresh
}
style
=
{{
fontSize
:
'16px'
}}
onClick
=
{
methods
.
refresh
}
/
>
<
/div
>
<
/Popover>
}
{
info
.
type
==
1
&&
<
div
className
=
{
`
${
pageStyle
.
mediaBox
}
${
pageStyle
.
imgBox
}
`
}
title
=
{
content
.
name
}
onClick
=
{()
=>
methods
.
preview
(
info
)}
>
<
img
className
=
{
pageStyle
.
image
}
src
=
{
`
${
imagify
(
info
.
src
,
'image/resize,w_320/format,jpg/quality,q_60'
)}
`
}
alt
=
""
/>
...
...
@@ -32,7 +57,7 @@ class MediaCard extends React.Component {
<
/div>
}
{
info
.
type
==
2
&&
<
div
className
=
{
`
${
pageStyle
.
mediaBox
}
${
pageStyle
.
videoBox
}
`
}
title
=
{
content
.
name
}
onClick
=
{()
=>
methods
.
preview
(
info
)}
>
<
img
className
=
{
pageStyle
.
videoposter
}
src
=
{
`
${
videoPoster
(
info
.
src
)}
`
}
alt
=
""
/>
<
img
className
=
{
pageStyle
.
videoposter
}
id
=
{
`videoposter_
${
info
.
id
}
`
}
onError
=
{()
=>
this
.
reLoadVideoPoster
(
info
)}
src
=
{
`
${
videoPoster
(
info
.
src
)}
`
}
alt
=
""
/>
<
img
className
=
{
pageStyle
.
videoicon
}
src
=
{
`
${
__IMGCDN__
}
course/video_icon.png`
}
alt
=
""
/>
<
div
className
=
{
pageStyle
.
videoplay
}
>
<
img
className
=
{
pageStyle
.
videoplayicon
}
src
=
{
`
${
__IMGCDN__
}
smallplayicon.png`
}
alt
=
""
/>
...
...
src/pages/coursemateria/MediaCard.less
View file @
c50ab2d7
...
...
@@ -2,11 +2,54 @@
border-radius: 8px;
overflow: hidden;
width: 200px;
position: relative;
.tranlateStatus {
width: 87px;
height: 28px;
border-radius: 6px 0px 6px 0px;
background-color: #FF646B;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
z-index: 5;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently*/
cursor: pointer;
span {
padding-right: 3px;
}
@keyframes refreshRotate {
from {
transform: rotate(0);
}
to {
transform: rotate(90deg);
}
}
// .refresh:active {
// color: red;
// animation: refreshRotate 0.5s linear;
// }
}
.mediaBox {
// width: 200px;
height: 164px;
position: relative;;
cursor: pointer;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently*/
&.imgBox {
.imageicon {
width: 35px;
...
...
src/pages/coursemateria/index.js
View file @
c50ab2d7
...
...
@@ -79,6 +79,16 @@ class StaticCenter extends React.Component {
},
});
}
refresh
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'coursemateria/querymaterialist'
,
payload
:
{
params
:
{
},
},
});
}
tabClick
=
(
type
,
tab
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
...
...
@@ -261,6 +271,7 @@ class StaticCenter extends React.Component {
methods
=
{{
delmateria
:
this
.
delMateria
,
preview
:
this
.
preview
,
refresh
:
this
.
refresh
,
}}
info
=
{
ele
}
key
=
{
ele
.
id
}
...
...
src/pages/onlineclasses/singleclass/index.js
View file @
c50ab2d7
...
...
@@ -15,6 +15,7 @@ import {
message
,
Modal
,
Pagination
,
Popover
,
}
from
'antd'
;
import
pageStyle
from
'./index.less'
;
import
AddCourseModal
from
'./AddCourseModal'
;
...
...
@@ -142,6 +143,16 @@ class ClassMgtForm extends React.Component {
},
});
}
refresh
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'onlineclasses/selectCourseList'
,
payload
:
{
params
:
{
},
},
});
}
toUploadCourseWare
=
(
item
)
=>
{
const
{
addCourseObj
}
=
this
.
props
;
let
content
=
null
;
...
...
@@ -331,6 +342,14 @@ class ClassMgtForm extends React.Component {
}
description
=
{
<
div
>
{
item
.
trans_status
==
1
&&
<
Popover
content
=
{
<
div
>
视频转码中
,
转码成功后课程发布成功,
<
br
/>
点击
&
nbsp
;
<
Icon
type
=
"sync"
className
=
{
pageStyle
.
refresh
}
/> 查看转码状态</
div
>
}
trigger
=
"hover"
>
<
div
className
=
{
pageStyle
.
tranlateStatus
}
>
<
span
>
转码中
<
/span
>
<
Icon
type
=
"sync"
className
=
{
pageStyle
.
refresh
}
style
=
{{
fontSize
:
'16px'
}}
onClick
=
{
this
.
refresh
}
/
>
<
/div
>
<
/Popover
>
}
<
div
className
=
{
pageStyle
.
itemTime
}
onClick
=
{()
=>
this
.
goEditCourseStatic
(
item
.
id
,
1
)}
>
{
item
.
created_at
}
<
/div
>
<
div
>
<
span
title
=
{(
item
.
content
&&
JSON
.
parse
(
item
.
content
)
&&
JSON
.
parse
(
item
.
content
).
src
)
?
JSON
.
parse
(
item
.
content
).
properties
.
name
:
''
}
className
=
"hreflink"
style
=
{{
paddingRight
:
'20px'
,
color
:
'#2194FF'
,
lineHeight
:
1
}}
onClick
=
{()
=>
this
.
toUploadCourseWare
(
item
)}
>
{(
item
.
content
&&
JSON
.
parse
(
item
.
content
)
&&
JSON
.
parse
(
item
.
content
).
src
)
?
'编辑课件'
:
'上传课件'
}
<
/span
>
...
...
src/pages/onlineclasses/singleclass/index.less
View file @
c50ab2d7
...
...
@@ -149,3 +149,39 @@
display: flex;
justify-content: flex-end;
}
.tranlateStatus {
width: 87px;
height: 28px;
border-radius: 6px 0px 6px 0px;
background-color: #FF646B;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
z-index: 5;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently*/
cursor: pointer;
span {
padding-right: 3px;
}
@keyframes refreshRotate {
from {
transform: rotate(0);
}
to {
transform: rotate(90deg);
}
}
// .refresh:active {
// color: red;
// animation: refreshRotate 0.5s linear;
// }
}
\ No newline at end of file
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