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
cc0b9bff
Commit
cc0b9bff
authored
Nov 25, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'最新代码上传'
parent
2bf6e956
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
210 additions
and
22 deletions
+210
-22
index.html
index.html
+1
-1
MaterialModal.js
src/components/MaterialModal.js
+3
-3
UploadCourseware.js
src/components/UploadCourseware.js
+54
-10
UploadCourseware.less
src/components/UploadCourseware.less
+90
-0
coursegatherdetail.js
src/models/coursegatherdetail.js
+25
-3
uploadcourseware.js
src/models/uploadcourseware.js
+1
-1
CommentList.less
src/pages/coursegather/detail/CommentList.less
+2
-1
index.js
src/pages/coursegather/detail/index.js
+8
-2
index.less
src/pages/coursegather/index/index.less
+1
-0
CommentList.less
src/pages/onlineclasses/singleclass/CommentList.less
+3
-0
CourseDetail.js
src/pages/onlineclasses/singleclass/CourseDetail.js
+1
-1
index.less
src/pages/onlineclasses/singleclass/index.less
+1
-0
singleDetail.less
src/pages/onlineclasses/singleclass/singleDetail.less
+1
-0
index.js
src/utils/index.js
+19
-0
No files found.
index.html
View file @
cc0b9bff
...
...
@@ -17,6 +17,6 @@
</head>
<body>
<div
id=
"root"
></div>
<script
src=
"dist/main.js?15746
4399104
8"
charset=
"utf-8"
></script>
<script
src=
"dist/main.js?15746
6102717
8"
charset=
"utf-8"
></script>
</body>
</html>
\ No newline at end of file
src/components/MaterialModal.js
View file @
cc0b9bff
...
...
@@ -91,9 +91,9 @@ class MaterialModalForm extends React.Component {
<
div
className
=
{
pageStyle
.
item
}
>
<
Radio
value
=
{
item
}
>
{
item
.
type
===
1
&&
<
img
className
=
{
pageStyle
.
img
}
src
=
{
imagify
(
item
.
src
)}
alt
=
""
/>
}
{
item
.
type
===
2
&&
<
img
className
=
{
pageStyle
.
img
}
src
=
{
`
${
__IMGCDN__
}
/course/video_default.PNG
`
}
alt
=
""
/>
}
{
item
.
type
===
3
&&
<
img
className
=
{
pageStyle
.
img
}
src
=
{
`
${
__IMGCDN__
}
/course/audio_default.PNG
`
}
alt
=
""
/>
}
{
item
.
type
===
4
&&
<
img
className
=
{
pageStyle
.
img
}
src
=
{
`
${
__IMGCDN__
}
/course/ppt_default.PNG
`
}
alt
=
""
/>
}
{
item
.
type
===
2
&&
<
img
className
=
{
pageStyle
.
img
}
src
=
{
`
${
__IMGCDN__
}
course/video_default.png
`
}
alt
=
""
/>
}
{
item
.
type
===
3
&&
<
img
className
=
{
pageStyle
.
img
}
src
=
{
`
${
__IMGCDN__
}
course/audio_default.png
`
}
alt
=
""
/>
}
{
item
.
type
===
4
&&
<
img
className
=
{
pageStyle
.
img
}
src
=
{
`
${
__IMGCDN__
}
course/ppt_default.png
`
}
alt
=
""
/>
}
<
/Radio
>
<
/div
>
<
/List.Item
>
...
...
src/components/UploadCourseware.js
View file @
cc0b9bff
import
{
connect
}
from
'dva'
;
import
React
from
'react'
;
import
{
Button
,
Row
,
Icon
,
Col
,
Input
,
Select
,
Pagination
,
Radio
,
DatePicker
,
Modal
,
Form
,
TimePicker
,
InputNumber
,
Table
}
from
'antd'
;
import
{
Button
,
Row
,
Carousel
,
Icon
,
Col
,
Input
,
Select
,
Pagination
,
Radio
,
DatePicker
,
Modal
,
Form
,
TimePicker
,
InputNumber
,
Table
}
from
'antd'
;
import
pageStyle
from
'./UploadCourseware.less'
;
import
{
pageIn
}
from
'../utils/index'
;
import
{
pageIn
,
imagify
,
videoPoster
,
audioorigin
,
pptImagify
,
}
from
'../utils/index'
;
const
{
Option
}
=
Select
;
const
{
TextArea
}
=
Input
;
const
{
Group
}
=
Radio
;
...
...
@@ -69,6 +75,7 @@ class UploadCourseware extends React.Component {
info
,
chooseFromCourseMateria
,
}
=
this
.
props
;
console
.
log
(
info
,
'1111111'
);
return
(
<
Modal
visible
=
{
visible
}
...
...
@@ -107,17 +114,54 @@ class UploadCourseware extends React.Component {
<
/div
>
<
/div
>
<
div
className
=
{
pageStyle
.
uploadBox
}
style
=
{{
display
:
info
.
src
?
'block'
:
'none'
}}
>
{
info
.
type
==
1
&&
<
div
>
图片
<
/div
>
{
info
.
mediaType
==
1
&&
<
Carousel
className
=
{
pageStyle
.
Carousel
}
ref
=
{
this
.
ref
}
draggable
>
{
info
.
images
.
map
((
ele
,
index
)
=>
{
return
(
<
div
className
=
{
pageStyle
.
CarouselBox
}
key
=
{
ele
}
>
<
img
className
=
{
pageStyle
.
CarouselImg
}
alt
=
""
src
=
{
imagify
(
ele
)}
/
>
<
/div
>
);
})
}
<
/Carousel
>
}
{
info
.
type
==
2
&&
<
div
>
视频
<
/div
>
{
info
.
mediaType
==
2
&&
<
div
className
=
{
pageStyle
.
videobox
}
>
<
img
className
=
{
pageStyle
.
videoImg
}
alt
=
""
src
=
{
videoPoster
(
info
.
src
)}
/
>
<
div
className
=
{
pageStyle
.
videoplay
}
>
<
img
className
=
{
pageStyle
.
videoplayicon
}
src
=
{
`
${
__IMGCDN__
}
smallplayicon.png`
}
alt
=
""
/>
<
/div
>
<
/div
>
}
{
info
.
type
==
3
&&
<
div
>
录音
<
/div
>
{
info
.
mediaType
==
3
&&
<
audio
controls
=
"controls"
className
=
{
pageStyle
.
audio
}
src
=
{
audioorigin
(
info
.
src
)}
/
>
}
{(
info
.
mediaType
==
4
||
info
.
mediaType
==
5
)
&&
info
.
from
==
'upload'
&&
<
div
className
=
{
`
${
pageStyle
.
mediaBox
}
${
pageStyle
.
fileBox
}
`
}
>
<
img
className
=
{
pageStyle
.
fileIcon
}
src
=
{
`
${
__IMGCDN__
}
/course/ppt_icon.png`
}
alt
=
""
/>
<
div
className
=
{
pageStyle
.
fileName
}
>
{
info
.
properties
.
name
}
<
/div
>
<
/div
>
}
{
info
.
type
==
4
&&
<
div
>
文件
<
/div
>
{(
info
.
mediaType
==
4
||
info
.
mediaType
==
5
)
&&
info
.
from
!=
'upload'
&&
<
Carousel
className
=
{
pageStyle
.
Carousel
}
ref
=
{
this
.
ref
}
draggable
>
{
info
.
images
.
map
((
ele
,
index
)
=>
{
return
(
<
div
className
=
{
pageStyle
.
CarouselBox
}
key
=
{
ele
}
>
<
img
className
=
{
pageStyle
.
CarouselImg
}
alt
=
""
src
=
{
pptImagify
(
ele
)}
/
>
<
/div
>
);
})
}
<
/Carousel
>
}
<
/div
>
<
div
className
=
{
pageStyle
.
uploadbottom
}
>
...
...
src/components/UploadCourseware.less
View file @
cc0b9bff
...
...
@@ -8,9 +8,11 @@
.uploadBox {
width: 100%;
height: 254px;
overflow: hidden;
border-radius: 10px;
border:2px dashed rgba(194,194,194,1);
margin: 0 auto;
position: relative;
.uploadBoxTitle {
color: #575757;
font-size: 16px;
...
...
@@ -106,4 +108,92 @@
font-size: 14px;
}
}
}
.Carousel {
z-index: 2;
width: 100%;
height: 100%;
position: relative;
}
.CarouselBox {
z-index: 2;
width: 100%;
// height: 100%;
height: 254px;
position: relative;
}
.CarouselImg {
position: absolute;
display: block;
max-width: 100%;
max-height: 100%;
width: 100%;
height: 254px;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.videobox {
width: 100%;
height: 254px;
position: relative;
.videoImg {
max-width: 100%;
max-height: 100%;
display: block;
margin: 0 auto;
// height: 254px;
}
.videoplay {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 55px;
height: 55px;
border-radius: 50%;
border:2px solid rgba(255,255,255,1);
background:rgba(0,0,0,0.3);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
.videoplayicon {
width: 14px;
height: 16px;
}
}
}
.audio {
margin: 0 auto;
display: block;
line-height: 254px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.fileBox {
background-color: #FFB879;
height: 254px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.fileIcon {
width: 57px;
height: 51px;
margin: 0 auto 18px;
display: block;
}
.fileName {
color:rgba(255,255,255,1);
text-align: center;
margin: 0 auto;
text-align: center;
max-width: 80%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
\ No newline at end of file
src/models/coursegatherdetail.js
View file @
cc0b9bff
...
...
@@ -1414,8 +1414,9 @@ export default {
},
});
let
saveData
=
null
;
console
.
log
(
value
,
'value'
);
if
(
editSingleCourseId
==
0
)
{
const
saveData
=
yield
call
(
onlineAjax
.
createGatherSingleCourse
,
{
saveData
=
yield
call
(
onlineAjax
.
createGatherSingleCourse
,
{
...
editSingleCourseInfo
,
...
value
,
id
,
...
...
@@ -1504,6 +1505,9 @@ export default {
const
{
data
,
code
}
=
transformData
;
if
(
code
==
200
)
{
if
(
editSingleCourseId
==
0
)
{
if
(
info
.
from
)
{
delete
info
.
from
;
}
yield
put
({
type
:
'updateState'
,
payload
:
{
...
...
@@ -1511,7 +1515,7 @@ export default {
...
editSingleCourseInfo
,
content
:
{
...
info
,
images
:
info
.
type
==
1
?
[
info
.
src
]
:
[]
,
images
:
transformData
.
data
.
result
,
},
},
},
...
...
@@ -1533,9 +1537,15 @@ export default {
coursewareSubmitting
:
true
,
},
});
if
(
info
.
from
)
{
delete
info
.
from
;
}
const
loadmessage
=
message
.
loading
(
'保存中...'
,
0
);
const
data
=
yield
call
(
courseMateriaAjax
.
uploadCourseware
,
{
content
:
JSON
.
stringify
(
info
),
content
:
JSON
.
stringify
({
...
info
,
images
:
transformData
.
data
.
result
,
}),
id
:
editSingleCourseId
,
});
yield
put
({
...
...
@@ -1602,6 +1612,9 @@ export default {
});
}
else
{
if
(
editSingleCourseId
==
0
)
{
if
(
info
.
from
)
{
delete
info
.
from
;
}
yield
put
({
type
:
'updateState'
,
payload
:
{
...
...
@@ -1631,6 +1644,9 @@ export default {
coursewareSubmitting
:
true
,
},
});
if
(
info
.
from
)
{
delete
info
.
from
;
}
const
loadmessage
=
message
.
loading
(
'保存中...'
,
0
);
const
data
=
yield
call
(
courseMateriaAjax
.
uploadCourseware
,
{
content
:
JSON
.
stringify
(
info
),
...
...
@@ -1672,6 +1688,9 @@ export default {
}
}
else
{
if
(
editSingleCourseId
==
0
)
{
if
(
info
.
from
)
{
delete
info
.
from
;
}
yield
put
({
type
:
'updateState'
,
payload
:
{
...
...
@@ -1698,6 +1717,9 @@ export default {
coursewareSubmitting
:
true
,
},
});
if
(
info
.
from
)
{
delete
info
.
from
;
}
const
loadmessage
=
message
.
loading
(
'保存中...'
,
0
);
const
data
=
yield
call
(
courseMateriaAjax
.
uploadCourseware
,
{
content
:
JSON
.
stringify
(
info
),
...
...
src/models/uploadcourseware.js
View file @
cc0b9bff
...
...
@@ -123,7 +123,7 @@ export default {
size
,
fileType
,
},
images
:
[],
images
:
getFileType
(
fileType
).
filetype
==
1
?
[
filename
]
:
[],
src
:
filename
,
fileType
,
type
:
getFileType
(
fileType
).
filetype
,
...
...
src/pages/coursegather/detail/CommentList.less
View file @
cc0b9bff
...
...
@@ -17,5 +17,6 @@
margin-bottom: 20px;
}
.container {
padding: 31px 21px
padding: 31px 21px;
min-height: calc(100vh - 280px);
}
src/pages/coursegather/detail/index.js
View file @
cc0b9bff
...
...
@@ -350,6 +350,8 @@ class StaticCenter extends React.Component {
}
materialSave
=
(
values
)
=>
{
const
{
dispatch
,
materiaSaveTo
,
editSingleCourseInfo
}
=
this
.
props
;
console
.
log
(
values
,
'values'
);
console
.
log
(
materiaSaveTo
,
'materiaSaveTo'
);
if
(
materiaSaveTo
==
1
)
{
dispatch
({
type
:
'coursegatherdetail/updateCover'
,
...
...
@@ -374,12 +376,15 @@ class StaticCenter extends React.Component {
materialVisible
:
false
,
},
});
const
content
=
JSON
.
parse
(
values
.
checkValue
.
content
);
const
{
images
}
=
content
;
delete
content
.
images
;
dispatch
({
type
:
'uploadcourseware/updateState'
,
payload
:
{
info
:
JSON
.
parse
(
JSON
.
stringify
({
properties
:
JSON
.
parse
(
values
.
checkValue
.
content
)
,
images
:
[]
,
properties
:
content
,
images
,
src
:
values
.
checkValue
.
src
,
fileType
:
JSON
.
parse
(
values
.
checkValue
.
content
).
fileType
,
type
:
getFileType
(
JSON
.
parse
(
values
.
checkValue
.
content
).
fileType
).
filetype
,
...
...
@@ -497,6 +502,7 @@ class StaticCenter extends React.Component {
uploadCourseware
=
(
values
)
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
addWareType
}
=
this
.
state
;
console
.
log
(
addWareType
,
'asdasdas'
);
if
(
addWareType
==
1
)
{
dispatch
({
type
:
'coursegatherdetail/saveCourseWare'
,
...
...
src/pages/coursegather/index/index.less
View file @
cc0b9bff
...
...
@@ -2,6 +2,7 @@
.container {
background-color: #fff;
border-radius: 6px;
min-height: calc(100vh - 110px);
}
.tabbox {
box-shadow:0px 6px 6px 0px rgba(0, 0, 0, 0.04);
...
...
src/pages/onlineclasses/singleclass/CommentList.less
View file @
cc0b9bff
.container {
min-height: calc(100vh - 220px - 44px);
}
.hreflink {
font-size:14px;
font-family:PingFang SC;
...
...
src/pages/onlineclasses/singleclass/CourseDetail.js
View file @
cc0b9bff
...
...
@@ -377,7 +377,7 @@ class CourseDetailForm extends React.Component {
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"开课时间"
>
{
getFieldDecorator
(
'start_time'
,
{
initialValue
:
moment
(
addCourseObj
.
start_time
,
'YYYY-MM-DD HH:mm'
)
,
initialValue
:
addCourseObj
.
start_time
?
moment
(
addCourseObj
.
start_time
,
'YYYY-MM-DD HH:mm'
)
:
null
,
rules
:
[
{
required
:
true
,
...
...
src/pages/onlineclasses/singleclass/index.less
View file @
cc0b9bff
.container {
background-color: #fff;
position: relative;
min-height: calc(100vh - 110px);
.head {
height: 70px;
width: 100%;
...
...
src/pages/onlineclasses/singleclass/singleDetail.less
View file @
cc0b9bff
.container {
padding-bottom: 20px;
width: 100%;
min-height: calc(100vh - 110px);
.head {
//height: 100px;
//width: 100%;
...
...
src/utils/index.js
View file @
cc0b9bff
...
...
@@ -43,6 +43,24 @@ export function imagify(src, params) {
}
return
Src
;
}
function
pptImagify
(
src
,
params
)
{
const
reg
=
/
(((
^https
?
:
(?:\/\/)?)(?:[
-;:&=
\+\$
,
\w]
+@
)?[
A-Za-z0-9.-
]
+|
(?:
www.|
[
-;:&=
\+\$
,
\w]
+@
)[
A-Za-z0-9.-
]
+
)((?:\/[\+
~%
\/
.
\w
-_
]
*
)?\??(?:[
-
\+
=&;%@.
\w
_
]
*
)
#
?(?:[\w]
*
))?)
$/g
;
if
(
reg
.
test
(
src
))
{
return
src
;
}
if
(
!
src
)
return
''
;
let
Src
=
src
;
if
(
src
.
indexOf
(
'//tmp'
)
!=
-
1
)
{
return
Src
;
}
if
(
src
.
indexOf
(
'cdn.img.shangjiadao.cn'
)
==
-
1
)
{
Src
=
`https://media.shangjiadao.cn/
${
src
}
`
;
}
if
(
params
)
{
Src
=
`
${
Src
}
?x-oss-process=
${
params
}
`
;
}
return
Src
;
}
function
pathify
(
path
)
{
return
typeof
path
===
'string'
?
path
.
replace
(
/
\/(
sjd|activity
)
_
\w
+/
,
'/'
)
:
path
;
}
...
...
@@ -843,4 +861,5 @@ export {
getWeekDay
,
getDateStamp
,
getFileType
,
pptImagify
,
};
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