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
5c9cbe98
Commit
5c9cbe98
authored
Nov 27, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
''
parent
8f68b5e5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
76 additions
and
19 deletions
+76
-19
index.html
index.html
+1
-1
coursegatherdetail.js
src/models/coursegatherdetail.js
+40
-1
onlineclasses.js
src/models/onlineclasses.js
+21
-3
CourseBox.js
src/pages/coursegather/detail/CourseBox.js
+1
-1
CourseDetail.js
src/pages/coursegather/detail/CourseDetail.js
+5
-0
index.js
src/pages/coursegather/detail/index.js
+3
-13
CourseDetail.js
src/pages/onlineclasses/singleclass/CourseDetail.js
+5
-0
No files found.
index.html
View file @
5c9cbe98
...
...
@@ -17,6 +17,6 @@
</head>
<body>
<div
id=
"root"
></div>
<script
src=
"dist/main.js?15748
59238720
"
charset=
"utf-8"
></script>
<script
src=
"dist/main.js?15748
63280714
"
charset=
"utf-8"
></script>
</body>
</html>
\ No newline at end of file
src/models/coursegatherdetail.js
View file @
5c9cbe98
...
...
@@ -10,6 +10,7 @@ import {
SessionStorage
,
isExpired
,
getRandomFilename
,
getFileType
,
}
from
'../utils/index'
;
import
*
as
courseMateriaAjax
from
'../services/courseMateria'
;
import
*
as
onlineAjax
from
'../services/onlineclasses'
;
...
...
@@ -889,7 +890,7 @@ export default {
signature
,
files
,
uploaderLoading
,
uploadtype
,
successCallback
,
}
=
payload
;
const
file
=
files
.
files
?
files
.
files
[
0
]
:
null
;
const
{
addCourseObj
}
=
yield
select
(
state
=>
state
.
coursegatherdetail
);
const
{
addCourseObj
,
editSingleCourseInfo
}
=
yield
select
(
state
=>
state
.
coursegatherdetail
);
const
filename
=
`
${
signature
.
dir
}${
getRandomFilename
(
file
.
name
)}
`
;
const
params
=
{
key
:
filename
,
...
...
@@ -913,6 +914,20 @@ export default {
},
});
}
else
if
(
uploadtype
==
'uploadCover'
)
{
yield
put
({
type
:
'createCourseMateria'
,
payload
:
{
content
:
{
name
:
file
.
name
,
size
:
file
.
size
,
fileType
:
file
.
type
,
duration
:
0
,
images
:
[
filename
],
},
filename
,
type
:
getFileType
(
file
.
type
).
filetype
,
},
});
addCourseObj
.
cover
=
imageUrl
;
yield
put
({
type
:
'updateState'
,
...
...
@@ -930,6 +945,30 @@ export default {
},
},
});
}
else
if
(
uploadtype
==
'uploadSingleCourseCover'
)
{
yield
put
({
type
:
'createCourseMateria'
,
payload
:
{
content
:
{
name
:
file
.
name
,
size
:
file
.
size
,
fileType
:
file
.
type
,
duration
:
0
,
images
:
[
filename
],
},
filename
,
type
:
getFileType
(
file
.
type
).
filetype
,
},
});
yield
put
({
type
:
'updateState'
,
payload
:
{
editSingleCourseInfo
:
{
...
editSingleCourseInfo
,
cover
:
imageUrl
,
},
},
});
}
if
(
successCallback
&&
(
typeof
successCallback
==
'function'
))
{
successCallback
({
...
...
src/models/onlineclasses.js
View file @
5c9cbe98
...
...
@@ -6,7 +6,7 @@ import moment from 'moment';
import
{
LocalStorage
,
SessionStorage
,
isExpired
,
getRandomFilename
,
imagify
,
isExpired
,
getRandomFilename
,
imagify
,
getFileType
,
}
from
'../utils/index'
;
import
errorcode
from
'../common/errorcode'
;
import
*
as
onlineAjax
from
'../services/onlineclasses'
;
...
...
@@ -579,7 +579,7 @@ export default {
},
*
queryimagesignature
({
payload
},
{
call
,
put
,
select
})
{
const
{
userInfo
,
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
files
,
uploadtype
}
=
payload
;
const
{
files
,
uploadtype
,
successCallback
}
=
payload
;
const
file
=
files
.
files
?
files
.
files
[
0
]
:
null
;
const
REGEXP_VIDEO
=
/^image
\/\w
+/
;
const
params
=
{
type
:
1
,
token
:
userInfo
.
token
,
schoolId
:
sid
};
...
...
@@ -596,6 +596,7 @@ export default {
files
,
uploaderLoading
,
uploadtype
,
successCallback
,
},
});
}
else
{
...
...
@@ -611,7 +612,7 @@ export default {
},
*
uploadimage
({
payload
},
{
call
,
put
,
select
})
{
const
{
signature
,
files
,
uploaderLoading
,
uploadtype
,
signature
,
files
,
uploaderLoading
,
uploadtype
,
successCallback
,
}
=
payload
;
const
file
=
files
.
files
?
files
.
files
[
0
]
:
null
;
const
{
addCourseObj
}
=
yield
select
(
state
=>
state
.
onlineclasses
);
...
...
@@ -638,6 +639,20 @@ export default {
},
});
}
else
if
(
uploadtype
==
'uploadCover'
)
{
yield
put
({
type
:
'createCourseMateria'
,
payload
:
{
content
:
{
name
:
file
.
name
,
size
:
file
.
size
,
fileType
:
file
.
type
,
duration
:
0
,
images
:
[
filename
],
},
filename
,
type
:
getFileType
(
file
.
type
).
filetype
,
},
});
addCourseObj
.
cover
=
imageUrl
;
yield
put
({
type
:
'updateState'
,
...
...
@@ -656,6 +671,9 @@ export default {
},
});
}
if
(
successCallback
&&
(
typeof
successCallback
==
'function'
))
{
successCallback
();
}
setTimeout
(
uploaderLoading
);
},
*
queryvideosignature
({
payload
},
{
call
,
put
,
select
})
{
...
...
src/pages/coursegather/detail/CourseBox.js
View file @
5c9cbe98
...
...
@@ -63,7 +63,7 @@ class CourseBoxForm extends React.Component {
uploadCover
=
(
e
)
=>
{
const
{
dispatch
,
uploadCover
}
=
this
.
props
;
uploadCover
({
files
:
e
.
target
.
files
,
files
:
e
.
target
,
},
()
=>
{
document
.
getElementById
(
'uploadsinglecoursecover'
).
value
=
''
;
});
...
...
src/pages/coursegather/detail/CourseDetail.js
View file @
5c9cbe98
...
...
@@ -154,6 +154,9 @@ class CourseDetailForm extends React.Component {
payload
:
{
files
:
e
.
target
,
uploadtype
:
'uploadCover'
,
successCallback
()
{
document
.
getElementById
(
'upload1'
).
value
=
''
;
},
},
});
}
...
...
@@ -283,6 +286,7 @@ class CourseDetailForm extends React.Component {
className
=
{
pageStyle
.
uploadInput
}
accept
=
"image/png, image/jpeg"
onChange
=
{(
e
)
=>
{
this
.
uploadCover
(
e
);
}}
id
=
"upload1"
/>
<
/div
>
<
/div
>
...
...
@@ -300,6 +304,7 @@ class CourseDetailForm extends React.Component {
<
img
src
=
{
`
${
__IMGCDN__
}
course/upload_icon1.png`
}
alt
=
"上传图片"
/>
<
div
className
=
{
pageStyle
.
tip
}
>
上传图片
<
/div
>
<
input
id
=
"upload1"
type
=
"file"
className
=
{
pageStyle
.
uploadInput
}
accept
=
"image/png, image/jpeg"
...
...
src/pages/coursegather/detail/index.js
View file @
5c9cbe98
...
...
@@ -634,19 +634,9 @@ class StaticCenter extends React.Component {
dispatch
({
type
:
'coursegatherdetail/queryimagesignature'
,
payload
:
{
files
:
{
files
,
},
successCallback
({
src
})
{
dispatch
({
type
:
'coursegatherdetail/updateState'
,
payload
:
{
editSingleCourseInfo
:
{
...
editSingleCourseInfo
,
cover
:
src
,
},
},
});
files
:
value
.
files
,
uploadtype
:
'uploadSingleCourseCover'
,
successCallback
()
{
if
(
callback
&&
(
typeof
callback
==
'function'
))
{
callback
();
}
...
...
src/pages/onlineclasses/singleclass/CourseDetail.js
View file @
5c9cbe98
...
...
@@ -156,6 +156,9 @@ class CourseDetailForm extends React.Component {
payload
:
{
files
:
e
.
target
,
uploadtype
:
'uploadCover'
,
successCallback
()
{
document
.
getElementById
(
'upload1'
).
value
=
''
;
},
},
});
}
...
...
@@ -353,6 +356,7 @@ class CourseDetailForm extends React.Component {
type
=
"file"
className
=
{
pageStyle
.
uploadInput
}
accept
=
"image/png, image/jpeg"
id
=
"upload1"
onChange
=
{(
e
)
=>
{
this
.
uploadCover
(
e
);
}}
/
>
<
/div
>
...
...
@@ -373,6 +377,7 @@ class CourseDetailForm extends React.Component {
<
input
type
=
"file"
className
=
{
pageStyle
.
uploadInput
}
id
=
"upload1"
accept
=
"image/png, image/jpeg"
onChange
=
{(
e
)
=>
{
this
.
uploadCover
(
e
);
}}
/
>
...
...
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