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
2ee1f46e
Commit
2ee1f46e
authored
Dec 14, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
''
parent
09644546
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
102 additions
and
2 deletions
+102
-2
coursegatherdetail.js
src/models/coursegatherdetail.js
+55
-1
CourseBox.js
src/pages/coursegather/detail/CourseBox.js
+11
-0
CourseDetail.js
src/pages/coursegather/detail/CourseDetail.js
+10
-0
CourseDetail.less
src/pages/coursegather/detail/CourseDetail.less
+1
-1
index.js
src/pages/coursegather/detail/index.js
+25
-0
No files found.
src/models/coursegatherdetail.js
View file @
2ee1f46e
...
...
@@ -327,6 +327,20 @@ export default {
});
}
},
*
uEditorChange
({
payload
},
{
call
,
put
,
select
})
{
const
{
value
}
=
payload
;
const
{
addCourseObj
}
=
yield
select
(
state
=>
state
.
coursegatherdetail
);
addCourseObj
.
intro
=
[{
type
:
'editor'
,
value
,
}];
yield
put
({
type
:
'updateState'
,
payload
:
{
addCourseObj
:
{
...
addCourseObj
},
},
});
},
*
getGatherDetail
({
payload
},
{
call
,
put
,
select
})
{
const
{
id
,
addCourseObj
}
=
yield
select
(
state
=>
state
.
coursegatherdetail
);
const
loading
=
message
.
loading
(
'数据加载中...'
,
0
);
...
...
@@ -336,6 +350,36 @@ export default {
setTimeout
(
loading
);
const
{
data
,
msg
,
code
}
=
detaildata
;
if
(
code
==
200
)
{
let
intro
=
[];
if
(
data
.
intro
)
{
try
{
const
newIntro
=
JSON
.
parse
(
data
.
intro
);
if
(
newIntro
.
length
==
1
&&
newIntro
[
0
].
value
==
''
)
{
intro
=
[
{
type
:
'editor'
,
value
:
''
,
},
];
}
else
{
intro
=
newIntro
;
}
}
catch
(
e
)
{
intro
=
[
{
type
:
'editor'
,
value
:
''
,
},
];
}
}
else
{
intro
=
[
{
type
:
'editor'
,
value
:
''
,
},
];
}
yield
put
({
type
:
'updateState'
,
payload
:
{
...
...
@@ -347,7 +391,7 @@ export default {
charge_type
:
data
.
charge_type
,
created_at
:
data
.
created_at
,
type
:
data
.
type
,
intro
:
data
.
intro
&&
data
.
intro
!=
null
?
JSON
.
parse
(
data
.
intro
)
:
addCourseObj
.
intro
,
intro
:
JSON
.
parse
(
JSON
.
stringify
(
intro
))
,
remark
:
data
.
remark
,
study_count
:
data
.
study_count
,
status
:
data
.
status
,
...
...
@@ -460,6 +504,10 @@ export default {
start_time
:
null
,
cover
:
''
,
content
:
''
,
intro
:
[{
type
:
'editor'
,
value
:
''
,
}],
},
saveSingleCourseSubmitting
:
false
,
coursewareSubmitting
:
false
,
...
...
@@ -1581,6 +1629,7 @@ export default {
...
value
,
id
,
content
:
editSingleCourseInfo
.
content
?
JSON
.
stringify
(
editSingleCourseInfo
.
content
)
:
''
,
intro
:
JSON
.
stringify
(
editSingleCourseInfo
.
intro
),
});
}
else
{
saveData
=
yield
call
(
onlineAjax
.
editCourse
,
{
...
...
@@ -1589,6 +1638,7 @@ export default {
id
:
editSingleCourseId
,
content
:
''
,
type
:
1
,
intro
:
JSON
.
stringify
(
editSingleCourseInfo
.
intro
),
});
}
yield
put
({
...
...
@@ -1617,6 +1667,10 @@ export default {
start_time
:
null
,
cover
:
''
,
content
:
''
,
intro
:
[{
type
:
'editor'
,
value
:
''
,
}],
},
},
});
...
...
src/pages/coursegather/detail/CourseBox.js
View file @
2ee1f46e
...
...
@@ -2,6 +2,7 @@ import React from 'react';
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
ThemeEditor
from
'../../onlineclasses/ThemeEditor'
;
import
{
imagify
}
from
'../../../utils'
;
const
FormItem
=
Form
.
Item
;
class
CourseBoxForm
extends
React
.
Component
{
...
...
@@ -67,6 +68,10 @@ class CourseBoxForm extends React.Component {
document
.
getElementById
(
'uploadsinglecoursecover'
).
value
=
''
;
});
}
uEditorSingleChange
=
(
value
)
=>
{
const
{
uEditorSingleChange
}
=
this
.
props
;
uEditorSingleChange
(
value
);
}
render
()
{
const
{
list
,
...
...
@@ -316,6 +321,12 @@ class CourseBoxForm extends React.Component {
style
=
{{
width
:
424
}}
/>
)
}
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"课 程 介 绍"
>
<
ThemeEditor
commentParams
=
{
editSingleCourseInfo
}
uEditorChange
=
{
this
.
uEditorSingleChange
}
/
>
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
>
<
Button
type
=
"primary"
htmlType
=
"submit"
style
=
{{
marginRight
:
20
}}
loading
=
{
singleCourseSubmitting
}
>
{
singleCourseSubmitting
?
'保存中...'
:
'保存'
}
<
/Button
>
<
Button
type
=
"primary"
onClick
=
{
toAddCourseWare
}
style
=
{{
marginRight
:
20
}}
>
上传课件
<
/Button
>
...
...
src/pages/coursegather/detail/CourseDetail.js
View file @
2ee1f46e
...
...
@@ -226,6 +226,15 @@ class CourseDetailForm extends React.Component {
},
});
}
uEditorChange
=
(
value
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'coursegatherdetail/uEditorChange'
,
payload
:
{
value
,
},
});
}
render
()
{
const
{
form
:
{
getFieldDecorator
,
getFieldValue
},
...
...
@@ -418,6 +427,7 @@ class CourseDetailForm extends React.Component {
moveContent
=
{
this
.
courseMoveContent
}
editorAddText
=
{
this
.
courseAddText
}
editorUploadAudio
=
{
this
.
courseUploadAudio
}
uEditorChange
=
{
this
.
uEditorChange
}
/
>
<
/FormItem
>
<
div
...
...
src/pages/coursegather/detail/CourseDetail.less
View file @
2ee1f46e
...
...
@@ -219,5 +219,5 @@
box-shadow:1px -6px 6px 0px rgba(0, 0, 0, 0.04);
transition: 0.2s left;
transition: 0.1s width;
z-index:
5
;
z-index:
20
;
}
src/pages/coursegather/detail/index.js
View file @
2ee1f46e
...
...
@@ -672,6 +672,7 @@ class StaticCenter extends React.Component {
start_time
:
item
.
start_time
,
cover
:
item
.
cover
,
content
:
item
.
content
?
JSON
.
parse
(
item
.
content
)
:
''
,
intro
:
item
.
intro
,
},
},
});
...
...
@@ -706,6 +707,10 @@ class StaticCenter extends React.Component {
start_time
:
null
,
cover
:
''
,
content
:
''
,
intro
:
[{
type
:
'editor'
,
value
:
''
,
}],
},
},
});
...
...
@@ -723,6 +728,10 @@ class StaticCenter extends React.Component {
start_time
:
item
.
start_time
,
cover
:
item
.
cover
,
content
:
item
.
content
?
JSON
.
parse
(
item
.
content
)
:
''
,
intro
:
item
.
intro
?
JSON
.
parse
(
item
.
intro
)
:
[{
type
:
'editor'
,
value
:
''
,
}],
},
},
});
...
...
@@ -793,6 +802,20 @@ class StaticCenter extends React.Component {
},
});
}
uEditorSingleChange
=
(
value
)
=>
{
const
{
editSingleCourseInfo
,
dispatch
}
=
this
.
props
;
const
neweditSingleCourseInfo
=
JSON
.
parse
(
JSON
.
stringify
(
editSingleCourseInfo
));
neweditSingleCourseInfo
.
intro
=
[{
type
:
'editor'
,
value
,
}];
dispatch
({
type
:
'coursegatherdetail/updateState'
,
payload
:
{
editSingleCourseInfo
:
neweditSingleCourseInfo
,
},
});
}
render
()
{
const
that
=
this
;
const
{
...
...
@@ -828,6 +851,7 @@ class StaticCenter extends React.Component {
courseQueryParams
,
coursewareSubmitting
,
}
=
this
.
props
;
console
.
log
(
editSingleCourseInfo
,
'editSingleCourseInfo'
);
const
menu
=
(
<
Menu
>
<
Menu
.
Item
key
=
"0"
>
...
...
@@ -869,6 +893,7 @@ class StaticCenter extends React.Component {
list
=
{
courseList
}
total
=
{
courseListTotal
}
toManageCourse
=
{
this
.
toManageCourse
}
uEditorSingleChange
=
{
this
.
uEditorSingleChange
}
// allList={allCourseList}
// allTotal={allCourseListTotal}
toAddCourse
=
{
this
.
toAddCourse
}
...
...
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