Commit 51a52df4 authored by wangxuelai's avatar wangxuelai

''

parent 24a68e71
......@@ -26,16 +26,27 @@ class ImagePreview extends React.Component {
const { closeImgPreview } = this.props;
closeImgPreview();
}
goLeft = () => {
this.ref.current.slick.slickPrev();
}
goRight = () => {
this.ref.current.slick.slickNext();
}
render() {
const { currentIndex, urls } = this.props;
const {
currentIndex, urls, dots, slickBtn,
} = this.props;
return (
<div className={`${componentStyle.ImagePreviewBox} ImagePreviewBox`}>
<div className={componentStyle.mask} />
<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
className={componentStyle.Carousel}
ref={this.ref}
draggable
dots={dots !== undefined ? dots : true}
>
{urls.map((ele) => {
return (
......
......@@ -56,6 +56,26 @@
font-size: 30px;
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 {
.ImagePreviewBox {
......
......@@ -374,8 +374,43 @@ export default {
yield put({
type: 'updateState',
payload: {
editLoading: false,
materialVisible: false,
courseVisible: 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: {
title: '',
start_time: '',
......@@ -392,11 +427,33 @@ export default {
status: '',
content: '',
},
editLoading: false,
materialVisible: false,
queryParams: {
type: '',
page: 1,
perPage: 20,
},
materiaList: [],
materiaListTotal: 0,
commentList: [],
commentParams: {
page: 1,
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 {
params: {},
},
});
// yield put({
// type: 'selectCourseList',
// payload: {
// params: {},
// },
// });
yield put({
type: 'coursegatherdetail/pageInit',
});
},
* pageInit({ payload }, { call, put, select }) {
yield put({
type: 'updateState',
payload: {
courseVisible: false,
saveCourseGatherSubmitting: false,
courseList: [],
courseListTotal: 0,
gatherList: [],
gatherListTotal: 0,
gatherQueryParams: {
page: 1,
perPage: 12,
},
},
});
},
......
......@@ -322,6 +322,21 @@ export default {
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: {
save(state, action) {
......
......@@ -857,11 +857,11 @@ export default {
type: 'updateState',
payload: {
courseList: [],
courseListTotal: 0,
courseListParams: {
page: 1,
perPage: 12,
},
courseListTotal: 0,
addCourseObj: {
title: '',
start_time: '',
......@@ -873,17 +873,31 @@ export default {
intro: [
{ type: 'text', value: '' },
],
remark: '',
study_count: '',
status: '',
content: '',
},
addLoading: false,
editLoading: false,
materialVisible: false,
materialVisible2: false,
courseChartData: {},
coursewareInfo: {},
queryParams: {
type: '',
page: 1,
perPage: 20,
},
materiaList: [],
materiaListTotal: 0,
commentList: [],
commentParams: {
page: 1,
perPage: 10,
},
commentListTotal: 0,
coursewareSubmitting: false,
},
});
},
......
......@@ -1035,6 +1035,18 @@ export default {
yield put({
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 }) {
const { pathname } = payload;
......
......@@ -58,8 +58,8 @@ class StaticBox extends React.Component {
};
const courseChart = staticChartInfo;
const dataChart = [];
const month = courseChart.dates;
const visitorCount = courseChart.visitor_count;
const month = courseChart.dates || [];
const visitorCount = courseChart.visitor_count || 0;
for (let i = 0; i < month.length && i < visitorCount.length; i++) {
dataChart.push({ month: month[i], count: visitorCount[i], name: '访问人数' });
}
......
......@@ -243,6 +243,8 @@ class StaticCenter extends React.Component {
urls={this.state.imgUrls}
current={0}
closeImgPreview={this.closeImgPreview}
dots={false}
slickBtn
/>
}
{this.state.videoPlayShow &&
......
......@@ -57,8 +57,8 @@ class StaticBox extends React.Component {
};
const courseChart = courseChartData;
const dataChart = [];
const month = courseChart.dates;
const visitorCount = courseChart.visitor_count;
const month = courseChart.dates || [];
const visitorCount = courseChart.visitor_count || 0;
for (let i = 0; i < month.length && i < visitorCount.length; i++) {
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