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
371d834a
Commit
371d834a
authored
Apr 14, 2020
by
baixian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微官网
parent
699d2bd5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
1169 additions
and
316 deletions
+1169
-316
api.js
src/common/api.js
+4
-2
officialweb.js
src/models/officialweb.js
+362
-95
uploader.js
src/models/uploader.js
+9
-0
RichText.js
src/pages/officialweb/RichText.js
+31
-15
RichText.less
src/pages/officialweb/RichText.less
+11
-10
editor.js
src/pages/officialweb/editor.js
+36
-33
index.js
src/pages/officialweb/index.js
+10
-3
index.less
src/pages/officialweb/index.less
+2
-2
AdCarousel.js
src/pages/officialweb/pagecomponent/AdCarousel.js
+38
-3
AdCarousel.less
src/pages/officialweb/pagecomponent/AdCarousel.less
+9
-32
AdCarouselEditor.js
src/pages/officialweb/pagecomponent/AdCarouselEditor.js
+1
-1
BannerEditor.js
src/pages/officialweb/pagecomponent/BannerEditor.js
+19
-2
BannerEditor.less
src/pages/officialweb/pagecomponent/BannerEditor.less
+23
-3
ClassMoments.js
src/pages/officialweb/pagecomponent/ClassMoments.js
+45
-3
ClassMoments.less
src/pages/officialweb/pagecomponent/ClassMoments.less
+51
-0
ClassMomentsEditor.js
src/pages/officialweb/pagecomponent/ClassMomentsEditor.js
+9
-3
OnlineClass.js
src/pages/officialweb/pagecomponent/OnlineClass.js
+45
-3
OnlineClass.less
src/pages/officialweb/pagecomponent/OnlineClass.less
+60
-0
SchoolIntro.js
src/pages/officialweb/pagecomponent/SchoolIntro.js
+54
-3
SchoolIntro.less
src/pages/officialweb/pagecomponent/SchoolIntro.less
+32
-0
SchoolIntroEditor.js
src/pages/officialweb/pagecomponent/SchoolIntroEditor.js
+1
-3
StudentClock.js
src/pages/officialweb/pagecomponent/StudentClock.js
+16
-2
StudentClock.less
src/pages/officialweb/pagecomponent/StudentClock.less
+7
-4
Teacher.js
src/pages/officialweb/pagecomponent/Teacher.js
+45
-3
Teacher.less
src/pages/officialweb/pagecomponent/Teacher.less
+75
-0
TeacherEditor.js
src/pages/officialweb/pagecomponent/TeacherEditor.js
+34
-77
TeacherEditor.less
src/pages/officialweb/pagecomponent/TeacherEditor.less
+4
-2
TogetherClock.js
src/pages/officialweb/pagecomponent/TogetherClock.js
+43
-3
TogetherClock.less
src/pages/officialweb/pagecomponent/TogetherClock.less
+60
-0
TogetherClockEditor.js
src/pages/officialweb/pagecomponent/TogetherClockEditor.js
+1
-1
officialweb.js
src/services/officialweb.js
+15
-0
webpack.base.config.js
webpackconfig/webpack.base.config.js
+6
-6
webpack.dll.config.js
webpackconfig/webpack.dll.config.js
+1
-0
webpack.pro.config.js
webpackconfig/webpack.pro.config.js
+5
-1
webpack.test.config.js
webpackconfig/webpack.test.config.js
+5
-1
No files found.
src/common/api.js
View file @
371d834a
...
...
@@ -128,10 +128,12 @@ export default {
adsSave
:
`
${
dakaapi
}
member/website/ad/save`
,
moments
:
`
${
dakaapi
}
member/website/moments`
,
momentSave
:
`
${
dakaapi
}
member/website/moment/save`
,
onlineClass
:
`
${
dakaapi
}
member/website/online_course`
,
onlineClass
:
`
${
dakaapi
}
member/website/online_course
s
`
,
onlineClassSave
:
`
${
dakaapi
}
member/website/online_course/save`
,
subjectMixture
:
`
${
dakaapi
}
member/website/subject_mixture`
,
subjectMixture
:
`
${
dakaapi
}
member/website/subject_mixture
s
`
,
subjectMixtureSave
:
`
${
dakaapi
}
member/website/subject_mixture/save`
,
teacher
:
`
${
dakaapi
}
member/website/teachers`
,
teacherSave
:
`
${
dakaapi
}
member/website/teacher/save`
,
},
schedule
:
`
${
dakaapi
}
member/erp/schedules`
,
scheduleMgt
:
{
...
...
src/models/officialweb.js
View file @
371d834a
This diff is collapsed.
Click to expand it.
src/models/uploader.js
View file @
371d834a
...
...
@@ -175,6 +175,7 @@ export default {
adCarousel
,
classMoment
,
schoolIntro
,
teachers
,
}
=
yield
select
(
state
=>
state
.
officialweb
);
const
{
cropperUrl
,
filename
,
uploadtype
,
orgType
,
orgIndex
,
imgIndex
,
action
,
...
...
@@ -276,6 +277,14 @@ export default {
},
});
}
}
else
if
(
uploadtype
==
'uploadTeacherAvatar'
)
{
teachers
[
imgIndex
].
avatar
=
`
${
filename
}
?x-oss-process=
${
cropperUrl
}
`
;
yield
put
({
type
:
'officialweb/updateState'
,
payload
:
{
teachers
:
[...
teachers
],
},
});
}
},
*
unloadstates
({
payload
},
{
call
,
put
})
{
// 释放该页面存储的所有状态
...
...
src/pages/officialweb/RichText.js
View file @
371d834a
import
React
from
'react'
;
import
{
Modal
,
Icon
}
from
'antd'
;
import
{
Modal
,
Icon
,
message
}
from
'antd'
;
import
BraftEditor
from
'braft-editor'
;
import
pageStyle
from
'./RichText.less'
;
import
api
from
'../../common/api'
;
import
{
getRandomFilename
,
LocalStorage
}
from
'../../utils'
;
// eslint-disable-next-line import/first
class
RichText
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
@@ -12,11 +11,6 @@ class RichText extends React.Component {
};
}
componentDidMount
()
{
// 挂载
// let { editorValue } = this.props;
// setTimeout(() => {
// // eslint-disable-next-line no-const-assign
// editorValue = BraftEditor.createEditorState(editorValue);
// }, 1000);
}
componentWillUnmount
()
{
// 卸载
...
...
@@ -25,8 +19,12 @@ class RichText extends React.Component {
const
formData
=
new
FormData
();
const
{
sid
}
=
this
.
props
;
const
user
=
LocalStorage
.
getItem
(
'user'
);
console
.
log
(
param
.
file
,
'param.file'
);
formData
.
append
(
'file'
,
param
.
file
);
if
(
param
.
file
&&
param
.
file
.
size
>
1000
*
1024
*
1024
)
{
param
.
error
({
msg
:
'视频或者图片大小不能超过1GB,请重新上传'
,
});
return
;
}
const
res
=
await
fetch
(
`
${
api
.
imgupload
}
?school_id=
${
sid
}
`
,
{
method
:
'GET'
,
headers
:
{
...
...
@@ -61,6 +59,15 @@ class RichText extends React.Component {
console
.
log
(
res2
,
'res21111111'
);
param
.
success
({
url
:
`
${
host
}
/
${
filename
}
`
,
meta
:
{
loop
:
true
,
// 指定音视频是否循环播放
autoPlay
:
true
,
// 指定音视频是否自动播放
controls
:
false
,
// 指定音视频是否显示控制栏
},
});
}
else
{
param
.
error
({
msg
:
'上传错误'
,
});
}
}
...
...
@@ -74,12 +81,20 @@ class RichText extends React.Component {
editorValue
,
}
=
this
.
props
;
const
controls
=
[
'undo'
,
'redo'
,
'separator'
,
'font-size'
,
'line-height'
,
'letter-spacing'
,
'separator'
,
'undo'
,
'redo'
,
'separator'
,
'headings'
,
'font-size'
,
'line-height'
,
'text-color'
,
'bold'
,
'italic'
,
'underline'
,
'strike-through'
,
'separator'
,
'remove-styles'
,
'emoji'
,
'separator'
,
'text-align'
,
'headings'
,
'list-ul'
,
'list-ol'
,
'separator'
,
'hr'
,
'media'
,
'separator'
,
'clear'
,
'remove-styles'
,
'separator'
,
'text-align'
,
'separator'
,
'hr'
,
'media'
,
'separator'
,
'clear'
,
];
const
accepts
=
{
audio
:
false
,
};
const
imageControls
=
[
'float-left'
,
'float-right'
,
'size'
,
'remove'
,
];
console
.
log
(
editorValue
,
'editorValue'
);
const
newValue
=
BraftEditor
.
createEditorState
(
editorValue
);
...
...
@@ -87,10 +102,11 @@ class RichText extends React.Component {
<
div
className
=
{
pageStyle
.
container
}
>
<
BraftEditor
contentStyle
=
{{
height
:
210
,
boxShadow
:
'inset 0 1px 3px rgba(0,0,0,.1)'
}}
media
=
{{
uploadFn
:
this
.
myUploadFn
}}
media
=
{{
uploadFn
:
this
.
myUploadFn
,
accepts
}}
controls
=
{
controls
}
onChange
=
{
this
.
handleChangeEditor
}
value
=
{
newValue
}
imageControls
=
{
imageControls
}
/
>
<
/div
>
);
...
...
src/pages/officialweb/RichText.less
View file @
371d834a
.container {
:global {
}
}
:global {
.bf-controlbar {
margin: 0;
...
...
@@ -873,6 +870,7 @@
width: 640px;
max-width: 80vw;
height: auto;
max-height: 80vh;
margin: 0 10px 10px;
object-fit: contain
}
...
...
@@ -1140,7 +1138,8 @@
color: hsla(0,0%,100%,.5);
font-size: 12px;
font-weight: 400;
text-align: center
text-align: center;
opacity: 0;
}
.bf-player-holder .bf-poster {
...
...
@@ -1474,7 +1473,7 @@
}
.headings-dropdown {
min-width:
11
0px
min-width:
8
0px
}
.headings-dropdown .menu {
...
...
@@ -1778,7 +1777,7 @@
}
.bf-font-size-dropdown {
min-width:
95
px
min-width:
80
px
}
.bf-font-sizes {
...
...
@@ -1815,7 +1814,7 @@
}
.bf-line-height-dropdown {
min-width:
95
px
min-width:
80
px
}
.bf-line-heights {
...
...
@@ -1912,7 +1911,7 @@
}
.bf-letter-spacing-dropdown {
min-width:
95
px
min-width:
80
px
}
.bf-letter-spacings {
...
...
@@ -1947,5 +1946,7 @@
.bf-letter-spacings li.active {
background-color: #3498db
}
.braft-finder .bf-toggle-external-form {
display: none;
}
}
src/pages/officialweb/editor.js
View file @
371d834a
This diff is collapsed.
Click to expand it.
src/pages/officialweb/index.js
View file @
371d834a
...
...
@@ -97,6 +97,7 @@ class Officialweb extends React.Component {
moduleSelect
,
cropperboxShow
,
course
,
schoolInfo
,
}
=
this
.
props
;
let
renderDom
;
const
newPageInfo
=
pageInfo
;
...
...
@@ -149,7 +150,8 @@ class Officialweb extends React.Component {
key
=
{
ele
.
type
}
>
<
AdCarousel
banner
=
{
ele
.
data
}
data
=
{
ele
.
data
}
schoolInfo
=
{
schoolInfo
}
/
>
<
/div
>
<
/div
>
...
...
@@ -164,6 +166,7 @@ class Officialweb extends React.Component {
>
<
StudentClock
clockList
=
{
ele
.
data
}
schoolInfo
=
{
schoolInfo
}
/
>
<
/div
>
<
/div
>
...
...
@@ -177,7 +180,8 @@ class Officialweb extends React.Component {
key
=
{
ele
.
type
}
>
<
ClassMoments
banner
=
{
ele
.
data
}
data
=
{
ele
.
data
}
schoolInfo
=
{
schoolInfo
}
/
>
<
/div
>
<
/div
>
...
...
@@ -191,7 +195,8 @@ class Officialweb extends React.Component {
key
=
{
ele
.
type
}
>
<
SchoolIntro
orgdescs
=
{
ele
.
data
}
data
=
{
ele
.
data
}
schoolInfo
=
{
schoolInfo
}
/
>
<
/div
>
<
/div
>
...
...
@@ -248,6 +253,7 @@ function mapStateToProps(state) {
pageInfo
,
moduleSelect
,
course
,
schoolInfo
,
}
=
state
.
officialweb
;
const
{
cropperboxShow
,
...
...
@@ -261,6 +267,7 @@ function mapStateToProps(state) {
avatorUploader
,
uploadImgUrl
,
course
,
schoolInfo
,
};
}
export
default
connect
(
mapStateToProps
)(
Officialweb
);
...
...
src/pages/officialweb/index.less
View file @
371d834a
...
...
@@ -69,11 +69,11 @@
position: relative;
}
.editbox {
width: 6
2
0px;
width: 6
9
0px;
background-color: #F9F9F9;
border-radius: 10px;
position: absolute;
right: -
68
0px;
right: -
75
0px;
top: 0;
border:1px solid rgba(235,235,235,1);
}
...
...
src/pages/officialweb/pagecomponent/AdCarousel.js
View file @
371d834a
import
React
from
'react'
;
import
{
connect
}
from
'dva'
;
import
{
Carousel
,
Icon
}
from
'antd'
;
import
{
Carousel
,
Icon
,
Switch
,
Empty
}
from
'antd'
;
import
PageStyle
from
'./AdCarousel.less'
;
import
{
ossVideofy
,
imagify
,
videoPoster
}
from
'../../../utils/index'
;
class
adCarousel
extends
React
.
Component
{
...
...
@@ -13,11 +13,46 @@ class adCarousel extends React.Component {
}
componentWillUnmount
()
{
}
handleChangeSwitch
=
(
e
,
key
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/handleChangeSwitch'
,
payload
:
{
e
,
key
,
},
});
}
render
()
{
const
{
banner
}
=
this
.
props
;
const
{
data
,
schoolInfo
}
=
this
.
props
;
console
.
log
(
schoolInfo
,
'schoolInfo'
);
return
(
<
div
className
=
{
PageStyle
.
Bannercontainer
}
>
广告轮播
<
div
className
=
{
PageStyle
.
switchWrap
}
>
<
Switch
checked
=
{
schoolInfo
.
module_switch
&&
schoolInfo
.
module_switch
.
adCarousel
}
checkedChildren
=
"开"
unCheckedChildren
=
"关"
onChange
=
{
e
=>
this
.
handleChangeSwitch
(
e
,
'adCarousel'
)}
/
>
<
/div
>
<
div
className
=
{
PageStyle
.
carouselWrap
}
>
{
data
.
length
>
0
?
<
Carousel
autoplay
>
{
data
.
map
((
item
,
index
)
=>
{
return
(
<
img
className
=
{
PageStyle
.
img
}
src
=
{
imagify
(
item
.
cover
)}
alt
=
""
/>
);
})
}
<
/Carousel
>
:
<
Empty
image
=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description
=
"还没有配置广告呢"
/>
}
<
/div
>
<
/div
>
);
}
...
...
src/pages/officialweb/pagecomponent/AdCarousel.less
View file @
371d834a
@import '../../../less/variables.less';
@images: '@{imagesroot}/webapp/';
.Bannercontainer {
padding: 6px 12px 6px;
.switchWrap {
margin: 10px 0;
}
.videobox {
position: relative;
}
.videoPoster {
display: block;
position: relative;
z-index: 1;
.carouselWrap {
width: 100%;
border-radius: 5px;
}
.playicon {
position: absolute;
width: 42px;
height: 49px;
left: 50%;
top: 50%;
margin-left: -21px;
margin-top: -24px;
z-index: 2;
}
.swiperbox {
height: 123px;
.img {
width: 100%;
height: 123px;
object-fit: cover;
}
}
.emptyBanner {
height: 200px;
text-align: center;
display: flex;
align-items: center;
background-color: #dedede;
justify-content: center;
}
\ No newline at end of file
src/pages/officialweb/pagecomponent/AdCarouselEditor.js
View file @
371d834a
...
...
@@ -179,7 +179,7 @@ class AdCarouselEditor extends React.Component {
{
adCarousel
.
length
>
0
&&
adCarousel
.
map
((
item
,
index
)
=>
{
return
(
<
div
className
=
{
PageStyle
.
formItem
}
>
<
div
className
=
{
PageStyle
.
formItem
}
key
=
{
item
.
id
}
>
<
div
className
=
{
PageStyle
.
formLeft
}
>
{
index
==
0
&&
<
div
className
=
{
`
${
PageStyle
.
formItemIcon
}
${
PageStyle
.
formItemIconGray
}
`
}
><
Icon
className
=
{
PageStyle
.
itemIcon
}
type
=
"arrow-up"
/><
/div>
}
{
index
>
0
&&
<
div
className
=
{
PageStyle
.
formItemIcon
}
onClick
=
{()
=>
this
.
moveAdCarouselPlate
(
index
,
'up'
)}
><
Icon
className
=
{
PageStyle
.
itemIcon
}
type
=
"arrow-up"
/><
/div>
}
...
...
src/pages/officialweb/pagecomponent/BannerEditor.js
View file @
371d834a
import
React
from
'react'
;
import
{
connect
}
from
'dva'
;
import
{
Form
,
Layout
,
Input
,
Button
,
Icon
}
from
'antd'
;
import
{
Form
,
Layout
,
Input
,
Button
,
Icon
,
Progress
}
from
'antd'
;
import
{
videoPoster
,
imagify
}
from
'../../../utils/index'
;
import
PageStyle
from
'./BannerEditor.less'
;
const
FormItem
=
Form
.
Item
;
...
...
@@ -62,6 +62,14 @@ class BannerEditor extends React.Component {
payload
:
{
files
:
e
.
target
,
uploadtype
:
'banner'
,
progressCallBack
(
res
)
{
dispatch
({
type
:
'officialweb/updateState'
,
payload
:
{
progressRate
:
((
res
.
loaded
/
res
.
total
)
*
100
).
toFixed
(
0
),
},
});
},
},
});
}
...
...
@@ -112,9 +120,16 @@ class BannerEditor extends React.Component {
render
()
{
const
{
bannerType
,
banner
,
bannerVideo
,
bannerImg
,
bannerPostStatus
,
progressRate
,
}
=
this
.
props
;
return
(
<
div
className
=
{
`
${
PageStyle
.
SchoolInfoEditorcontainer
}
SchoolInfoEditorcontainer`
}
>
{
progressRate
&&
progressRate
>
0
?
<
div
className
=
{
PageStyle
.
progressWrap
}
>
<
Progress
width
=
{
150
}
type
=
"circle"
percent
=
{
Number
(
progressRate
)}
/
>
<
p
>
{
progressRate
==
100
?
'上传成功'
:
'上传中。。。'
}
<
/p
>
<
/div> : '
'
}
<
div
className
=
{
PageStyle
.
header
}
>
品牌视频
/
轮播
<
/div
>
<
Form
className
=
{
PageStyle
.
FormBox
}
onSubmit
=
{
this
.
handleSubmit
}
>
<
div
className
=
{
PageStyle
.
selfradiabox
}
>
...
...
@@ -175,7 +190,7 @@ class BannerEditor extends React.Component {
}
{
bannerVideo
.
length
==
0
&&
<
div
className
=
{
PageStyle
.
fileuploadbox
}
>
<
input
type
=
"file"
id
=
"upload
input
"
className
=
{
PageStyle
.
fileuploadinput
}
onChange
=
{(
e
)
=>
{
this
.
uploadBannerVideo
(
e
);
}}
accept
=
"video/mp4,video/*"
/>
<
input
type
=
"file"
id
=
"upload
Common
"
className
=
{
PageStyle
.
fileuploadinput
}
onChange
=
{(
e
)
=>
{
this
.
uploadBannerVideo
(
e
);
}}
accept
=
"video/mp4,video/*"
/>
<
div
className
=
{
PageStyle
.
fileuploadlayer
}
>
<
div
className
=
{
PageStyle
.
uploadtext
}
>
点击上传
<
/div
>
<
/div
>
...
...
@@ -202,12 +217,14 @@ function mapStateToProps(state) {
bannerVideo
,
bannerImg
,
bannerPostStatus
,
progressRate
,
}
=
state
.
officialweb
;
return
{
bannerType
,
bannerVideo
,
bannerImg
,
bannerPostStatus
,
progressRate
,
};
}
export
default
connect
(
mapStateToProps
)(
BannerEditor
);
src/pages/officialweb/pagecomponent/BannerEditor.less
View file @
371d834a
@import '../../../less/variables.less';
@images: '@{imagesroot}/webapp/';
.SchoolInfoEditorcontainer {
}
.header {
color: #000;
...
...
@@ -153,7 +153,7 @@
background-color: #fff;
margin-right: 24px;
display: flex;
flex-direction: column;
flex-direction: column;
overflow: hidden;
}
.blockOperateItem {
...
...
@@ -207,4 +207,24 @@
.imgupdate {
flex: 1;
text-align: center;
}
\ No newline at end of file
}
.progressWrap {
width: 300px;
height: 300px;
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #f1f1f1;
border-radius: 15px;
z-index: 9999;
&>p {
font-size: 18px;
margin-top: 30px;
color: #1e8bff;
}
}
src/pages/officialweb/pagecomponent/ClassMoments.js
View file @
371d834a
import
React
from
'react'
;
import
{
connect
}
from
'dva'
;
import
{
Carousel
,
Icon
}
from
'antd'
;
import
{
Carousel
,
Empty
,
Icon
,
Switch
,
Tooltip
}
from
'antd'
;
import
PageStyle
from
'./ClassMoments.less'
;
import
{
ossVideofy
,
imagify
,
videoPoster
}
from
'../../../utils/index'
;
class
ClassMoments
extends
React
.
Component
{
...
...
@@ -13,11 +13,53 @@ class ClassMoments extends React.Component {
}
componentWillUnmount
()
{
}
handleChangeSwitch
=
(
e
,
key
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/handleChangeSwitch'
,
payload
:
{
e
,
key
,
},
});
}
render
()
{
const
{
banner
}
=
this
.
props
;
const
{
data
,
schoolInfo
}
=
this
.
props
;
console
.
log
(
data
,
'datadatadatadata'
);
return
(
<
div
className
=
{
PageStyle
.
Bannercontainer
}
>
课堂瞬间
<
div
className
=
{
PageStyle
.
switchWrap
}
>
<
Switch
checked
=
{
schoolInfo
.
module_switch
&&
schoolInfo
.
module_switch
.
classmoments
}
checkedChildren
=
"开"
unCheckedChildren
=
"关"
onChange
=
{
e
=>
this
.
handleChangeSwitch
(
e
,
'classmoments'
)}
/
>
<
/div
>
<
div
className
=
{
PageStyle
.
commonTitle
}
>
<
div
>
课堂瞬间
<
/div
>
<
div
className
=
{
PageStyle
.
right
}
>
更多
<
Icon
type
=
"right"
/><
/div
>
<
/div
>
{
data
.
length
>
0
?
<
div
className
=
{
PageStyle
.
commonList
}
>
{
data
.
map
((
item
,
index
)
=>
{
return
(
<
div
className
=
{
PageStyle
.
commonItem
}
key
=
{
item
.
id
}
>
{
item
.
content
[
0
].
type
==
'img'
&&
<
img
className
=
{
PageStyle
.
img
}
src
=
{
imagify
(
item
.
content
[
0
].
value
)}
alt
=
""
/>
}
{
item
.
content
[
0
].
type
==
'video'
&&
<
video
className
=
{
PageStyle
.
img
}
src
=
{
ossVideofy
(
item
.
content
[
0
].
value
)}
controls
/>
}
<
div
className
=
{
PageStyle
.
imgTip
}
>
{
item
.
title
}
<
/div
>
<
/div
>
);
})
}
<
/div
>
:
<
Empty
image
=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description
=
"暂时没有内容噢~"
/>
}
<
/div
>
);
}
...
...
src/pages/officialweb/pagecomponent/ClassMoments.less
View file @
371d834a
.Bannercontainer {
padding: 10px;
}
.switchWrap {
margin: 10px 0;
}
.commonTitle {
font-size:18px;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:600;
color:rgba(0,0,0,1);
line-height:25px;
display: flex;
justify-content: space-between;
.right {
font-size: 14px;
}
}
.commonList {
display: flex;
align-items: center;
margin-top: 10px;
flex-wrap: wrap;
.commonItem {
display: flex;
align-items: center;
width: 47%;
position: relative;
margin-bottom: 10px;
&:nth-child(2n+1) {
margin-right: 10px;
}
.img {
width: 166px;
height: 240px;
object-fit: cover;
}
.imgTip {
position: absolute;
width: 100%;
height:29px;
background:rgba(0,0,0,0.6);
line-height: 29px;
font-size: 13px;
text-align: center;
bottom: 0;
left: 0;
color: #fff;
}
}
}
src/pages/officialweb/pagecomponent/ClassMomentsEditor.js
View file @
371d834a
...
...
@@ -147,6 +147,12 @@ class ClassMomentsEditor extends React.Component {
classMomentStatus
,
progressRate
,
}
=
this
.
props
;
classMoment
.
forEach
((
item
,
index
)
=>
{
if
(
typeof
(
item
.
content
)
==
'string'
)
{
// eslint-disable-next-line no-param-reassign
item
.
content
=
JSON
.
parse
(
item
.
content
);
}
});
const
formItemLayout
=
{
labelCol
:
{
xs
:
{
span
:
4
},
...
...
@@ -170,7 +176,7 @@ class ClassMomentsEditor extends React.Component {
{
classMoment
.
length
>
0
&&
classMoment
.
map
((
item
,
index
)
=>
{
return
(
<
div
className
=
{
PageStyle
.
formItem
}
>
<
div
className
=
{
PageStyle
.
formItem
}
key
=
{
item
.
id
}
>
<
div
className
=
{
PageStyle
.
formLeft
}
>
{
index
==
0
&&
<
div
className
=
{
`
${
PageStyle
.
formItemIcon
}
${
PageStyle
.
formItemIconGray
}
`
}
><
Icon
className
=
{
PageStyle
.
itemIcon
}
type
=
"arrow-up"
/><
/div>
}
{
index
>
0
&&
<
div
className
=
{
PageStyle
.
formItemIcon
}
onClick
=
{()
=>
this
.
moveClassMomentPlate
(
index
,
'up'
)}
><
Icon
className
=
{
PageStyle
.
itemIcon
}
type
=
"arrow-up"
/><
/div>
}
...
...
@@ -194,7 +200,7 @@ class ClassMomentsEditor extends React.Component {
switch
(
ele
.
type
)
{
case
'img'
:
return
(
<
div
className
=
{
PageStyle
.
imgItem
}
>
<
div
className
=
{
PageStyle
.
imgItem
}
key
=
{
ele
.
type
}
>
<
img
className
=
{
PageStyle
.
img
}
src
=
{
imagify
(
ele
.
value
)}
alt
=
"图片"
/>
<
div
className
=
{
PageStyle
.
closeAdIcon
}
onClick
=
{()
=>
this
.
deleteClassMomentImg
(
index
,
i
)}
>
<
Icon
type
=
"close"
/>
...
...
@@ -203,7 +209,7 @@ class ClassMomentsEditor extends React.Component {
);
case
'video'
:
return
(
<
div
className
=
{
PageStyle
.
imgItem
}
>
<
div
className
=
{
PageStyle
.
imgItem
}
key
=
{
ele
.
type
}
>
<
video
className
=
{
PageStyle
.
img
}
controls
=
"controls"
src
=
{
ossVideofy
(
ele
.
value
)}
/
>
<
div
className
=
{
PageStyle
.
closeAdIcon
}
onClick
=
{()
=>
this
.
deleteClassMomentImg
(
index
,
i
)}
>
<
Icon
type
=
"close"
/>
...
...
src/pages/officialweb/pagecomponent/OnlineClass.js
View file @
371d834a
import
React
from
'react'
;
import
{
connect
}
from
'dva'
;
import
{
Carousel
,
Icon
}
from
'antd'
;
import
{
Carousel
,
Empty
,
Icon
,
Switch
}
from
'antd'
;
import
PageStyle
from
'./OnlineClass.less'
;
import
{
ossVideofy
,
imagify
,
videoPoster
}
from
'../../../utils/index'
;
class
OnlineClass
extends
React
.
Component
{
...
...
@@ -13,11 +13,53 @@ class OnlineClass extends React.Component {
}
componentWillUnmount
()
{
}
handleChangeSwitch
=
(
e
,
key
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/handleChangeSwitch'
,
payload
:
{
e
,
key
,
},
});
}
render
()
{
const
{
banner
}
=
this
.
props
;
const
{
data
,
schoolInfo
}
=
this
.
props
;
return
(
<
div
className
=
{
PageStyle
.
Bannercontainer
}
>
在线课堂
<
div
className
=
{
PageStyle
.
switchWrap
}
>
<
Switch
checked
=
{
schoolInfo
.
module_switch
&&
schoolInfo
.
module_switch
.
onlineclass
}
checkedChildren
=
"开"
unCheckedChildren
=
"关"
onChange
=
{
e
=>
this
.
handleChangeSwitch
(
e
,
'togetherclock'
)}
/
>
<
/div
>
<
div
className
=
{
PageStyle
.
commonTitle
}
>
<
div
>
在线课堂
<
/div
>
<
div
className
=
{
PageStyle
.
right
}
>
更多
<
Icon
type
=
"right"
/><
/div
>
<
/div
>
{
data
.
length
>
0
?
<
div
className
=
{
PageStyle
.
commonList
}
>
{
data
.
map
((
item
,
index
)
=>
{
return
(
<
div
className
=
{
PageStyle
.
commonItem
}
key
=
{
item
.
id
}
>
{
item
.
online_course
.
cover
==
''
?
<
img
className
=
{
PageStyle
.
img
}
src
=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/image/course/courseDefaultImg.png"
alt
=
""
/>
:
<
img
className
=
{
PageStyle
.
img
}
src
=
{
imagify
(
item
.
online_course
.
cover
)}
alt
=
""
/>
}
<
div
className
=
{
PageStyle
.
title
}
>
{
item
.
online_course
.
title
}
<
/div
>
<
div
className
=
{
PageStyle
.
num
}
>
{
item
.
online_course
.
study_count
}
人学习
<
/div
>
<
/div
>
);
})
}
<
/div
>
:
<
Empty
image
=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description
=
"暂时没有内容噢~"
/>
}
<
/div
>
);
}
...
...
src/pages/officialweb/pagecomponent/OnlineClass.less
View file @
371d834a
.Bannercontainer {
padding: 10px;
}
.switchWrap {
margin: 10px 0;
}
.commonTitle {
font-size:18px;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:600;
color:rgba(0,0,0,1);
line-height:25px;
display: flex;
justify-content: space-between;
.right {
font-size: 14px;
}
}
.commonList {
display: flex;
align-items: center;
margin-top: 10px;
flex-wrap: wrap;
.commonItem {
width: 47%;
position: relative;
margin-bottom: 10px;
&:nth-child(2n+1) {
margin-right: 10px;
}
.img {
width: 166px;
height: 111px;
object-fit: cover;
margin-bottom: 10px;
}
.title {
font-size:18px;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(0,0,0,1);
line-height:25px;
display: -webkit-box;
text-overflow: ellipsis;
word-break:break-all;
word-wrap: break-word;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
min-height: 49px;
}
.num {
font-size:14px;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(0,0,0,0.5);
line-height:20px;
}
}
}
src/pages/officialweb/pagecomponent/SchoolIntro.js
View file @
371d834a
import
React
from
'react'
;
import
{
connect
}
from
'dva'
;
import
{
Carousel
,
Icon
}
from
'antd'
;
import
{
Carousel
,
Empty
,
Icon
,
Switch
}
from
'antd'
;
import
PageStyle
from
'./SchoolIntro.less'
;
import
{
ossVideofy
,
imagify
,
videoPoster
}
from
'../../../utils/index'
;
class
SchoolIntro
extends
React
.
Component
{
...
...
@@ -13,11 +13,58 @@ class SchoolIntro extends React.Component {
}
componentWillUnmount
()
{
}
handleChangeSwitch
=
(
e
,
key
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/handleChangeSwitch'
,
payload
:
{
e
,
key
,
},
});
}
render
()
{
const
{
banner
}
=
this
.
props
;
const
{
data
,
schoolInfo
}
=
this
.
props
;
return
(
<
div
className
=
{
PageStyle
.
Bannercontainer
}
>
学校介绍
<
div
className
=
{
PageStyle
.
switchWrap
}
>
<
Switch
checked
=
{
schoolInfo
.
module_switch
&&
schoolInfo
.
module_switch
.
orgdesc
}
checkedChildren
=
"开"
unCheckedChildren
=
"关"
onChange
=
{
e
=>
this
.
handleChangeSwitch
(
e
,
'orgdesc'
)}
/
>
<
/div
>
<
div
className
=
{
PageStyle
.
commonTitle
}
>
学校介绍
<
/div
>
<
div
className
=
{
PageStyle
.
desc
}
>
{
schoolInfo
&&
schoolInfo
.
intro
}
<
/div
>
<
div
className
=
{
PageStyle
.
carouselWrap
}
>
{
data
.
length
>
0
?
<
Carousel
autoplay
>
{
data
.
map
((
item
,
index
)
=>
{
return
(
<
div
>
{
item
.
type
==
1
&&
<
img
className
=
{
PageStyle
.
img
}
src
=
{
imagify
(
item
.
content
)}
alt
=
""
/>
}
{
item
.
type
==
2
&&
<
video
className
=
{
PageStyle
.
img
}
controls
=
"controls"
src
=
{
ossVideofy
(
item
.
content
)}
/
>
}
<
/div
>
);
})
}
<
/Carousel
>
:
<
Empty
image
=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description
=
"还没有配置学校介绍呢"
/>
}
<
/div
>
<
/div
>
);
}
...
...
@@ -29,10 +76,14 @@ function mapStateToProps(state) {
const
{
menus
,
defaultMenu
,
collapsed
,
}
=
state
.
webapp
;
const
{
schoolInfo
,
}
=
state
.
officialweb
;
return
{
menus
,
defaultMenu
,
collapsed
,
schoolInfo
,
};
}
export
default
connect
(
mapStateToProps
)(
SchoolIntro
);
src/pages/officialweb/pagecomponent/SchoolIntro.less
View file @
371d834a
.Bannercontainer {
padding: 10px;
}
.switchWrap {
margin: 10px 0;
}
.commonTitle {
font-size:18px;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:600;
color:rgba(0,0,0,1);
line-height:25px;
}
.desc {
overflow: hidden;
display: -webkit-box;
text-overflow: ellipsis;
word-break:break-all;
word-wrap: break-word;
font-size: 14px;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
.carouselWrap {
width: 100%;
height: 190px;
.img {
width: 100%;
height: 190px;
object-fit: cover;
}
}
src/pages/officialweb/pagecomponent/SchoolIntroEditor.js
View file @
371d834a
...
...
@@ -169,8 +169,6 @@ class SchoolIntroEditor extends React.Component {
sm
:
{
span
:
20
},
},
};
console
.
log
(
schoolInfo
,
'schoolInfo111111111'
);
console
.
log
(
schoolIntro
,
'schoolIntro'
);
return
(
<
div
className
=
{
`
${
PageStyle
.
SchoolInfoEditorcontainer
}
SchoolInfoEditorcontainer`
}
>
{
progressRate
&&
progressRate
>
0
?
...
...
@@ -189,7 +187,7 @@ class SchoolIntroEditor extends React.Component {
{
schoolIntro
.
length
>
0
&&
schoolIntro
.
map
((
item
,
index
)
=>
{
return
(
<
div
className
=
{
PageStyle
.
formItem
}
>
<
div
className
=
{
PageStyle
.
formItem
}
key
=
{
item
}
>
<
div
className
=
{
PageStyle
.
formLeft
}
>
{
index
==
0
&&
<
div
className
=
{
`
${
PageStyle
.
formItemIcon
}
${
PageStyle
.
formItemIconGray
}
`
}
><
Icon
className
=
{
PageStyle
.
itemIcon
}
type
=
"arrow-up"
/><
/div>
}
{
index
>
0
&&
<
div
className
=
{
PageStyle
.
formItemIcon
}
onClick
=
{()
=>
this
.
moveSchoolIntroPlate
(
index
,
'up'
)}
><
Icon
className
=
{
PageStyle
.
itemIcon
}
type
=
"arrow-up"
/><
/div>
}
...
...
src/pages/officialweb/pagecomponent/StudentClock.js
View file @
371d834a
import
React
from
'react'
;
import
{
connect
}
from
'dva'
;
import
{
Carousel
}
from
'antd'
;
import
{
Carousel
,
Switch
}
from
'antd'
;
import
PageStyle
from
'./StudentClock.less'
;
import
{
imagify
,
timeCompare
}
from
'../../../utils'
;
class
StudentClock
extends
React
.
Component
{
...
...
@@ -20,9 +20,20 @@ class StudentClock extends React.Component {
payload
:
key
,
});
}
handleChangeSwitch
=
(
e
,
key
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/handleChangeSwitch'
,
payload
:
{
e
,
key
,
},
});
}
render
()
{
const
{
menus
,
defaultMenu
,
collapsed
,
clockList
,
schoolInfo
,
}
=
this
.
props
;
const
menuItemStyle
=
{
fontSize
:
'16px'
,
...
...
@@ -31,9 +42,12 @@ class StudentClock extends React.Component {
<
div
className
=
{
PageStyle
.
StudentClockcontainer
}
>
<
div
className
=
{
PageStyle
.
headerbox
}
>
<
div
className
=
{
PageStyle
.
headertitle
}
>
学
员
动态
学
生
动态
<
/div
>
<
/div
>
<
div
className
=
{
PageStyle
.
switchWrap
}
>
<
Switch
checked
=
{
schoolInfo
.
module_switch
&&
schoolInfo
.
module_switch
.
clocklist
}
checkedChildren
=
"开"
unCheckedChildren
=
"关"
onChange
=
{
e
=>
this
.
handleChangeSwitch
(
e
,
'clocklist'
)}
/
>
<
/div
>
<
div
className
=
{
PageStyle
.
clockListBox
}
>
{
clockList
.
list
&&
clockList
.
list
.
length
>
0
&&
clockList
.
list
.
map
(
ele
=>
(
<
div
className
=
{
PageStyle
.
clockitem
}
key
=
{
ele
.
id
}
>
...
...
src/pages/officialweb/pagecomponent/StudentClock.less
View file @
371d834a
...
...
@@ -6,14 +6,17 @@
background-size: 100% 100%;
padding: 18px 0 0 12px;
}
.switchWrap {
margin: 10px 0;
}
.headertitle {
width:
61
px;
width:
100
px;
height: 17px;
background-size: 100% 100%;
background-image: url('@{imagesroot}titlebg.png');
color: #010101;
font-weight: 700;
font-size: 1
4
px;
font-size: 1
8
px;
}
.clockListBox {
padding: 0 12px;
...
...
@@ -190,7 +193,7 @@
justify-content: space-around;
}
.bottombtnitem {
// width:
// width:
display: flex;
align-items: center;
cursor: pointer;
...
...
@@ -205,4 +208,4 @@
color: #777E84;
font-size: 12px;
line-height: 1;
}
\ No newline at end of file
}
src/pages/officialweb/pagecomponent/Teacher.js
View file @
371d834a
import
React
from
'react'
;
import
{
connect
}
from
'dva'
;
import
{
Carousel
,
Icon
}
from
'antd'
;
import
{
Carousel
,
Empty
,
Icon
,
Switch
,
Tooltip
}
from
'antd'
;
import
PageStyle
from
'./Teacher.less'
;
import
{
ossVideofy
,
imagify
,
videoPoster
}
from
'../../../utils/index'
;
class
Teacher
extends
React
.
Component
{
...
...
@@ -13,11 +13,53 @@ class Teacher extends React.Component {
}
componentWillUnmount
()
{
}
handleChangeSwitch
=
(
e
,
key
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/handleChangeSwitch'
,
payload
:
{
e
,
key
,
},
});
}
render
()
{
const
{
banner
}
=
this
.
props
;
const
{
data
,
schoolInfo
}
=
this
.
props
;
console
.
log
(
data
,
'data111'
);
return
(
<
div
className
=
{
PageStyle
.
Bannercontainer
}
>
名师风采
<
div
className
=
{
PageStyle
.
switchWrap
}
>
<
Switch
checked
=
{
schoolInfo
.
module_switch
&&
schoolInfo
.
module_switch
.
teacher
}
checkedChildren
=
"开"
unCheckedChildren
=
"关"
onChange
=
{
e
=>
this
.
handleChangeSwitch
(
e
,
'teacher'
)}
/
>
<
/div
>
<
div
className
=
{
PageStyle
.
commonTitle
}
>
<
div
>
名师风采
<
/div
>
<
div
className
=
{
PageStyle
.
right
}
>
更多
<
Icon
type
=
"right"
/><
/div
>
<
/div
>
{
data
.
length
>
0
?
<
div
className
=
{
PageStyle
.
commonList
}
>
{
data
.
map
((
item
,
index
)
=>
{
return
(
<
div
className
=
{
PageStyle
.
commonItem
}
>
<
div
className
=
{
PageStyle
.
commonLeft
}
>
<
img
src
=
{
imagify
(
item
.
avatar
)}
alt
=
""
/>
<
/div
>
<
div
className
=
{
PageStyle
.
commonRight
}
>
<
div
className
=
{
PageStyle
.
commonName
}
>
{
item
.
name
}
<
/div
>
<
div
className
=
{
PageStyle
.
commonDesc
}
><
Tooltip
title
=
{
item
.
course
}
>
{
item
.
course
.
substr
(
0
,
4
)}
<
/Tooltip> {item.seniority}年教龄</
div
>
<
/div
>
<
/div
>
);
})
}
<
/div
>
:
<
Empty
image
=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description
=
"暂时没有内容噢~"
/>
}
<
/div
>
);
}
...
...
src/pages/officialweb/pagecomponent/Teacher.less
View file @
371d834a
.Bannercontainer {
padding: 10px;
}
.switchWrap {
margin: 10px 0;
}
.commonTitle {
font-size:18px;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:600;
color:rgba(0,0,0,1);
line-height:25px;
display: flex;
justify-content: space-between;
.right {
font-size: 14px;
}
}
.desc {
overflow: hidden;
white-space: nowrap;
display: -webkit-box;
text-overflow: ellipsis;
word-break:break-all;
word-wrap: break-word;
font-size: 14px;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
.carouselWrap {
width: 100%;
height: 190px;
.img {
width: 100%;
height: 190px;
object-fit: cover;
}
}
.commonList {
display: flex;
align-items: center;
margin-top: 10px;
.commonItem {
display: flex;
align-items: center;
margin-right: 5px;
.commonLeft {
margin-right: 11px;
&>img {
width: 52px;
height: 52px;
border-radius: 50%;
}
}
.commonName {
font-size:13px;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:600;
color:rgba(0,0,0,1);
max-width: 70px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.commonDesc {
font-size:13px;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(58,58,58,1);
line-height:18px;
display: flex;
align-items: center;
}
}
}
src/pages/officialweb/pagecomponent/TeacherEditor.js
View file @
371d834a
...
...
@@ -39,56 +39,6 @@ class TeacherEditor extends React.Component {
}
componentWillUnmount
()
{
}
uploadAvator
=
(
e
)
=>
{
}
selectedMenu
=
(
key
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'webapp/menuselected'
,
payload
:
key
,
});
}
bannerTypeChoose
=
(
type
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/bannertypechoose'
,
payload
:
{
type
,
},
});
}
delvideo
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/delvideo'
,
});
}
handleSubmit
=
(
e
)
=>
{
const
{
dispatch
}
=
this
.
props
;
e
.
preventDefault
();
dispatch
({
type
:
'officialweb/bannersave'
,
});
}
delbannerimg
=
(
index
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/delbannerimg'
,
payload
:
{
index
,
},
});
}
movebannerimg
=
(
index
,
direction
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/movebannerimg'
,
payload
:
{
index
,
direction
,
},
});
}
handleTeacherPlate
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
...
...
@@ -99,14 +49,14 @@ class TeacherEditor extends React.Component {
element
.
scrollTop
=
element
.
scrollHeight
;
},
200
);
}
upload
AdBanne
r
=
(
e
,
index
)
=>
{
upload
TeacherAvata
r
=
(
e
,
index
)
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
avatorUploader
}
=
this
.
state
;
dispatch
({
type
:
'uploader/queryimgsignature'
,
payload
:
{
files
:
e
.
target
,
uploadtype
:
'upload
AdBanne
r'
,
uploadtype
:
'upload
TeacherAvata
r'
,
avatorUploader
,
imgIndex
:
index
,
},
...
...
@@ -114,19 +64,26 @@ class TeacherEditor extends React.Component {
}
handleChangeTeacherText
=
(
e
,
index
,
key
)
=>
{
const
{
dispatch
}
=
this
.
props
;
let
value
=
''
;
if
(
key
==
'seniority'
)
{
value
=
e
;
}
else
{
// eslint-disable-next-line prefer-destructuring
value
=
e
.
target
.
value
;
}
dispatch
({
type
:
'officialweb/handleChangeTeacherText'
,
payload
:
{
value
:
e
.
target
.
value
,
value
,
index
,
key
,
},
});
}
delete
AdBanne
r
=
(
index
)
=>
{
delete
TeacherAvata
r
=
(
index
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/delete
AdBanne
r'
,
type
:
'officialweb/delete
TeacherAvata
r'
,
payload
:
{
index
,
},
...
...
@@ -141,41 +98,41 @@ class TeacherEditor extends React.Component {
},
});
}
move
AdCarousel
Plate
=
(
index
,
direction
)
=>
{
move
Teacher
Plate
=
(
index
,
direction
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/move
AdCarousel
Plate'
,
type
:
'officialweb/move
Teacher
Plate'
,
payload
:
{
index
,
direction
,
},
});
}
save
AdCarousel
Plate
=
()
=>
{
save
Teacher
Plate
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/save
AdCarousel
Plate'
,
type
:
'officialweb/save
Teacher
Plate'
,
payload
:
{
},
});
}
handleChangeEditor
=
(
editorState
,
index
)
=>
{
const
{
dispatch
}
=
this
.
props
;
//
dispatch({
//
type: 'officialweb/handleChangeEditor',
//
payload: {
//
editorState,
//
index,
//
},
//
});
dispatch
({
type
:
'officialweb/handleChangeEditor'
,
payload
:
{
editorState
,
index
,
},
});
}
render
()
{
const
{
teachers
,
teacherStatus
,
sid
,
editorValue
,
}
=
this
.
props
;
console
.
log
(
teachers
,
'teachersteachersteachers'
);
const
formItemLayout
=
{
labelCol
:
{
xs
:
{
span
:
4
},
...
...
@@ -203,12 +160,12 @@ class TeacherEditor extends React.Component {
{
teachers
.
length
>
0
&&
teachers
.
map
((
item
,
index
)
=>
{
return
(
<
div
className
=
{
PageStyle
.
formItem
}
>
<
div
className
=
{
PageStyle
.
formItem
}
key
=
{
item
.
id
}
>
<
div
className
=
{
PageStyle
.
formLeft
}
>
{
index
==
0
&&
<
div
className
=
{
`
${
PageStyle
.
formItemIcon
}
${
PageStyle
.
formItemIconGray
}
`
}
><
Icon
className
=
{
PageStyle
.
itemIcon
}
type
=
"arrow-up"
/><
/div>
}
{
index
>
0
&&
<
div
className
=
{
PageStyle
.
formItemIcon
}
onClick
=
{()
=>
this
.
move
AdCarousel
Plate
(
index
,
'up'
)}
><
Icon
className
=
{
PageStyle
.
itemIcon
}
type
=
"arrow-up"
/><
/div>
}
{
index
>
0
&&
<
div
className
=
{
PageStyle
.
formItemIcon
}
onClick
=
{()
=>
this
.
move
Teacher
Plate
(
index
,
'up'
)}
><
Icon
className
=
{
PageStyle
.
itemIcon
}
type
=
"arrow-up"
/><
/div>
}
{
index
==
(
teachers
.
length
-
1
)
&&
<
div
className
=
{
`
${
PageStyle
.
formItemIcon
}
${
PageStyle
.
formItemIconGray
}
`
}
><
Icon
className
=
{
PageStyle
.
itemIcon
}
type
=
"arrow-down"
/><
/div>
}
{
index
<
(
teachers
.
length
-
1
)
&&
<
div
className
=
{
PageStyle
.
formItemIcon
}
onClick
=
{()
=>
this
.
move
AdCarousel
Plate
(
index
,
'down'
)}
><
Icon
className
=
{
PageStyle
.
itemIcon
}
type
=
"arrow-down"
/><
/div>
}
{
index
<
(
teachers
.
length
-
1
)
&&
<
div
className
=
{
PageStyle
.
formItemIcon
}
onClick
=
{()
=>
this
.
move
Teacher
Plate
(
index
,
'down'
)}
><
Icon
className
=
{
PageStyle
.
itemIcon
}
type
=
"arrow-down"
/><
/div>
}
<
Popconfirm
placement
=
"topLeft"
title
=
"确定删除?"
...
...
@@ -226,7 +183,7 @@ class TeacherEditor extends React.Component {
item
.
avatar
?
<
React
.
Fragment
>
<
img
src
=
{
imagify
(
item
.
avatar
)}
alt
=
"图片"
/>
<
div
className
=
{
PageStyle
.
closeAdIcon
}
onClick
=
{()
=>
this
.
delete
AdBanne
r
(
index
)}
>
<
div
className
=
{
PageStyle
.
closeAdIcon
}
onClick
=
{()
=>
this
.
delete
TeacherAvata
r
(
index
)}
>
<
Icon
type
=
"close"
/>
<
/div
>
<
/React.Fragment>
:
...
...
@@ -236,18 +193,18 @@ class TeacherEditor extends React.Component {
className
=
{
PageStyle
.
uploadInput
}
accept
=
"image/png, image/jpeg"
id
=
"upload1"
onChange
=
{(
e
)
=>
{
this
.
upload
AdBanne
r
(
e
,
index
);
}}
onChange
=
{(
e
)
=>
{
this
.
upload
TeacherAvata
r
(
e
,
index
);
}}
/>上传头
像
<
/React.Fragment
>
}
<
/div
>
<
div
className
=
{
PageStyle
.
formRightItem
}
>
<
div
className
=
{
PageStyle
.
formRightItemFlex
}
>
<
FormItem
{...
formItemFlexLayout
}
label
=
"姓名"
style
=
{{
marginRight
:
1
0
}}
>
<
Input
style
=
{{
width
:
1
2
0
}}
value
=
{
item
.
name
}
onChange
=
{
e
=>
this
.
handleChangeTeacherText
(
e
,
index
,
'name'
)}
placeholder
=
"请输入教师姓名"
/>
<
FormItem
{...
formItemFlexLayout
}
label
=
"姓名"
style
=
{{
marginRight
:
1
5
}}
>
<
Input
style
=
{{
width
:
1
4
0
}}
value
=
{
item
.
name
}
onChange
=
{
e
=>
this
.
handleChangeTeacherText
(
e
,
index
,
'name'
)}
placeholder
=
"请输入教师姓名"
/>
<
/FormItem
>
<
FormItem
{...
formItemFlexLayout
}
label
=
"教龄"
>
<
InputNumber
min
=
{
0
}
value
=
{
item
.
seniority
}
onChange
=
{
e
=>
this
.
handleChangeTeacherText
(
e
,
index
,
'seniority'
)}
placeholder
=
"请输入"
/>
<
InputNumber
style
=
{{
width
:
100
}}
max
=
{
999
}
min
=
{
0
}
value
=
{
item
.
seniority
}
onChange
=
{
e
=>
this
.
handleChangeTeacherText
(
e
,
index
,
'seniority'
)}
placeholder
=
"请输入"
/>
<
/FormItem
>
<
/div
>
<
FormItem
{...
formItemLayout
}
label
=
"主授课程"
>
...
...
@@ -261,7 +218,7 @@ class TeacherEditor extends React.Component {
<
FormItem
{...
formItemLayout
}
label
=
"教师简介"
>
<
RichText
sid
=
{
sid
}
editorValue
=
{
editorValue
}
editorValue
=
{
item
.
intro
}
index
=
{
index
}
handleChangeEditor
=
{
this
.
handleChangeEditor
}
/
>
...
...
@@ -276,7 +233,7 @@ class TeacherEditor extends React.Component {
继续添加(
{
teachers
.
length
}
/20
)
<
/div
>
<
div
className
=
{
PageStyle
.
btnbox
}
>
<
Button
type
=
"primary"
htmlType
=
"submit"
className
=
{
PageStyle
.
SubmitBtn
}
loading
=
{
teacherStatus
}
onClick
=
{
this
.
save
AdCarousel
Plate
}
>
{
teacherStatus
?
'保存中...'
:
'保存'
}
<
/Button
>
<
Button
type
=
"primary"
htmlType
=
"submit"
className
=
{
PageStyle
.
SubmitBtn
}
loading
=
{
teacherStatus
}
onClick
=
{
this
.
save
Teacher
Plate
}
>
{
teacherStatus
?
'保存中...'
:
'保存'
}
<
/Button
>
<
/div
>
<
/div
>
);
...
...
src/pages/officialweb/pagecomponent/TeacherEditor.less
View file @
371d834a
...
...
@@ -53,7 +53,7 @@
}
}
.formRightWrap {
width: 5
24
px;
width: 5
60
px;
border: 1px solid #979797;
background-color: #fff;
padding: 15px 10px;
...
...
@@ -105,6 +105,7 @@
width: 100%;
height: 100%;
display: block;
border-radius: 50%;
}
}
}
...
...
@@ -146,7 +147,7 @@
}
}
.addPlate {
width: 5
24
px;
width: 5
60
px;
height: 54px;
line-height: 54px;
text-align: center;
...
...
@@ -158,6 +159,7 @@
background-color: #fff;
border:1px dashed rgba(151,151,151,1);
margin-left: 75px;
cursor: pointer;
}
::-webkit-scrollbar {
width: 8px;
...
...
src/pages/officialweb/pagecomponent/TogetherClock.js
View file @
371d834a
import
React
from
'react'
;
import
{
connect
}
from
'dva'
;
import
{
Carousel
,
Icon
}
from
'antd'
;
import
{
Carousel
,
Empty
,
Icon
,
Switch
}
from
'antd'
;
import
PageStyle
from
'./TogetherClock.less'
;
import
{
ossVideofy
,
imagify
,
videoPoster
}
from
'../../../utils/index'
;
class
TogetherClock
extends
React
.
Component
{
...
...
@@ -13,11 +13,51 @@ class TogetherClock extends React.Component {
}
componentWillUnmount
()
{
}
handleChangeSwitch
=
(
e
,
key
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'officialweb/handleChangeSwitch'
,
payload
:
{
e
,
key
,
},
});
}
render
()
{
const
{
banner
}
=
this
.
props
;
const
{
data
,
schoolInfo
}
=
this
.
props
;
console
.
log
(
data
,
'一起来打卡'
);
return
(
<
div
className
=
{
PageStyle
.
Bannercontainer
}
>
一起打卡
<
div
className
=
{
PageStyle
.
switchWrap
}
>
<
Switch
checked
=
{
schoolInfo
.
module_switch
&&
schoolInfo
.
module_switch
.
togetherclock
}
checkedChildren
=
"开"
unCheckedChildren
=
"关"
onChange
=
{
e
=>
this
.
handleChangeSwitch
(
e
,
'togetherclock'
)}
/
>
<
/div
>
<
div
className
=
{
PageStyle
.
commonTitle
}
>
<
div
>
一起打卡
<
/div
>
<
div
className
=
{
PageStyle
.
right
}
>
更多
<
Icon
type
=
"right"
/><
/div
>
<
/div
>
{
data
.
length
>
0
?
<
div
className
=
{
PageStyle
.
commonList
}
>
{
data
.
map
((
item
,
index
)
=>
{
return
(
<
div
className
=
{
PageStyle
.
commonItem
}
key
=
{
item
.
id
}
>
<
img
className
=
{
PageStyle
.
img
}
src
=
{
imagify
(
item
.
land_content
.
cover
)}
alt
=
""
/>
<
div
className
=
{
PageStyle
.
right
}
>
<
div
className
=
{
PageStyle
.
title
}
>
{
item
.
subject_mixture
.
title
}
<
/div
>
<
div
className
=
{
PageStyle
.
num
}
>
{
item
.
subject_mixture
.
subject_students_count
}
人参与
<
/div
>
<
/div
>
<
/div
>
);
})
}
<
/div
>
:
<
Empty
image
=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description
=
"暂时没有内容噢~"
/>
}
<
/div
>
);
}
...
...
src/pages/officialweb/pagecomponent/TogetherClock.less
View file @
371d834a
.Bannercontainer {
padding: 10px;
}
.switchWrap {
margin: 10px 0;
}
.commonTitle {
font-size:18px;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:600;
color:rgba(0,0,0,1);
line-height:25px;
display: flex;
justify-content: space-between;
.right {
font-size: 14px;
}
}
.commonList {
margin-top: 10px;
.commonItem {
display: flex;
align-items: flex-start;
margin-right: 5px;
width: 100%;
margin-bottom: 10px;
.img {
width: 83px;
height: 83px;
border-radius: 4px;
object-fit: cover;
margin-right: 25px;
border:1px solid rgba(151,151,151,1);
}
.right {
.title {
font-size:18px;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(0,0,0,1);
line-height:25px;
display: -webkit-box;
text-overflow: ellipsis;
word-break:break-all;
word-wrap: break-word;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
min-height: 49px;
}
.num {
font-size:14px;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(0,0,0,0.5);
line-height:20px;
}
}
}
}
src/pages/officialweb/pagecomponent/TogetherClockEditor.js
View file @
371d834a
...
...
@@ -51,7 +51,7 @@ class TogetherClockEditor extends React.Component {
onChange
=
{
this
.
handleChangeClock
}
targetKeys
=
{
togetherClockTargetKeys
}
render
=
{
item
=>
item
.
title
}
rowKey
=
{
record
=>
record
.
id
}
rowKey
=
{
record
=>
record
.
subject_mixed_
id
}
showSearch
lazy
/>
...
...
src/services/officialweb.js
View file @
371d834a
...
...
@@ -172,3 +172,18 @@ export function schoolIntroSave(params) {
data
,
});
}
export
function
getTeacher
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
officaialweb
.
teacher
}
?
${
data
}
`
,
method
:
'GET'
,
});
}
export
function
teacherSave
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
officaialweb
.
teacherSave
}
`
,
method
:
'POST'
,
data
,
});
}
webpackconfig/webpack.base.config.js
View file @
371d834a
...
...
@@ -162,10 +162,10 @@ module.exports = {
},
plugins
:
[
new
HtmlWebpackPlugin
(
devFile
),
new
webpack
.
DllReferencePlugin
({
context
:
path
.
resolve
(
__dirname
,
'../'
),
manifest
:
require
(
'../lib/vendor-manifest.json'
),
}),
//
new webpack.DllReferencePlugin({
//
context: path.resolve(__dirname, '../'),
//
manifest: require('../lib/vendor-manifest.json'),
//
}),
new
webpack
.
DefinePlugin
({
// 'ENVIRONMENT': `"${ENVIRONMENT}"`,
// '__IMGCDN__' : `"${__IMGCDN__}"`,
...
...
@@ -185,8 +185,8 @@ module.exports = {
// optimization: {
// splitChunks: {
// chunks: "all",
// // minSize: 10000000,
// // minSize: 10000000,
// minChunks: 1,
// }
// }
}
\ No newline at end of file
}
webpackconfig/webpack.dll.config.js
View file @
371d834a
...
...
@@ -20,6 +20,7 @@ module.exports = {
'react-router-dom/es'
,
'redux-saga'
,
'path-to-regexp'
,
'react-dom/server'
,
],
},
output
:
{
...
...
webpackconfig/webpack.pro.config.js
View file @
371d834a
...
...
@@ -14,5 +14,9 @@ module.exports = webpackMerge(baseconfig, {
mode
:
'production'
,
plugins
:
[
new
CleanWebpackPlugin
(),
new
webpack
.
DllReferencePlugin
({
context
:
path
.
resolve
(
__dirname
,
'../'
),
manifest
:
require
(
'../lib/vendor-manifest.json'
),
}),
],
});
\ No newline at end of file
});
webpackconfig/webpack.test.config.js
View file @
371d834a
...
...
@@ -14,5 +14,9 @@ module.exports = webpackMerge(baseconfig, {
mode
:
'production'
,
plugins
:
[
new
CleanWebpackPlugin
(),
new
webpack
.
DllReferencePlugin
({
context
:
path
.
resolve
(
__dirname
,
'../'
),
manifest
:
require
(
'../lib/vendor-manifest.json'
),
}),
],
});
\ 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