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
e89891cd
Commit
e89891cd
authored
Nov 26, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
''
parent
51a52df4
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
292 additions
and
11 deletions
+292
-11
index.html
index.html
+1
-1
onlineclasses.js
src/models/onlineclasses.js
+10
-0
CourseDetail.js
src/pages/coursegather/detail/CourseDetail.js
+4
-3
CourseDetail.less
src/pages/coursegather/detail/CourseDetail.less
+2
-1
ChangePsdModal.js
src/pages/onlineclasses/ChangePsdModal.js
+119
-0
CourseDetail.js
src/pages/onlineclasses/singleclass/CourseDetail.js
+5
-3
CourseDetail.less
src/pages/onlineclasses/singleclass/CourseDetail.less
+2
-1
index.js
src/pages/onlineclasses/singleclass/index.js
+144
-2
singleDetail.js
src/pages/onlineclasses/singleclass/singleDetail.js
+5
-0
No files found.
index.html
View file @
e89891cd
...
...
@@ -17,6 +17,6 @@
</head>
<body>
<div
id=
"root"
></div>
<script
src=
"dist/main.js?15747
39446435
"
charset=
"utf-8"
></script>
<script
src=
"dist/main.js?15747
53959867
"
charset=
"utf-8"
></script>
</body>
</html>
\ No newline at end of file
src/models/onlineclasses.js
View file @
e89891cd
...
...
@@ -37,6 +37,8 @@ export default {
study_count
:
''
,
status
:
''
,
content
:
''
,
is_encrypt
:
1
,
password
:
''
,
},
addLoading
:
false
,
editLoading
:
false
,
...
...
@@ -323,6 +325,7 @@ export default {
title
:
data
.
data
.
title
,
start_time
:
data
.
data
.
start_time
,
charge_type
:
data
.
data
.
charge_type
,
is_encrypt
:
data
.
data
.
is_encrypt
,
created_at
:
data
.
data
.
created_at
,
type
:
data
.
data
.
type
,
intro
:
data
.
data
.
intro
&&
data
.
data
.
intro
!=
null
?
JSON
.
parse
(
data
.
data
.
intro
)
:
addCourseObj
.
intro
,
...
...
@@ -332,6 +335,7 @@ export default {
cover
:
data
.
data
.
cover
,
audio
:
data
.
data
.
audio
,
content
:
data
.
data
.
content
,
password
:
data
.
data
.
password
,
},
coursewareInfo
:
JSON
.
parse
(
data
.
data
.
content
),
},
...
...
@@ -1044,6 +1048,12 @@ export default {
id
:
addCourseObj
.
id
,
},
});
yield
put
({
type
:
'selectCourseList'
,
payload
:
{
params
:
{},
},
});
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
...
...
src/pages/coursegather/detail/CourseDetail.js
View file @
e89891cd
...
...
@@ -301,11 +301,12 @@ class CourseDetailForm extends React.Component {
<
span
className
=
"ant-form-text"
>
设置学习人数基数,让学员更有东西学习喔
<
/span
>
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"课程类型"
>
<
div
className
=
{
pageStyle
.
courseType
}
>
免费
<
/div
>
<
div
className
=
{
pageStyle
.
courseType
}
>
{
addCourseObj
.
is_encrypt
==
1
?
'加密'
:
'未加密'
}
<
/div
>
<
span
className
=
"hreflink"
style
=
{{
marginLeft
:
'10px'
}}
>
修改
<
/span
>
{
/* <span className={pageStyle.typeEdit}>点击修改</span> */
}
{
/* <span className="ant-form-text">有人报名则无法修改课程类型</span> */
}
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"语音介绍"
>
{
/*
<FormItem {...formItemModalLineLayout} label="语音介绍">
{
addCourseObj.audio ?
<div className={pageStyle.voice}>
...
...
@@ -322,7 +323,7 @@ class CourseDetailForm extends React.Component {
/>
</div>
}
<
/FormItem
>
</FormItem>
*/
}
<
FormItem
{...
formItemModalLineLayout
}
label
=
"课程介绍"
>
<
ThemeEditor
commentParams
=
{
addCourseObj
}
...
...
src/pages/coursegather/detail/CourseDetail.less
View file @
e89891cd
...
...
@@ -106,7 +106,8 @@
}
.courseType {
display: inline-block;
width: 37px;
// width: 37px;
padding: 0 5px;
height: 21px;
border: 1px solid #FF9D02;
color: #FF9D02;
...
...
src/pages/onlineclasses/ChangePsdModal.js
0 → 100644
View file @
e89891cd
import
{
connect
}
from
'dva'
;
import
React
from
'react'
;
import
{
Form
,
Input
,
Modal
,
Checkbox
,
}
from
'antd'
;
import
pageStyle
from
'./ThemeEditor.less'
;
import
{
pageIn
,
hasBtnPower
,
imagify
,
ossVideofy
}
from
'../../utils/index'
;
const
FormItem
=
Form
.
Item
;
const
{
TextArea
}
=
Input
;
class
ChangePsdModal
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
};
}
componentDidMount
()
{
// 挂载
}
componentDidUpdate
()
{
}
componentWillUnmount
()
{
// 卸载
}
close
=
()
=>
{
const
{
close
}
=
this
.
props
;
close
();
}
save
=
(
e
)
=>
{
const
{
save
,
form
}
=
this
.
props
;
e
.
preventDefault
();
this
.
props
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
const
{
is_encrypt
,
password
,
}
=
values
;
save
({
is_encrypt
,
password
,
callBack
:
()
=>
{
form
.
resetFields
();
},
});
}
});
}
render
()
{
const
{
visible
,
form
:
{
getFieldDecorator
,
getFieldValue
},
record
,
replyLoading
,
info
,
}
=
this
.
props
;
const
formItemModalLineLayout
=
{
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
3
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
20
},
},
};
return
(
<
Modal
visible
=
{
false
}
maskClosable
=
{
false
}
zIndex
=
{
110
}
width
=
{
600
}
bodyStyle
=
{{
padding
:
'40px 20px'
,
}}
title
=
"回复"
closable
=
{
false
}
onCancel
=
{
this
.
close
}
okText
=
"保存"
cancelText
=
"取消"
confirmLoading
=
{
replyLoading
}
onOk
=
{
this
.
save
}
>
<
Form
className
=
{
pageStyle
.
modalform
}
labelAlign
=
"left"
onSubmit
=
{
this
.
save
}
>
<
FormItem
>
{
getFieldDecorator
(
'is_encrypt'
,
{
valuePropName
:
'checked'
,
initialValue
:
info
.
is_encrypt
==
1
,
})(
<
Checkbox
><
span
className
=
{
pageStyle
.
tip
}
>
设置密码
<
/span></
Checkbox
>
)}
<
/FormItem
>
{
Number
(
getFieldValue
(
'is_encrypt'
))
===
1
?
<
FormItem
{...
formItemModalLineLayout
}
>
{
getFieldDecorator
(
'password'
,
{
initialValue
:
info
.
password
,
rules
:
[
{
required
:
true
,
message
:
'请输入4-8位数字密码'
,
pattern
:
new
RegExp
(
/^
\d{4,8}
$/
,
'g'
),
},
],
})(
<
Input
style
=
{{
width
:
200
}}
maxLength
=
{
8
}
placeholder
=
"请输入4-8位数字密码"
/>
,
)}
<
/FormItem> : '
'
}
<
/Form
>
<
/Modal
>
);
}
}
ChangePsdModal
.
propTypes
=
{
};
const
ChangePsdModalForm
=
Form
.
create
()(
ChangePsdModal
);
export
default
connect
()(
ChangePsdModalForm
);
src/pages/onlineclasses/singleclass/CourseDetail.js
View file @
e89891cd
...
...
@@ -302,6 +302,7 @@ class CourseDetailForm extends React.Component {
const
selectBefore
=
(
<
div
>
{
title
.
length
+
textLength
}
/40</
div
>
);
console
.
log
(
addCourseObj
,
'addCourseObj'
);
return
(
<
div
className
=
{
pageStyle
.
container
}
>
<
Form
hideRequiredMark
className
=
{
pageStyle
.
modalform
}
labelAlign
=
"left"
onSubmit
=
{
this
.
save
}
>
...
...
@@ -370,7 +371,8 @@ class CourseDetailForm extends React.Component {
<
span
className
=
"ant-form-text"
>
设置学习人数基数,让学员更有东西学习喔
<
/span
>
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"课程类型"
>
<
div
className
=
{
pageStyle
.
courseType
}
>
免费
<
/div
>
<
div
className
=
{
pageStyle
.
courseType
}
>
{
addCourseObj
.
is_encrypt
==
1
?
'加密'
:
'未加密'
}
<
/div
>
<
span
className
=
"hreflink"
style
=
{{
marginLeft
:
'10px'
}}
>
修改
<
/span
>
{
/* <span className={pageStyle.typeEdit}>点击修改</span> */
}
{
/* <span className="ant-form-text">有人报名则无法修改课程类型</span> */
}
<
/FormItem
>
...
...
@@ -393,7 +395,7 @@ class CourseDetailForm extends React.Component {
{
/* <span>课件:</span> */
}
{
/* <span>{(coursewareInfo.properties && coursewareInfo.properties.name) || '无'}</span> */
}
{
/* </div> */
}
<
FormItem
{...
formItemModalLineLayout
}
label
=
"语音介绍"
>
{
/*
<FormItem {...formItemModalLineLayout} label="语音介绍">
{
addCourseObj.audio ?
<div className={pageStyle.voice}>
...
...
@@ -410,7 +412,7 @@ class CourseDetailForm extends React.Component {
/>
</div>
}
<
/FormItem
>
</FormItem>
*/
}
<
FormItem
{...
formItemModalLineLayout
}
label
=
"课程介绍"
>
<
ThemeEditor
commentParams
=
{
addCourseObj
}
...
...
src/pages/onlineclasses/singleclass/CourseDetail.less
View file @
e89891cd
...
...
@@ -108,7 +108,8 @@
}
.courseType {
display: inline-block;
width: 37px;
// width: 37px;
padding: 0 5px;
height: 21px;
border: 1px solid #FF9D02;
color: #FF9D02;
...
...
src/pages/onlineclasses/singleclass/index.js
View file @
e89891cd
...
...
@@ -18,7 +18,9 @@ import {
}
from
'antd'
;
import
pageStyle
from
'./index.less'
;
import
AddCourseModal
from
'./AddCourseModal'
;
import
{
pageIn
,
hasBtnPower
,
imagify
}
from
'../../../utils'
;
import
{
pageIn
,
hasBtnPower
,
imagify
,
getFileType
}
from
'../../../utils'
;
import
UploadCourseware
from
'../../../components/UploadCourseware'
;
import
MaterialModal
from
'../../../components/MaterialModal'
;
const
{
TabPane
}
=
Tabs
;
const
FormItem
=
Form
.
Item
;
const
{
Option
}
=
Select
;
...
...
@@ -129,6 +131,114 @@ class ClassMgtForm extends React.Component {
},
});
}
toUploadCourseWare
=
(
item
)
=>
{
const
{
addCourseObj
}
=
this
.
props
;
let
content
=
null
;
if
(
item
.
content
&&
JSON
.
parse
(
item
.
content
)
&&
JSON
.
parse
(
item
.
content
).
src
)
{
content
=
JSON
.
parse
(
item
.
content
);
}
else
{
content
=
{};
}
const
{
dispatch
,
coursewareInfo
}
=
this
.
props
;
dispatch
({
type
:
'uploadcourseware/updateState'
,
payload
:
{
visible
:
true
,
info
:
{
...
content
},
},
});
dispatch
({
type
:
'onlineclasses/updateState'
,
payload
:
{
addCourseObj
:
{
...
addCourseObj
,
id
:
item
.
id
,
},
},
});
}
chooseFromCourseMateria
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'onlineclasses/updateState'
,
payload
:
{
materialVisible2
:
true
,
},
});
dispatch
({
type
:
'onlineclasses/querymaterialist'
,
payload
:
{
params
:
{
type
:
''
,
page
:
1
,
perPage
:
20
,
},
},
});
}
materialClose2
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'onlineclasses/updateState'
,
payload
:
{
materialVisible2
:
false
,
},
});
}
delCourseware
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'onlineclasses/updateState'
,
payload
:
{
coursewareInfo
:
{},
},
});
}
materialSave2
=
(
values
)
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
checkValue
}
=
values
;
dispatch
({
type
:
'onlineclasses/updateState'
,
payload
:
{
materialVisible2
:
false
,
},
});
const
content
=
JSON
.
parse
(
checkValue
.
content
);
dispatch
({
type
:
'uploadcourseware/updateState'
,
payload
:
{
info
:
JSON
.
parse
(
JSON
.
stringify
({
properties
:
{
size
:
content
.
size
,
fileType
:
content
.
fileType
,
name
:
content
.
name
,
duration
:
content
.
duration
,
},
images
:
content
.
images
,
src
:
checkValue
.
src
,
fileType
:
content
.
fileType
,
type
:
getFileType
(
content
.
fileType
).
filetype
,
mediaType
:
getFileType
(
content
.
fileType
).
fileSmalltype
,
from
:
'materia'
,
})),
},
});
// dispatch({
// type: 'onlineclasses/updateCover',
// payload: {
// values,
// },
// });
}
uploadCourseware
=
(
values
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'onlineclasses/uploadCourseware'
,
payload
:
{
info
:
{
...
values
},
},
});
}
render
()
{
const
{
form
:
{
getFieldDecorator
,
getFieldValue
},
...
...
@@ -136,6 +246,11 @@ class ClassMgtForm extends React.Component {
courseList
,
courseListTotal
,
courseListParams
,
coursewareSubmitting
,
materialVisible2
,
materiaList
,
queryParams
,
materiaListTotal
,
}
=
this
.
props
;
return
(
<
div
className
=
{
pageStyle
.
container
}
>
...
...
@@ -191,7 +306,7 @@ class ClassMgtForm extends React.Component {
<
div
>
<
div
className
=
{
pageStyle
.
itemTime
}
>
{
item
.
created_at
}
<
/div
>
<
div
>
<
span
className
=
"hreflink"
style
=
{{
paddingRight
:
'20px'
,
color
:
'#2194FF'
,
lineHeight
:
1
}}
>
上传课件
<
/span
>
<
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
>
<
span
className
=
"hreflink"
style
=
{{
color
:
'#2194FF'
,
lineHeight
:
1
}}
onClick
=
{()
=>
this
.
goEditCourse
(
item
.
id
)}
>
管理课程
<
/span
>
<
/div
>
<
/div
>
...
...
@@ -220,6 +335,21 @@ class ClassMgtForm extends React.Component {
visible
=
{
courseVisible
}
close
=
{
this
.
addCourseClose
}
/
>
<
UploadCourseware
callback
=
{
this
.
uploadCourseware
}
delCourseware
=
{
this
.
delCourseware
}
chooseFromCourseMateria
=
{
this
.
chooseFromCourseMateria
}
loading
=
{
coursewareSubmitting
}
/
>
<
MaterialModal
visible
=
{
materialVisible2
}
close
=
{
this
.
materialClose2
}
list
=
{
materiaList
}
queryParams
=
{
queryParams
}
total
=
{
materiaListTotal
}
changePagination
=
{
this
.
changeListPagination2
}
save
=
{
this
.
materialSave2
}
/
>
<
/div
>
);
}
...
...
@@ -235,12 +365,24 @@ function mapStateToProps(state) {
courseList
,
courseListTotal
,
courseListParams
,
coursewareSubmitting
,
materialVisible2
,
materiaList
,
queryParams
,
materiaListTotal
,
addCourseObj
,
}
=
state
.
onlineclasses
;
return
{
courseVisible
,
courseList
,
courseListTotal
,
courseListParams
,
coursewareSubmitting
,
materialVisible2
,
materiaList
,
queryParams
,
materiaListTotal
,
addCourseObj
,
};
}
export
default
connect
(
mapStateToProps
)(
ClassMgt
);
...
...
src/pages/onlineclasses/singleclass/singleDetail.js
View file @
e89891cd
...
...
@@ -24,6 +24,7 @@ import CommentList from './CommentList';
import
StaticBox
from
'./StaticBox'
;
import
UploadCourseware
from
'../../../components/UploadCourseware'
;
import
MaterialModal
from
'../../../components/MaterialModal'
;
import
ChangePsdModal
from
'../ChangePsdModal'
;
const
{
TabPane
}
=
Tabs
;
const
FormItem
=
Form
.
Item
;
const
{
Option
}
=
Select
;
...
...
@@ -216,6 +217,10 @@ class singleDetailForm extends React.Component {
changePagination
=
{
this
.
changeListPagination2
}
save
=
{
this
.
materialSave2
}
/
>
<
ChangePsdModal
visible
info
=
{
addCourseObj
}
/
>
<
/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