Commit 371d834a authored by baixian's avatar baixian

微官网

parent 699d2bd5
...@@ -128,10 +128,12 @@ export default { ...@@ -128,10 +128,12 @@ export default {
adsSave: `${dakaapi}member/website/ad/save`, adsSave: `${dakaapi}member/website/ad/save`,
moments: `${dakaapi}member/website/moments`, moments: `${dakaapi}member/website/moments`,
momentSave: `${dakaapi}member/website/moment/save`, momentSave: `${dakaapi}member/website/moment/save`,
onlineClass: `${dakaapi}member/website/online_course`, onlineClass: `${dakaapi}member/website/online_courses`,
onlineClassSave: `${dakaapi}member/website/online_course/save`, onlineClassSave: `${dakaapi}member/website/online_course/save`,
subjectMixture: `${dakaapi}member/website/subject_mixture`, subjectMixture: `${dakaapi}member/website/subject_mixtures`,
subjectMixtureSave: `${dakaapi}member/website/subject_mixture/save`, subjectMixtureSave: `${dakaapi}member/website/subject_mixture/save`,
teacher: `${dakaapi}member/website/teachers`,
teacherSave: `${dakaapi}member/website/teacher/save`,
}, },
schedule: `${dakaapi}member/erp/schedules`, schedule: `${dakaapi}member/erp/schedules`,
scheduleMgt: { scheduleMgt: {
......
This diff is collapsed.
...@@ -175,6 +175,7 @@ export default { ...@@ -175,6 +175,7 @@ export default {
adCarousel, adCarousel,
classMoment, classMoment,
schoolIntro, schoolIntro,
teachers,
} = yield select(state => state.officialweb); } = yield select(state => state.officialweb);
const { const {
cropperUrl, filename, uploadtype, orgType, orgIndex, imgIndex, action, cropperUrl, filename, uploadtype, orgType, orgIndex, imgIndex, action,
...@@ -276,6 +277,14 @@ export default { ...@@ -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 }) { // 释放该页面存储的所有状态 * unloadstates({ payload }, { call, put }) { // 释放该页面存储的所有状态
......
import React from 'react'; import React from 'react';
import { Modal, Icon } from 'antd'; import { Modal, Icon, message } from 'antd';
import BraftEditor from 'braft-editor'; import BraftEditor from 'braft-editor';
import pageStyle from './RichText.less'; import pageStyle from './RichText.less';
import api from '../../common/api'; import api from '../../common/api';
import { getRandomFilename, LocalStorage } from '../../utils'; import { getRandomFilename, LocalStorage } from '../../utils';
// eslint-disable-next-line import/first
class RichText extends React.Component { class RichText extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -12,11 +11,6 @@ class RichText extends React.Component { ...@@ -12,11 +11,6 @@ class RichText extends React.Component {
}; };
} }
componentDidMount() { // 挂载 componentDidMount() { // 挂载
// let { editorValue } = this.props;
// setTimeout(() => {
// // eslint-disable-next-line no-const-assign
// editorValue = BraftEditor.createEditorState(editorValue);
// }, 1000);
} }
componentWillUnmount() { // 卸载 componentWillUnmount() { // 卸载
...@@ -25,8 +19,12 @@ class RichText extends React.Component { ...@@ -25,8 +19,12 @@ class RichText extends React.Component {
const formData = new FormData(); const formData = new FormData();
const { sid } = this.props; const { sid } = this.props;
const user = LocalStorage.getItem('user'); const user = LocalStorage.getItem('user');
console.log(param.file, 'param.file'); if (param.file && param.file.size > 1000 * 1024 * 1024) {
formData.append('file', param.file); param.error({
msg: '视频或者图片大小不能超过1GB,请重新上传',
});
return;
}
const res = await fetch(`${api.imgupload}?school_id=${sid}`, { const res = await fetch(`${api.imgupload}?school_id=${sid}`, {
method: 'GET', method: 'GET',
headers: { headers: {
...@@ -61,6 +59,15 @@ class RichText extends React.Component { ...@@ -61,6 +59,15 @@ class RichText extends React.Component {
console.log(res2, 'res21111111'); console.log(res2, 'res21111111');
param.success({ param.success({
url: `${host}/${filename}`, url: `${host}/${filename}`,
meta: {
loop: true, // 指定音视频是否循环播放
autoPlay: true, // 指定音视频是否自动播放
controls: false, // 指定音视频是否显示控制栏
},
});
} else {
param.error({
msg: '上传错误',
}); });
} }
} }
...@@ -74,12 +81,20 @@ class RichText extends React.Component { ...@@ -74,12 +81,20 @@ class RichText extends React.Component {
editorValue, editorValue,
} = this.props; } = this.props;
const controls = [ const controls = [
'undo', 'redo', 'separator', 'undo', 'redo', 'separator', 'headings',
'font-size', 'line-height', 'letter-spacing', 'separator', 'font-size', 'line-height',
'text-color', 'bold', 'italic', 'underline', 'strike-through', 'separator', 'text-color', 'bold', 'italic', 'underline', 'strike-through', 'separator',
'remove-styles', 'emoji', 'separator', 'text-align', 'headings', 'list-ul', 'list-ol', 'separator', 'hr', 'remove-styles', 'separator', 'text-align', 'separator', 'hr',
'media', 'separator', 'media', 'separator', 'clear',
'clear', ];
const accepts = {
audio: false,
};
const imageControls = [
'float-left',
'float-right',
'size',
'remove',
]; ];
console.log(editorValue, 'editorValue'); console.log(editorValue, 'editorValue');
const newValue = BraftEditor.createEditorState(editorValue); const newValue = BraftEditor.createEditorState(editorValue);
...@@ -87,10 +102,11 @@ class RichText extends React.Component { ...@@ -87,10 +102,11 @@ class RichText extends React.Component {
<div className={pageStyle.container}> <div className={pageStyle.container}>
<BraftEditor <BraftEditor
contentStyle={{ height: 210, boxShadow: 'inset 0 1px 3px rgba(0,0,0,.1)' }} contentStyle={{ height: 210, boxShadow: 'inset 0 1px 3px rgba(0,0,0,.1)' }}
media={{ uploadFn: this.myUploadFn }} media={{ uploadFn: this.myUploadFn, accepts }}
controls={controls} controls={controls}
onChange={this.handleChangeEditor} onChange={this.handleChangeEditor}
value={newValue} value={newValue}
imageControls={imageControls}
/> />
</div> </div>
); );
......
.container {
:global {
}
}
:global { :global {
.bf-controlbar { .bf-controlbar {
margin: 0; margin: 0;
...@@ -873,6 +870,7 @@ ...@@ -873,6 +870,7 @@
width: 640px; width: 640px;
max-width: 80vw; max-width: 80vw;
height: auto; height: auto;
max-height: 80vh;
margin: 0 10px 10px; margin: 0 10px 10px;
object-fit: contain object-fit: contain
} }
...@@ -1140,7 +1138,8 @@ ...@@ -1140,7 +1138,8 @@
color: hsla(0,0%,100%,.5); color: hsla(0,0%,100%,.5);
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
text-align: center text-align: center;
opacity: 0;
} }
.bf-player-holder .bf-poster { .bf-player-holder .bf-poster {
...@@ -1474,7 +1473,7 @@ ...@@ -1474,7 +1473,7 @@
} }
.headings-dropdown { .headings-dropdown {
min-width: 110px min-width: 80px
} }
.headings-dropdown .menu { .headings-dropdown .menu {
...@@ -1778,7 +1777,7 @@ ...@@ -1778,7 +1777,7 @@
} }
.bf-font-size-dropdown { .bf-font-size-dropdown {
min-width: 95px min-width: 80px
} }
.bf-font-sizes { .bf-font-sizes {
...@@ -1815,7 +1814,7 @@ ...@@ -1815,7 +1814,7 @@
} }
.bf-line-height-dropdown { .bf-line-height-dropdown {
min-width: 95px min-width: 80px
} }
.bf-line-heights { .bf-line-heights {
...@@ -1912,7 +1911,7 @@ ...@@ -1912,7 +1911,7 @@
} }
.bf-letter-spacing-dropdown { .bf-letter-spacing-dropdown {
min-width: 95px min-width: 80px
} }
.bf-letter-spacings { .bf-letter-spacings {
...@@ -1947,5 +1946,7 @@ ...@@ -1947,5 +1946,7 @@
.bf-letter-spacings li.active { .bf-letter-spacings li.active {
background-color: #3498db background-color: #3498db
} }
.braft-finder .bf-toggle-external-form {
display: none;
}
} }
This diff is collapsed.
...@@ -97,6 +97,7 @@ class Officialweb extends React.Component { ...@@ -97,6 +97,7 @@ class Officialweb extends React.Component {
moduleSelect, moduleSelect,
cropperboxShow, cropperboxShow,
course, course,
schoolInfo,
} = this.props; } = this.props;
let renderDom; let renderDom;
const newPageInfo = pageInfo; const newPageInfo = pageInfo;
...@@ -149,7 +150,8 @@ class Officialweb extends React.Component { ...@@ -149,7 +150,8 @@ class Officialweb extends React.Component {
key={ele.type} key={ele.type}
> >
<AdCarousel <AdCarousel
banner={ele.data} data={ele.data}
schoolInfo={schoolInfo}
/> />
</div> </div>
</div> </div>
...@@ -164,6 +166,7 @@ class Officialweb extends React.Component { ...@@ -164,6 +166,7 @@ class Officialweb extends React.Component {
> >
<StudentClock <StudentClock
clockList={ele.data} clockList={ele.data}
schoolInfo={schoolInfo}
/> />
</div> </div>
</div> </div>
...@@ -177,7 +180,8 @@ class Officialweb extends React.Component { ...@@ -177,7 +180,8 @@ class Officialweb extends React.Component {
key={ele.type} key={ele.type}
> >
<ClassMoments <ClassMoments
banner={ele.data} data={ele.data}
schoolInfo={schoolInfo}
/> />
</div> </div>
</div> </div>
...@@ -191,7 +195,8 @@ class Officialweb extends React.Component { ...@@ -191,7 +195,8 @@ class Officialweb extends React.Component {
key={ele.type} key={ele.type}
> >
<SchoolIntro <SchoolIntro
orgdescs={ele.data} data={ele.data}
schoolInfo={schoolInfo}
/> />
</div> </div>
</div> </div>
...@@ -248,6 +253,7 @@ function mapStateToProps(state) { ...@@ -248,6 +253,7 @@ function mapStateToProps(state) {
pageInfo, pageInfo,
moduleSelect, moduleSelect,
course, course,
schoolInfo,
} = state.officialweb; } = state.officialweb;
const { const {
cropperboxShow, cropperboxShow,
...@@ -261,6 +267,7 @@ function mapStateToProps(state) { ...@@ -261,6 +267,7 @@ function mapStateToProps(state) {
avatorUploader, avatorUploader,
uploadImgUrl, uploadImgUrl,
course, course,
schoolInfo,
}; };
} }
export default connect(mapStateToProps)(Officialweb); export default connect(mapStateToProps)(Officialweb);
......
...@@ -69,11 +69,11 @@ ...@@ -69,11 +69,11 @@
position: relative; position: relative;
} }
.editbox { .editbox {
width: 620px; width: 690px;
background-color: #F9F9F9; background-color: #F9F9F9;
border-radius: 10px; border-radius: 10px;
position: absolute; position: absolute;
right: -680px; right: -750px;
top: 0; top: 0;
border:1px solid rgba(235,235,235,1); border:1px solid rgba(235,235,235,1);
} }
......
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Carousel, Icon } from 'antd'; import { Carousel, Icon, Switch, Empty } from 'antd';
import PageStyle from './AdCarousel.less'; import PageStyle from './AdCarousel.less';
import { ossVideofy, imagify, videoPoster } from '../../../utils/index'; import { ossVideofy, imagify, videoPoster } from '../../../utils/index';
class adCarousel extends React.Component { class adCarousel extends React.Component {
...@@ -13,11 +13,46 @@ class adCarousel extends React.Component { ...@@ -13,11 +13,46 @@ class adCarousel extends React.Component {
} }
componentWillUnmount() { componentWillUnmount() {
} }
handleChangeSwitch = (e, key) => {
const { dispatch } = this.props;
dispatch({
type: 'officialweb/handleChangeSwitch',
payload: {
e,
key,
},
});
}
render() { render() {
const { banner } = this.props; const { data, schoolInfo } = this.props;
console.log(schoolInfo, 'schoolInfo');
return ( return (
<div className={PageStyle.Bannercontainer}> <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> </div>
); );
} }
......
@import '../../../less/variables.less'; @import '../../../less/variables.less';
@images: '@{imagesroot}/webapp/'; .switchWrap {
.Bannercontainer { margin: 10px 0;
padding: 6px 12px 6px;
} }
.videobox { .carouselWrap {
position: relative;
}
.videoPoster {
display: block;
position: relative;
z-index: 1;
width: 100%; width: 100%;
border-radius: 5px; height: 123px;
} .img {
.playicon { width: 100%;
position: absolute; height: 123px;
width: 42px; object-fit: cover;
height: 49px; }
left: 50%;
top: 50%;
margin-left: -21px;
margin-top: -24px;
z-index: 2;
}
.swiperbox {
} }
.emptyBanner {
height: 200px;
text-align: center;
display: flex;
align-items: center;
background-color: #dedede;
justify-content: center;
}
\ No newline at end of file
...@@ -179,7 +179,7 @@ class AdCarouselEditor extends React.Component { ...@@ -179,7 +179,7 @@ class AdCarouselEditor extends React.Component {
{ {
adCarousel.length > 0 && adCarousel.map((item, index) => { adCarousel.length > 0 && adCarousel.map((item, index) => {
return ( return (
<div className={PageStyle.formItem}> <div className={PageStyle.formItem} key={item.id}>
<div className={PageStyle.formLeft}> <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} ${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> } { index > 0 && <div className={PageStyle.formItemIcon} onClick={() => this.moveAdCarouselPlate(index, 'up')}><Icon className={PageStyle.itemIcon} type="arrow-up" /></div> }
......
import React from 'react'; import React from 'react';
import { connect } from 'dva'; 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 { videoPoster, imagify } from '../../../utils/index';
import PageStyle from './BannerEditor.less'; import PageStyle from './BannerEditor.less';
const FormItem = Form.Item; const FormItem = Form.Item;
...@@ -62,6 +62,14 @@ class BannerEditor extends React.Component { ...@@ -62,6 +62,14 @@ class BannerEditor extends React.Component {
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'banner', 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 { ...@@ -112,9 +120,16 @@ class BannerEditor extends React.Component {
render() { render() {
const { const {
bannerType, banner, bannerVideo, bannerImg, bannerPostStatus, bannerType, banner, bannerVideo, bannerImg, bannerPostStatus,
progressRate,
} = this.props; } = this.props;
return ( return (
<div className={`${PageStyle.SchoolInfoEditorcontainer} SchoolInfoEditorcontainer`}> <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> <div className={PageStyle.header}>品牌视频/轮播</div>
<Form className={PageStyle.FormBox} onSubmit={this.handleSubmit}> <Form className={PageStyle.FormBox} onSubmit={this.handleSubmit}>
<div className={PageStyle.selfradiabox}> <div className={PageStyle.selfradiabox}>
...@@ -175,7 +190,7 @@ class BannerEditor extends React.Component { ...@@ -175,7 +190,7 @@ class BannerEditor extends React.Component {
} }
{bannerVideo.length == 0 && {bannerVideo.length == 0 &&
<div className={PageStyle.fileuploadbox}> <div className={PageStyle.fileuploadbox}>
<input type="file" id="uploadinput" className={PageStyle.fileuploadinput} onChange={(e) => { this.uploadBannerVideo(e); }} accept="video/mp4,video/*" /> <input type="file" id="uploadCommon" className={PageStyle.fileuploadinput} onChange={(e) => { this.uploadBannerVideo(e); }} accept="video/mp4,video/*" />
<div className={PageStyle.fileuploadlayer}> <div className={PageStyle.fileuploadlayer}>
<div className={PageStyle.uploadtext}>点击上传</div> <div className={PageStyle.uploadtext}>点击上传</div>
</div> </div>
...@@ -202,12 +217,14 @@ function mapStateToProps(state) { ...@@ -202,12 +217,14 @@ function mapStateToProps(state) {
bannerVideo, bannerVideo,
bannerImg, bannerImg,
bannerPostStatus, bannerPostStatus,
progressRate,
} = state.officialweb; } = state.officialweb;
return { return {
bannerType, bannerType,
bannerVideo, bannerVideo,
bannerImg, bannerImg,
bannerPostStatus, bannerPostStatus,
progressRate,
}; };
} }
export default connect(mapStateToProps)(BannerEditor); export default connect(mapStateToProps)(BannerEditor);
@import '../../../less/variables.less'; @import '../../../less/variables.less';
@images: '@{imagesroot}/webapp/'; @images: '@{imagesroot}/webapp/';
.SchoolInfoEditorcontainer { .SchoolInfoEditorcontainer {
} }
.header { .header {
color: #000; color: #000;
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
background-color: #fff; background-color: #fff;
margin-right: 24px; margin-right: 24px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
} }
.blockOperateItem { .blockOperateItem {
...@@ -207,4 +207,24 @@ ...@@ -207,4 +207,24 @@
.imgupdate { .imgupdate {
flex: 1; flex: 1;
text-align: center; 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;
}
}
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Carousel, Icon } from 'antd'; import { Carousel, Empty, Icon, Switch, Tooltip } from 'antd';
import PageStyle from './ClassMoments.less'; import PageStyle from './ClassMoments.less';
import { ossVideofy, imagify, videoPoster } from '../../../utils/index'; import { ossVideofy, imagify, videoPoster } from '../../../utils/index';
class ClassMoments extends React.Component { class ClassMoments extends React.Component {
...@@ -13,11 +13,53 @@ class ClassMoments extends React.Component { ...@@ -13,11 +13,53 @@ class ClassMoments extends React.Component {
} }
componentWillUnmount() { componentWillUnmount() {
} }
handleChangeSwitch = (e, key) => {
const { dispatch } = this.props;
dispatch({
type: 'officialweb/handleChangeSwitch',
payload: {
e,
key,
},
});
}
render() { render() {
const { banner } = this.props; const { data, schoolInfo } = this.props;
console.log(data, 'datadatadatadata');
return ( return (
<div className={PageStyle.Bannercontainer}> <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> </div>
); );
} }
......
.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;
}
}
}
...@@ -147,6 +147,12 @@ class ClassMomentsEditor extends React.Component { ...@@ -147,6 +147,12 @@ class ClassMomentsEditor extends React.Component {
classMomentStatus, classMomentStatus,
progressRate, progressRate,
} = this.props; } = 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 = { const formItemLayout = {
labelCol: { labelCol: {
xs: { span: 4 }, xs: { span: 4 },
...@@ -170,7 +176,7 @@ class ClassMomentsEditor extends React.Component { ...@@ -170,7 +176,7 @@ class ClassMomentsEditor extends React.Component {
{ {
classMoment.length > 0 && classMoment.map((item, index) => { classMoment.length > 0 && classMoment.map((item, index) => {
return ( return (
<div className={PageStyle.formItem}> <div className={PageStyle.formItem} key={item.id}>
<div className={PageStyle.formLeft}> <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} ${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> } { 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 { ...@@ -194,7 +200,7 @@ class ClassMomentsEditor extends React.Component {
switch (ele.type) { switch (ele.type) {
case 'img': case 'img':
return ( return (
<div className={PageStyle.imgItem}> <div className={PageStyle.imgItem} key={ele.type}>
<img className={PageStyle.img} src={imagify(ele.value)} alt="图片" /> <img className={PageStyle.img} src={imagify(ele.value)} alt="图片" />
<div className={PageStyle.closeAdIcon} onClick={() => this.deleteClassMomentImg(index, i)}> <div className={PageStyle.closeAdIcon} onClick={() => this.deleteClassMomentImg(index, i)}>
<Icon type="close" /> <Icon type="close" />
...@@ -203,7 +209,7 @@ class ClassMomentsEditor extends React.Component { ...@@ -203,7 +209,7 @@ class ClassMomentsEditor extends React.Component {
); );
case 'video': case 'video':
return ( return (
<div className={PageStyle.imgItem}> <div className={PageStyle.imgItem} key={ele.type}>
<video className={PageStyle.img} controls="controls" src={ossVideofy(ele.value)} /> <video className={PageStyle.img} controls="controls" src={ossVideofy(ele.value)} />
<div className={PageStyle.closeAdIcon} onClick={() => this.deleteClassMomentImg(index, i)}> <div className={PageStyle.closeAdIcon} onClick={() => this.deleteClassMomentImg(index, i)}>
<Icon type="close" /> <Icon type="close" />
......
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Carousel, Icon } from 'antd'; import { Carousel, Empty, Icon, Switch } from 'antd';
import PageStyle from './OnlineClass.less'; import PageStyle from './OnlineClass.less';
import { ossVideofy, imagify, videoPoster } from '../../../utils/index'; import { ossVideofy, imagify, videoPoster } from '../../../utils/index';
class OnlineClass extends React.Component { class OnlineClass extends React.Component {
...@@ -13,11 +13,53 @@ class OnlineClass extends React.Component { ...@@ -13,11 +13,53 @@ class OnlineClass extends React.Component {
} }
componentWillUnmount() { componentWillUnmount() {
} }
handleChangeSwitch = (e, key) => {
const { dispatch } = this.props;
dispatch({
type: 'officialweb/handleChangeSwitch',
payload: {
e,
key,
},
});
}
render() { render() {
const { banner } = this.props; const { data, schoolInfo } = this.props;
return ( return (
<div className={PageStyle.Bannercontainer}> <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> </div>
); );
} }
......
.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;
}
}
}
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Carousel, Icon } from 'antd'; import { Carousel, Empty, Icon, Switch } from 'antd';
import PageStyle from './SchoolIntro.less'; import PageStyle from './SchoolIntro.less';
import { ossVideofy, imagify, videoPoster } from '../../../utils/index'; import { ossVideofy, imagify, videoPoster } from '../../../utils/index';
class SchoolIntro extends React.Component { class SchoolIntro extends React.Component {
...@@ -13,11 +13,58 @@ class SchoolIntro extends React.Component { ...@@ -13,11 +13,58 @@ class SchoolIntro extends React.Component {
} }
componentWillUnmount() { componentWillUnmount() {
} }
handleChangeSwitch = (e, key) => {
const { dispatch } = this.props;
dispatch({
type: 'officialweb/handleChangeSwitch',
payload: {
e,
key,
},
});
}
render() { render() {
const { banner } = this.props; const { data, schoolInfo } = this.props;
return ( return (
<div className={PageStyle.Bannercontainer}> <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> </div>
); );
} }
...@@ -29,10 +76,14 @@ function mapStateToProps(state) { ...@@ -29,10 +76,14 @@ function mapStateToProps(state) {
const { const {
menus, defaultMenu, collapsed, menus, defaultMenu, collapsed,
} = state.webapp; } = state.webapp;
const {
schoolInfo,
} = state.officialweb;
return { return {
menus, menus,
defaultMenu, defaultMenu,
collapsed, collapsed,
schoolInfo,
}; };
} }
export default connect(mapStateToProps)(SchoolIntro); export default connect(mapStateToProps)(SchoolIntro);
.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;
}
}
...@@ -169,8 +169,6 @@ class SchoolIntroEditor extends React.Component { ...@@ -169,8 +169,6 @@ class SchoolIntroEditor extends React.Component {
sm: { span: 20 }, sm: { span: 20 },
}, },
}; };
console.log(schoolInfo, 'schoolInfo111111111');
console.log(schoolIntro, 'schoolIntro');
return ( return (
<div className={`${PageStyle.SchoolInfoEditorcontainer} SchoolInfoEditorcontainer`}> <div className={`${PageStyle.SchoolInfoEditorcontainer} SchoolInfoEditorcontainer`}>
{progressRate && progressRate > 0 ? {progressRate && progressRate > 0 ?
...@@ -189,7 +187,7 @@ class SchoolIntroEditor extends React.Component { ...@@ -189,7 +187,7 @@ class SchoolIntroEditor extends React.Component {
{ {
schoolIntro.length > 0 && schoolIntro.map((item, index) => { schoolIntro.length > 0 && schoolIntro.map((item, index) => {
return ( return (
<div className={PageStyle.formItem}> <div className={PageStyle.formItem} key={item}>
<div className={PageStyle.formLeft}> <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} ${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> } { index > 0 && <div className={PageStyle.formItemIcon} onClick={() => this.moveSchoolIntroPlate(index, 'up')}><Icon className={PageStyle.itemIcon} type="arrow-up" /></div> }
......
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Carousel } from 'antd'; import { Carousel, Switch } from 'antd';
import PageStyle from './StudentClock.less'; import PageStyle from './StudentClock.less';
import { imagify, timeCompare } from '../../../utils'; import { imagify, timeCompare } from '../../../utils';
class StudentClock extends React.Component { class StudentClock extends React.Component {
...@@ -20,9 +20,20 @@ class StudentClock extends React.Component { ...@@ -20,9 +20,20 @@ class StudentClock extends React.Component {
payload: key, payload: key,
}); });
} }
handleChangeSwitch = (e, key) => {
const { dispatch } = this.props;
dispatch({
type: 'officialweb/handleChangeSwitch',
payload: {
e,
key,
},
});
}
render() { render() {
const { const {
menus, defaultMenu, collapsed, clockList, menus, defaultMenu, collapsed, clockList,
schoolInfo,
} = this.props; } = this.props;
const menuItemStyle = { const menuItemStyle = {
fontSize: '16px', fontSize: '16px',
...@@ -31,9 +42,12 @@ class StudentClock extends React.Component { ...@@ -31,9 +42,12 @@ class StudentClock extends React.Component {
<div className={PageStyle.StudentClockcontainer}> <div className={PageStyle.StudentClockcontainer}>
<div className={PageStyle.headerbox}> <div className={PageStyle.headerbox}>
<div className={PageStyle.headertitle}> <div className={PageStyle.headertitle}>
动态 动态
</div> </div>
</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}> <div className={PageStyle.clockListBox}>
{clockList.list && clockList.list.length > 0 && clockList.list.map(ele => ( {clockList.list && clockList.list.length > 0 && clockList.list.map(ele => (
<div className={PageStyle.clockitem} key={ele.id}> <div className={PageStyle.clockitem} key={ele.id}>
......
...@@ -6,14 +6,17 @@ ...@@ -6,14 +6,17 @@
background-size: 100% 100%; background-size: 100% 100%;
padding: 18px 0 0 12px; padding: 18px 0 0 12px;
} }
.switchWrap {
margin: 10px 0;
}
.headertitle { .headertitle {
width: 61px; width: 100px;
height: 17px; height: 17px;
background-size: 100% 100%; background-size: 100% 100%;
background-image: url('@{imagesroot}titlebg.png'); background-image: url('@{imagesroot}titlebg.png');
color: #010101; color: #010101;
font-weight: 700; font-weight: 700;
font-size: 14px; font-size: 18px;
} }
.clockListBox { .clockListBox {
padding: 0 12px; padding: 0 12px;
...@@ -190,7 +193,7 @@ ...@@ -190,7 +193,7 @@
justify-content: space-around; justify-content: space-around;
} }
.bottombtnitem { .bottombtnitem {
// width: // width:
display: flex; display: flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
...@@ -205,4 +208,4 @@ ...@@ -205,4 +208,4 @@
color: #777E84; color: #777E84;
font-size: 12px; font-size: 12px;
line-height: 1; line-height: 1;
} }
\ No newline at end of file
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Carousel, Icon } from 'antd'; import { Carousel, Empty, Icon, Switch, Tooltip } from 'antd';
import PageStyle from './Teacher.less'; import PageStyle from './Teacher.less';
import { ossVideofy, imagify, videoPoster } from '../../../utils/index'; import { ossVideofy, imagify, videoPoster } from '../../../utils/index';
class Teacher extends React.Component { class Teacher extends React.Component {
...@@ -13,11 +13,53 @@ class Teacher extends React.Component { ...@@ -13,11 +13,53 @@ class Teacher extends React.Component {
} }
componentWillUnmount() { componentWillUnmount() {
} }
handleChangeSwitch = (e, key) => {
const { dispatch } = this.props;
dispatch({
type: 'officialweb/handleChangeSwitch',
payload: {
e,
key,
},
});
}
render() { render() {
const { banner } = this.props; const { data, schoolInfo } = this.props;
console.log(data, 'data111');
return ( return (
<div className={PageStyle.Bannercontainer}> <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>&nbsp;{item.seniority}年教龄</div>
</div>
</div>
);
})
}
</div>
:
<Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="暂时没有内容噢~"
/>
}
</div> </div>
); );
} }
......
.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;
}
}
}
...@@ -39,56 +39,6 @@ class TeacherEditor extends React.Component { ...@@ -39,56 +39,6 @@ class TeacherEditor extends React.Component {
} }
componentWillUnmount() { 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 = () => { handleTeacherPlate = () => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
...@@ -99,14 +49,14 @@ class TeacherEditor extends React.Component { ...@@ -99,14 +49,14 @@ class TeacherEditor extends React.Component {
element.scrollTop = element.scrollHeight; element.scrollTop = element.scrollHeight;
}, 200); }, 200);
} }
uploadAdBanner = (e, index) => { uploadTeacherAvatar = (e, index) => {
const { dispatch } = this.props; const { dispatch } = this.props;
const { avatorUploader } = this.state; const { avatorUploader } = this.state;
dispatch({ dispatch({
type: 'uploader/queryimgsignature', type: 'uploader/queryimgsignature',
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'uploadAdBanner', uploadtype: 'uploadTeacherAvatar',
avatorUploader, avatorUploader,
imgIndex: index, imgIndex: index,
}, },
...@@ -114,19 +64,26 @@ class TeacherEditor extends React.Component { ...@@ -114,19 +64,26 @@ class TeacherEditor extends React.Component {
} }
handleChangeTeacherText = (e, index, key) => { handleChangeTeacherText = (e, index, key) => {
const { dispatch } = this.props; const { dispatch } = this.props;
let value = '';
if (key == 'seniority') {
value = e;
} else {
// eslint-disable-next-line prefer-destructuring
value = e.target.value;
}
dispatch({ dispatch({
type: 'officialweb/handleChangeTeacherText', type: 'officialweb/handleChangeTeacherText',
payload: { payload: {
value: e.target.value, value,
index, index,
key, key,
}, },
}); });
} }
deleteAdBanner = (index) => { deleteTeacherAvatar = (index) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'officialweb/deleteAdBanner', type: 'officialweb/deleteTeacherAvatar',
payload: { payload: {
index, index,
}, },
...@@ -141,41 +98,41 @@ class TeacherEditor extends React.Component { ...@@ -141,41 +98,41 @@ class TeacherEditor extends React.Component {
}, },
}); });
} }
moveAdCarouselPlate = (index, direction) => { moveTeacherPlate = (index, direction) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'officialweb/moveAdCarouselPlate', type: 'officialweb/moveTeacherPlate',
payload: { payload: {
index, index,
direction, direction,
}, },
}); });
} }
saveAdCarouselPlate = () => { saveTeacherPlate = () => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'officialweb/saveAdCarouselPlate', type: 'officialweb/saveTeacherPlate',
payload: { payload: {
}, },
}); });
} }
handleChangeEditor = (editorState, index) => { handleChangeEditor = (editorState, index) => {
const { dispatch } = this.props; const { dispatch } = this.props;
// dispatch({ dispatch({
// type: 'officialweb/handleChangeEditor', type: 'officialweb/handleChangeEditor',
// payload: { payload: {
// editorState, editorState,
// index, index,
// }, },
// }); });
} }
render() { render() {
const { const {
teachers, teachers,
teacherStatus, teacherStatus,
sid, sid,
editorValue,
} = this.props; } = this.props;
console.log(teachers, 'teachersteachersteachers');
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
xs: { span: 4 }, xs: { span: 4 },
...@@ -203,12 +160,12 @@ class TeacherEditor extends React.Component { ...@@ -203,12 +160,12 @@ class TeacherEditor extends React.Component {
{ {
teachers.length > 0 && teachers.map((item, index) => { teachers.length > 0 && teachers.map((item, index) => {
return ( return (
<div className={PageStyle.formItem}> <div className={PageStyle.formItem} key={item.id}>
<div className={PageStyle.formLeft}> <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} ${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> } { index > 0 && <div className={PageStyle.formItemIcon} onClick={() => this.moveTeacherPlate(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} ${PageStyle.formItemIconGray}`}><Icon className={PageStyle.itemIcon} type="arrow-down" /></div>}
{index < (teachers.length - 1) && <div className={PageStyle.formItemIcon} onClick={() => this.moveAdCarouselPlate(index, 'down')}><Icon className={PageStyle.itemIcon} type="arrow-down" /></div>} {index < (teachers.length - 1) && <div className={PageStyle.formItemIcon} onClick={() => this.moveTeacherPlate(index, 'down')}><Icon className={PageStyle.itemIcon} type="arrow-down" /></div>}
<Popconfirm <Popconfirm
placement="topLeft" placement="topLeft"
title="确定删除?" title="确定删除?"
...@@ -226,7 +183,7 @@ class TeacherEditor extends React.Component { ...@@ -226,7 +183,7 @@ class TeacherEditor extends React.Component {
item.avatar ? item.avatar ?
<React.Fragment> <React.Fragment>
<img src={imagify(item.avatar)} alt="图片" /> <img src={imagify(item.avatar)} alt="图片" />
<div className={PageStyle.closeAdIcon} onClick={() => this.deleteAdBanner(index)}> <div className={PageStyle.closeAdIcon} onClick={() => this.deleteTeacherAvatar(index)}>
<Icon type="close" /> <Icon type="close" />
</div> </div>
</React.Fragment> : </React.Fragment> :
...@@ -236,18 +193,18 @@ class TeacherEditor extends React.Component { ...@@ -236,18 +193,18 @@ class TeacherEditor extends React.Component {
className={PageStyle.uploadInput} className={PageStyle.uploadInput}
accept="image/png, image/jpeg" accept="image/png, image/jpeg"
id="upload1" id="upload1"
onChange={(e) => { this.uploadAdBanner(e, index); }} onChange={(e) => { this.uploadTeacherAvatar(e, index); }}
/>上传头 />上传头
</React.Fragment> </React.Fragment>
} }
</div> </div>
<div className={PageStyle.formRightItem}> <div className={PageStyle.formRightItem}>
<div className={PageStyle.formRightItemFlex}> <div className={PageStyle.formRightItemFlex}>
<FormItem {...formItemFlexLayout} label="姓名" style={{ marginRight: 10 }}> <FormItem {...formItemFlexLayout} label="姓名" style={{ marginRight: 15 }}>
<Input style={{ width: 120 }} value={item.name} onChange={e => this.handleChangeTeacherText(e, index, 'name')} placeholder="请输入教师姓名" /> <Input style={{ width: 140 }} value={item.name} onChange={e => this.handleChangeTeacherText(e, index, 'name')} placeholder="请输入教师姓名" />
</FormItem> </FormItem>
<FormItem {...formItemFlexLayout} label="教龄"> <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> </FormItem>
</div> </div>
<FormItem {...formItemLayout} label="主授课程"> <FormItem {...formItemLayout} label="主授课程">
...@@ -261,7 +218,7 @@ class TeacherEditor extends React.Component { ...@@ -261,7 +218,7 @@ class TeacherEditor extends React.Component {
<FormItem {...formItemLayout} label="教师简介"> <FormItem {...formItemLayout} label="教师简介">
<RichText <RichText
sid={sid} sid={sid}
editorValue={editorValue} editorValue={item.intro}
index={index} index={index}
handleChangeEditor={this.handleChangeEditor} handleChangeEditor={this.handleChangeEditor}
/> />
...@@ -276,7 +233,7 @@ class TeacherEditor extends React.Component { ...@@ -276,7 +233,7 @@ class TeacherEditor extends React.Component {
继续添加({teachers.length}/20 继续添加({teachers.length}/20
</div> </div>
<div className={PageStyle.btnbox}> <div className={PageStyle.btnbox}>
<Button type="primary" htmlType="submit" className={PageStyle.SubmitBtn} loading={teacherStatus} onClick={this.saveAdCarouselPlate}>{teacherStatus ? '保存中...' : '保存'}</Button> <Button type="primary" htmlType="submit" className={PageStyle.SubmitBtn} loading={teacherStatus} onClick={this.saveTeacherPlate}>{teacherStatus ? '保存中...' : '保存'}</Button>
</div> </div>
</div> </div>
); );
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
} }
} }
.formRightWrap { .formRightWrap {
width: 524px; width: 560px;
border: 1px solid #979797; border: 1px solid #979797;
background-color: #fff; background-color: #fff;
padding: 15px 10px; padding: 15px 10px;
...@@ -105,6 +105,7 @@ ...@@ -105,6 +105,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
display: block; display: block;
border-radius: 50%;
} }
} }
} }
...@@ -146,7 +147,7 @@ ...@@ -146,7 +147,7 @@
} }
} }
.addPlate { .addPlate {
width: 524px; width: 560px;
height: 54px; height: 54px;
line-height: 54px; line-height: 54px;
text-align: center; text-align: center;
...@@ -158,6 +159,7 @@ ...@@ -158,6 +159,7 @@
background-color: #fff; background-color: #fff;
border:1px dashed rgba(151,151,151,1); border:1px dashed rgba(151,151,151,1);
margin-left: 75px; margin-left: 75px;
cursor: pointer;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8px; width: 8px;
......
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Carousel, Icon } from 'antd'; import { Carousel, Empty, Icon, Switch } from 'antd';
import PageStyle from './TogetherClock.less'; import PageStyle from './TogetherClock.less';
import { ossVideofy, imagify, videoPoster } from '../../../utils/index'; import { ossVideofy, imagify, videoPoster } from '../../../utils/index';
class TogetherClock extends React.Component { class TogetherClock extends React.Component {
...@@ -13,11 +13,51 @@ class TogetherClock extends React.Component { ...@@ -13,11 +13,51 @@ class TogetherClock extends React.Component {
} }
componentWillUnmount() { componentWillUnmount() {
} }
handleChangeSwitch = (e, key) => {
const { dispatch } = this.props;
dispatch({
type: 'officialweb/handleChangeSwitch',
payload: {
e,
key,
},
});
}
render() { render() {
const { banner } = this.props; const { data, schoolInfo } = this.props;
console.log(data, '一起来打卡');
return ( return (
<div className={PageStyle.Bannercontainer}> <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> </div>
); );
} }
......
.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;
}
}
}
}
...@@ -51,7 +51,7 @@ class TogetherClockEditor extends React.Component { ...@@ -51,7 +51,7 @@ class TogetherClockEditor extends React.Component {
onChange={this.handleChangeClock} onChange={this.handleChangeClock}
targetKeys={togetherClockTargetKeys} targetKeys={togetherClockTargetKeys}
render={item => item.title} render={item => item.title}
rowKey={record => record.id} rowKey={record => record.subject_mixed_id}
showSearch showSearch
lazy lazy
/> />
......
...@@ -172,3 +172,18 @@ export function schoolIntroSave(params) { ...@@ -172,3 +172,18 @@ export function schoolIntroSave(params) {
data, 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,
});
}
...@@ -162,10 +162,10 @@ module.exports = { ...@@ -162,10 +162,10 @@ module.exports = {
}, },
plugins: [ plugins: [
new HtmlWebpackPlugin(devFile), new HtmlWebpackPlugin(devFile),
new webpack.DllReferencePlugin({ // new webpack.DllReferencePlugin({
context: path.resolve(__dirname, '../'), // context: path.resolve(__dirname, '../'),
manifest: require('../lib/vendor-manifest.json'), // manifest: require('../lib/vendor-manifest.json'),
}), // }),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
// 'ENVIRONMENT': `"${ENVIRONMENT}"`, // 'ENVIRONMENT': `"${ENVIRONMENT}"`,
// '__IMGCDN__' : `"${__IMGCDN__}"`, // '__IMGCDN__' : `"${__IMGCDN__}"`,
...@@ -185,8 +185,8 @@ module.exports = { ...@@ -185,8 +185,8 @@ module.exports = {
// optimization: { // optimization: {
// splitChunks: { // splitChunks: {
// chunks: "all", // chunks: "all",
// // minSize: 10000000, // // minSize: 10000000,
// minChunks: 1, // minChunks: 1,
// } // }
// } // }
} }
\ No newline at end of file
...@@ -20,6 +20,7 @@ module.exports = { ...@@ -20,6 +20,7 @@ module.exports = {
'react-router-dom/es', 'react-router-dom/es',
'redux-saga', 'redux-saga',
'path-to-regexp', 'path-to-regexp',
'react-dom/server',
], ],
}, },
output: { output: {
......
...@@ -14,5 +14,9 @@ module.exports = webpackMerge(baseconfig, { ...@@ -14,5 +14,9 @@ module.exports = webpackMerge(baseconfig, {
mode: 'production', mode: 'production',
plugins: [ plugins: [
new CleanWebpackPlugin(), new CleanWebpackPlugin(),
new webpack.DllReferencePlugin({
context: path.resolve(__dirname, '../'),
manifest: require('../lib/vendor-manifest.json'),
}),
], ],
}); });
\ No newline at end of file
...@@ -14,5 +14,9 @@ module.exports = webpackMerge(baseconfig, { ...@@ -14,5 +14,9 @@ module.exports = webpackMerge(baseconfig, {
mode: 'production', mode: 'production',
plugins: [ plugins: [
new CleanWebpackPlugin(), new CleanWebpackPlugin(),
new webpack.DllReferencePlugin({
context: path.resolve(__dirname, '../'),
manifest: require('../lib/vendor-manifest.json'),
}),
], ],
}); });
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment