Commit 90a9e645 authored by wangxuelai's avatar wangxuelai

''

parent 5efedba0
......@@ -17,6 +17,6 @@
</head>
<body>
<div id="root"></div>
<script src="dist/main.js?1574863280714" charset="utf-8"></script>
<script src="dist/main.js?1574907675933" charset="utf-8"></script>
</body>
</html>
\ No newline at end of file
......@@ -13,6 +13,11 @@ const { Option } = Select;
const { TextArea } = Input;
const { Group } = Radio;
class UploadCourseware extends React.Component {
constructor(props) {
super(props);
this.state = {};
this.ref = React.createRef();
}
componentDidMount() { // 挂载
}
componentDidUpdate() {
......@@ -95,6 +100,13 @@ class UploadCourseware extends React.Component {
that.reLoadVideoPoster(src);
};
}
pptSwiper = (type) => {
if (type == 'prev') {
this.ref.current.slick.slickPrev();
} else if (type == 'next') {
this.ref.current.slick.slickNext();
}
}
render() {
const {
visible,
......@@ -184,20 +196,25 @@ class UploadCourseware extends React.Component {
</div>
}
{(info.mediaType == 4 || info.mediaType == 5) && info.from != 'upload' &&
<Carousel
className={pageStyle.Carousel}
ref={this.ref}
draggable
>
{info.images.map((ele, index) => {
return (
<div className={pageStyle.CarouselBox} key={ele} >
<img className={pageStyle.CarouselImg} alt="" src={pptImagify(ele)} />
</div>
);
})
}
</Carousel>
<div className={pageStyle.CarouselContent}>
<img alt="" src={`${__IMGCDN__}course/arrowleft.png`} className={pageStyle.carouselPrev} onClick={() => this.pptSwiper('prev')} />
<img alt="" src={`${__IMGCDN__}course/arrowright.png`} className={pageStyle.carouselNext} onClick={() => this.pptSwiper('next')} />
<Carousel
className={pageStyle.Carousel}
ref={this.ref}
draggable
lazyLoad
>
{info.images.map((ele, index) => {
return (
<div className={pageStyle.CarouselBox} key={ele} >
<img className={pageStyle.CarouselImg} alt="" src={pptImagify(ele)} />
</div>
);
})
}
</Carousel>
</div>
}
</div>
<div className={pageStyle.uploadbottom}>
......
......@@ -245,4 +245,26 @@
text-align: center;
font-size: 20px;
z-index: 100;
}
.CarouselContent {
position: relative;
&:hover {
.carouselPrev, .carouselNext {
display: block;
}
}
.carouselPrev, .carouselNext {
position: absolute;
width: 41px;
height: 41px;
display: block;
top: 50%;
transform: translateY(-50%);
z-index: 3;
cursor: pointer;
display: none;
}
.carouselNext {
right: 0;
}
}
\ No newline at end of file
......@@ -64,7 +64,7 @@ class StudentAddForm extends React.Component {
} = values;
save({
name,
birthday: values.birthday.format('YYYY-MM-DD') || null,
birthday: values.birthday ? values.birthday.format('YYYY-MM-DD') : null,
avatar,
remark,
mobile,
......@@ -287,10 +287,10 @@ class StudentAddForm extends React.Component {
>
{getFieldDecorator('birthday', {
rules: [
{
required: true,
message: '请输入生日',
},
// {
// required: true,
// message: '请输入生日',
// },
],
})(<DatePicker disabledDate={this.disabledDate} onChange={this.onChange} allowClear style={{ width: 134 }} />)}
<span style={{ marginLeft: 12 }}>年龄:{this.state.cage}</span>
......
......@@ -54,7 +54,7 @@ class StudentAddForm extends React.Component {
} = values;
save({
name,
birthday: values.birthday.format('YYYY-MM-DD') || null,
birthday: values.birthday ? values.birthday.format('YYYY-MM-DD') : null,
avatar,
remark,
mobile,
......@@ -164,7 +164,7 @@ class StudentAddForm extends React.Component {
}}
>
{getFieldDecorator('birthday', {
initialValue: moment(studentsdetail.birthday, 'YYYY-MM-DD'),
initialValue: studentsdetail.birthday ? moment(studentsdetail.birthday, 'YYYY-MM-DD') : null,
rules: [
{
required: true,
......
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