Commit 51a52df4 authored by wangxuelai's avatar wangxuelai

''

parent 24a68e71
...@@ -26,16 +26,27 @@ class ImagePreview extends React.Component { ...@@ -26,16 +26,27 @@ class ImagePreview extends React.Component {
const { closeImgPreview } = this.props; const { closeImgPreview } = this.props;
closeImgPreview(); closeImgPreview();
} }
goLeft = () => {
this.ref.current.slick.slickPrev();
}
goRight = () => {
this.ref.current.slick.slickNext();
}
render() { render() {
const { currentIndex, urls } = this.props; const {
currentIndex, urls, dots, slickBtn,
} = this.props;
return ( return (
<div className={`${componentStyle.ImagePreviewBox} ImagePreviewBox`}> <div className={`${componentStyle.ImagePreviewBox} ImagePreviewBox`}>
<div className={componentStyle.mask} /> <div className={componentStyle.mask} />
<Icon type="close-circle" className={componentStyle.closeIcon} onClick={this.closeImgPreview} /> <Icon type="close-circle" className={componentStyle.closeIcon} onClick={this.closeImgPreview} />
{slickBtn && <Icon type="left-circle" className={componentStyle.leftIcon} onClick={this.goLeft} />}
{slickBtn && <Icon type="right-circle" className={componentStyle.rightIcon} onClick={this.goRight} />}
<Carousel <Carousel
className={componentStyle.Carousel} className={componentStyle.Carousel}
ref={this.ref} ref={this.ref}
draggable draggable
dots={dots !== undefined ? dots : true}
> >
{urls.map((ele) => { {urls.map((ele) => {
return ( return (
......
...@@ -56,6 +56,26 @@ ...@@ -56,6 +56,26 @@
font-size: 30px; font-size: 30px;
cursor: pointer; cursor: pointer;
} }
.leftIcon {
position: absolute;
top: 50%;
left: 100px;
color: #fff;
z-index: 10;
transform: translateY(-50%);
font-size: 50px;
cursor: pointer;
}
.rightIcon {
position: absolute;
top: 50%;
right: 100px;
color: #fff;
z-index: 10;
font-size: 50px;
transform: translateY(-50%);
cursor: pointer;
}
} }
:global { :global {
.ImagePreviewBox { .ImagePreviewBox {
......
...@@ -374,8 +374,43 @@ export default { ...@@ -374,8 +374,43 @@ export default {
yield put({ yield put({
type: 'updateState', type: 'updateState',
payload: { payload: {
editLoading: false, courseVisible: false,
materialVisible: false, saveCourseGatherSubmitting: false,
courseList: [],
courseListTotal: 0,
gatherList: [],
gatherListTotal: 0,
id: 0,
tabIndex: 1,
courseQueryParams: {
page: 1,
perPage: 12,
},
manageCourseQueryParams: {
page: 1,
perPage: 10,
},
manageCourseList: [],
manageCourseShow: false,
manageCourseLoading: false,
manageCourseListTotal: 0,
manageCourseObj: {},
gatherDetail: {},
allCourseList: [],
allCourseListTotal: 0,
courseIds: [],
copyCourseIds: [],
addCourseShow: false,
addCourseSubmitting: false,
staticTotalId: 0,
staticChartId: 0,
staticTotalInfo: {},
staticChartInfo: {},
allRelativeCourseList: [],
queryChartParams: {
start: '',
end: '',
},
addCourseObj: { addCourseObj: {
title: '', title: '',
start_time: '', start_time: '',
...@@ -392,11 +427,33 @@ export default { ...@@ -392,11 +427,33 @@ export default {
status: '', status: '',
content: '', content: '',
}, },
editLoading: false,
materialVisible: false,
queryParams: {
type: '',
page: 1,
perPage: 20,
},
materiaList: [],
materiaListTotal: 0,
commentList: [], commentList: [],
commentParams: { commentParams: {
page: 1, page: 1,
perPage: 10, perPage: 10,
}, },
materiaSaveTo: 1, // 1是专栏封面 // 2 批量操作的课程封面
manageCourseSubmitting: false,
isEditSingleCourse: false,
editSingleCourseId: 0,
editSingleCourseInfo: {
id: 0,
title: '',
start_time: null,
cover: '',
content: '',
},
saveSingleCourseSubmitting: false,
coursewareSubmitting: false,
}, },
}); });
}, },
......
...@@ -37,17 +37,24 @@ export default { ...@@ -37,17 +37,24 @@ export default {
params: {}, params: {},
}, },
}); });
// yield put({ yield put({
// type: 'selectCourseList', type: 'coursegatherdetail/pageInit',
// payload: { });
// params: {},
// },
// });
}, },
* pageInit({ payload }, { call, put, select }) { * pageInit({ payload }, { call, put, select }) {
yield put({ yield put({
type: 'updateState', type: 'updateState',
payload: { payload: {
courseVisible: false,
saveCourseGatherSubmitting: false,
courseList: [],
courseListTotal: 0,
gatherList: [],
gatherListTotal: 0,
gatherQueryParams: {
page: 1,
perPage: 12,
},
}, },
}); });
}, },
......
...@@ -322,6 +322,21 @@ export default { ...@@ -322,6 +322,21 @@ export default {
message.error(msg, 1); message.error(msg, 1);
} }
}, },
* pageInit({ payload }, { call, put, select }) {
yield put({
type: 'updateState',
payload: {
queryParams: {
type: '',
page: 1,
perPage: 20,
},
materiaList: [],
materiaListTotal: 0,
tabIndex: 0,
},
});
},
}, },
reducers: { reducers: {
save(state, action) { save(state, action) {
......
...@@ -857,11 +857,11 @@ export default { ...@@ -857,11 +857,11 @@ export default {
type: 'updateState', type: 'updateState',
payload: { payload: {
courseList: [], courseList: [],
courseListTotal: 0,
courseListParams: { courseListParams: {
page: 1, page: 1,
perPage: 12, perPage: 12,
}, },
courseListTotal: 0,
addCourseObj: { addCourseObj: {
title: '', title: '',
start_time: '', start_time: '',
...@@ -873,17 +873,31 @@ export default { ...@@ -873,17 +873,31 @@ export default {
intro: [ intro: [
{ type: 'text', value: '' }, { type: 'text', value: '' },
], ],
remark: '',
study_count: '',
status: '',
content: '',
}, },
addLoading: false, addLoading: false,
editLoading: false, editLoading: false,
materialVisible: false, materialVisible: false,
materialVisible2: false,
courseChartData: {}, courseChartData: {},
coursewareInfo: {},
queryParams: {
type: '',
page: 1,
perPage: 20,
},
materiaList: [],
materiaListTotal: 0,
commentList: [], commentList: [],
commentParams: { commentParams: {
page: 1, page: 1,
perPage: 10, perPage: 10,
}, },
commentListTotal: 0, commentListTotal: 0,
coursewareSubmitting: false,
}, },
}); });
}, },
......
...@@ -1035,6 +1035,18 @@ export default { ...@@ -1035,6 +1035,18 @@ export default {
yield put({ yield put({
type: 'analyzecenter/pageInit', type: 'analyzecenter/pageInit',
}); });
yield put({
type: 'coursemateria/pageInit',
});
yield put({
type: 'coursegatherindex/pageInit',
});
yield put({
type: 'coursegatherdetail/pageInit',
});
yield put({
type: 'onlineclasses/pageInit',
});
}, },
* onPageEnter({ payload }, { put, call, select }) { * onPageEnter({ payload }, { put, call, select }) {
const { pathname } = payload; const { pathname } = payload;
......
...@@ -58,8 +58,8 @@ class StaticBox extends React.Component { ...@@ -58,8 +58,8 @@ class StaticBox extends React.Component {
}; };
const courseChart = staticChartInfo; const courseChart = staticChartInfo;
const dataChart = []; const dataChart = [];
const month = courseChart.dates; const month = courseChart.dates || [];
const visitorCount = courseChart.visitor_count; const visitorCount = courseChart.visitor_count || 0;
for (let i = 0; i < month.length && i < visitorCount.length; i++) { for (let i = 0; i < month.length && i < visitorCount.length; i++) {
dataChart.push({ month: month[i], count: visitorCount[i], name: '访问人数' }); dataChart.push({ month: month[i], count: visitorCount[i], name: '访问人数' });
} }
......
...@@ -243,6 +243,8 @@ class StaticCenter extends React.Component { ...@@ -243,6 +243,8 @@ class StaticCenter extends React.Component {
urls={this.state.imgUrls} urls={this.state.imgUrls}
current={0} current={0}
closeImgPreview={this.closeImgPreview} closeImgPreview={this.closeImgPreview}
dots={false}
slickBtn
/> />
} }
{this.state.videoPlayShow && {this.state.videoPlayShow &&
......
...@@ -57,8 +57,8 @@ class StaticBox extends React.Component { ...@@ -57,8 +57,8 @@ class StaticBox extends React.Component {
}; };
const courseChart = courseChartData; const courseChart = courseChartData;
const dataChart = []; const dataChart = [];
const month = courseChart.dates; const month = courseChart.dates || [];
const visitorCount = courseChart.visitor_count; const visitorCount = courseChart.visitor_count || 0;
for (let i = 0; i < month.length && i < visitorCount.length; i++) { for (let i = 0; i < month.length && i < visitorCount.length; i++) {
dataChart.push({ month: month[i], count: visitorCount[i], name: '访问人数' }); dataChart.push({ month: month[i], count: visitorCount[i], name: '访问人数' });
} }
......
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