Commit c50ab2d7 authored by wangxuelai's avatar wangxuelai

''

parent 2fedd899
......@@ -93,11 +93,17 @@ class UploadCourseware extends React.Component {
const img = new Image();
img.src = videoPoster(src);
img.onload = () => {
document.getElementById('videoposter').setAttribute('src', videoPoster(src));
if (document.getElementById('videoposter')) {
document.getElementById('videoposter').setAttribute('src', videoPoster(src));
}
};
img.onerror = () => {
document.getElementById('videoposter').setAttribute('src', `${__IMGCDN__}course/video_default.png`);
that.reLoadVideoPoster(src);
if (document.getElementById('videoposter')) {
document.getElementById('videoposter').setAttribute('src', `${__IMGCDN__}course/video_default.png`);
}
setTimeout(() => {
that.reLoadVideoPoster(src);
}, 500);
};
}
pptSwiper = (type) => {
......
......@@ -116,6 +116,7 @@ export default {
school_id: sid,
...queryParams,
...params,
trans_status: 2,
});
const { code, msg, data } = querymaterialistData;
if (data.total != undefined) {
......
......@@ -207,15 +207,18 @@ export default {
params = { type: 1, token: userInfo.token, schoolId: sid };
break;
case 2: // 视频
if (file.size > 500 * 1024 * 1024) {
if (file.size > 600 * 1024 * 1024) {
// yield call(uploadMateriaLoading);
yield put({
type: 'updateState',
payload: {
materiaUploading: false,
uploadStatus: {
step: 0, // 1 文件上传中 2 素材转换中 4 保存中
},
},
});
message.error('视频的大小不能超过【40MB】,请重新上传', 1);
message.error('视频的大小不能超过【600MB】,请重新上传', 1);
return;
}
duration = yield call(getVideoDuration, file);
......@@ -224,6 +227,9 @@ export default {
type: 'updateState',
payload: {
materiaUploading: false,
uploadStatus: {
step: 0, // 1 文件上传中 2 素材转换中 4 保存中
},
},
});
// yield call(uploadMateriaLoading);
......@@ -244,6 +250,9 @@ export default {
type: 'updateState',
payload: {
materiaUploading: false,
uploadStatus: {
step: 0, // 1 文件上传中 2 素材转换中 4 保存中
},
},
});
message.error('音频格式不支持,重新上传', 2);
......@@ -262,6 +271,9 @@ export default {
type: 'updateState',
payload: {
materiaUploading: false,
uploadStatus: {
step: 0, // 1 文件上传中 2 素材转换中 4 保存中
},
},
});
message.error('ppt的大小不能超过【40MB】,请重新上传', 1);
......@@ -277,6 +289,9 @@ export default {
type: 'updateState',
payload: {
materiaUploading: false,
uploadStatus: {
step: 0, // 1 文件上传中 2 素材转换中 4 保存中
},
},
});
message.error('pdf的大小不能超过【40MB】,请重新上传', 1);
......
......@@ -78,6 +78,7 @@ export default {
school_id: sid,
...queryParams,
...params,
trans_status: 2,
});
const { code, msg, data } = querymaterialistData;
if (data.total != undefined) {
......
......@@ -74,7 +74,7 @@ export default {
params = { type: 1, token: userInfo.token, schoolId: sid };
break;
case 2: // 视频
if (file.size > 500 * 1024 * 1024) {
if (file.size > 600 * 1024 * 1024) {
// yield call(uploadMateriaLoading);
yield put({
type: 'updateState',
......@@ -82,7 +82,7 @@ export default {
fileUploading: false,
},
});
message.error('视频的大小不能超过【500MB】,请重新上传', 1);
message.error('视频的大小不能超过【600MB】,请重新上传', 1);
return;
}
duration = yield call(getVideoDuration, file);
......
import React from 'react';
import { List, Icon, DatePicker, Form, Card, Button, Menu, Dropdown, Input, Pagination, Row, Col } from 'antd';
import { List, Icon, DatePicker, Form, Card, Button, Menu, Dropdown, Input, Pagination, Row, Col, Popover } from 'antd';
import moment from 'moment';
import pageStyle from './CourseBox.less';
import { imagify } from '../../../utils';
......@@ -90,6 +90,7 @@ class CourseBoxForm extends React.Component {
courseQueryParams,
sizeChange,
onChangeCourseList,
refresh,
} = this.props;
const { getFieldDecorator } = this.props.form;
const formItemModalLineLayout = {
......@@ -173,6 +174,14 @@ class CourseBoxForm extends React.Component {
}
description={
<div>
{item.trans_status == 1 &&
<Popover content={<div>视频转码中,转码成功后课程发布成功,<br />点击&nbsp;<Icon type="sync" className={pageStyle.refresh} />&nbsp;查看转码状态</div>} trigger="hover">
<div className={pageStyle.tranlateStatus}>
<span>转码中</span>
<Icon type="sync" className={pageStyle.refresh} style={{ fontSize: '16px' }} onClick={refresh} />
</div>
</Popover>
}
<span className={pageStyle.itemTime}>{item.created_at}</span>
<div>
<span
......
......@@ -226,3 +226,39 @@
}
}
}
.tranlateStatus {
width: 87px;
height: 28px;
border-radius: 6px 0px 6px 0px;
background-color: #FF646B;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
z-index: 5;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently*/
cursor: pointer;
span {
padding-right: 3px;
}
@keyframes refreshRotate {
from {
transform: rotate(0);
}
to {
transform: rotate(90deg);
}
}
// .refresh:active {
// color: red;
// animation: refreshRotate 0.5s linear;
// }
}
\ No newline at end of file
......@@ -759,6 +759,16 @@ class StaticCenter extends React.Component {
choosedPoster: '',
});
}
refreshCourseList = () => {
const { dispatch } = this.props;
dispatch({
type: 'coursegatherdetail/selectCourseList',
payload: {
params: {
},
},
});
}
courseListSizeChange = (page, perPage) => {
const { dispatch } = this.props;
dispatch({
......@@ -879,6 +889,7 @@ class StaticCenter extends React.Component {
courseQueryParams={courseQueryParams}
sizeChange={this.courseListSizeChange}
onChangeCourseList={this.onChangeCourseList}
refresh={this.refreshCourseList}
/>}
{tabIndex == 2 && <StaticBox
staticTotalInfo={staticTotalInfo}
......
import React from 'react';
import { Icon } from 'antd';
import { Icon, Popover } from 'antd';
import PropTypes from 'prop-types';
import pageStyle from './MediaCard.less';
import {
......@@ -12,6 +12,24 @@ class MediaCard extends React.Component {
super(props);
this.state = {};
}
reLoadVideoPoster = (info) => {
const that = this;
const img = new Image();
img.src = videoPoster(info.src);
img.onload = () => {
if (document.getElementById(`videoposter_${info.id}`)) {
document.getElementById(`videoposter_${info.id}`).setAttribute('src', videoPoster(info.src));
}
};
img.onerror = () => {
if (document.getElementById(`videoposter_${info.id}`)) {
document.getElementById(`videoposter_${info.id}`).setAttribute('src', `${__IMGCDN__}course/video_default.png`);
}
setTimeout(() => {
that.reLoadVideoPoster(info);
}, 500);
};
}
render() {
const {
info,
......@@ -25,6 +43,13 @@ class MediaCard extends React.Component {
}
return (
<div className={pageStyle.box} {...this.props}>
{info.trans_status == 1 && info.type &&
<Popover content={<div>视频转码中,转码成功后可以使用该素材,<br />点击&nbsp;<Icon type="sync" className={pageStyle.refresh} />&nbsp;查看状态</div>} trigger="hover">
<div className={pageStyle.tranlateStatus}>
<span>转码中</span>
<Icon type="sync" className={pageStyle.refresh} style={{ fontSize: '16px' }} onClick={methods.refresh} />
</div>
</Popover>}
{info.type == 1 &&
<div className={`${pageStyle.mediaBox} ${pageStyle.imgBox}`} title={content.name} onClick={() => methods.preview(info)}>
<img className={pageStyle.image} src={`${imagify(info.src, 'image/resize,w_320/format,jpg/quality,q_60')}`} alt="" />
......@@ -32,7 +57,7 @@ class MediaCard extends React.Component {
</div>}
{info.type == 2 &&
<div className={`${pageStyle.mediaBox} ${pageStyle.videoBox}`} title={content.name} onClick={() => methods.preview(info)}>
<img className={pageStyle.videoposter} src={`${videoPoster(info.src)}`} alt="" />
<img className={pageStyle.videoposter} id={`videoposter_${info.id}`} onError={() => this.reLoadVideoPoster(info)} src={`${videoPoster(info.src)}`} alt="" />
<img className={pageStyle.videoicon} src={`${__IMGCDN__}course/video_icon.png`} alt="" />
<div className={pageStyle.videoplay}>
<img className={pageStyle.videoplayicon} src={`${__IMGCDN__}smallplayicon.png`} alt="" />
......
......@@ -2,11 +2,54 @@
border-radius: 8px;
overflow: hidden;
width: 200px;
position: relative;
.tranlateStatus {
width: 87px;
height: 28px;
border-radius: 6px 0px 6px 0px;
background-color: #FF646B;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
z-index: 5;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently*/
cursor: pointer;
span {
padding-right: 3px;
}
@keyframes refreshRotate {
from {
transform: rotate(0);
}
to {
transform: rotate(90deg);
}
}
// .refresh:active {
// color: red;
// animation: refreshRotate 0.5s linear;
// }
}
.mediaBox {
// width: 200px;
height: 164px;
position: relative;;
cursor: pointer;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently*/
&.imgBox {
.imageicon {
width: 35px;
......
......@@ -79,6 +79,16 @@ class StaticCenter extends React.Component {
},
});
}
refresh = () => {
const { dispatch } = this.props;
dispatch({
type: 'coursemateria/querymaterialist',
payload: {
params: {
},
},
});
}
tabClick = (type, tab) => {
const { dispatch } = this.props;
dispatch({
......@@ -261,6 +271,7 @@ class StaticCenter extends React.Component {
methods={{
delmateria: this.delMateria,
preview: this.preview,
refresh: this.refresh,
}}
info={ele}
key={ele.id}
......
......@@ -15,6 +15,7 @@ import {
message,
Modal,
Pagination,
Popover,
} from 'antd';
import pageStyle from './index.less';
import AddCourseModal from './AddCourseModal';
......@@ -142,6 +143,16 @@ class ClassMgtForm extends React.Component {
},
});
}
refresh = () => {
const { dispatch } = this.props;
dispatch({
type: 'onlineclasses/selectCourseList',
payload: {
params: {
},
},
});
}
toUploadCourseWare = (item) => {
const { addCourseObj } = this.props;
let content = null;
......@@ -331,6 +342,14 @@ class ClassMgtForm extends React.Component {
}
description={
<div>
{item.trans_status == 1 &&
<Popover content={<div>视频转码中,转码成功后课程发布成功,<br />点击&nbsp;<Icon type="sync" className={pageStyle.refresh} />&nbsp;查看转码状态</div>} trigger="hover">
<div className={pageStyle.tranlateStatus}>
<span>转码中</span>
<Icon type="sync" className={pageStyle.refresh} style={{ fontSize: '16px' }} onClick={this.refresh} />
</div>
</Popover>
}
<div className={pageStyle.itemTime} onClick={() => this.goEditCourseStatic(item.id, 1)}>{item.created_at}</div>
<div>
<span title={(item.content && JSON.parse(item.content) && JSON.parse(item.content).src) ? JSON.parse(item.content).properties.name : ''} className="hreflink" style={{ paddingRight: '20px', color: '#2194FF', lineHeight: 1 }} onClick={() => this.toUploadCourseWare(item)}>{(item.content && JSON.parse(item.content) && JSON.parse(item.content).src) ? '编辑课件' : '上传课件'}</span>
......
......@@ -149,3 +149,39 @@
display: flex;
justify-content: flex-end;
}
.tranlateStatus {
width: 87px;
height: 28px;
border-radius: 6px 0px 6px 0px;
background-color: #FF646B;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
z-index: 5;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently*/
cursor: pointer;
span {
padding-right: 3px;
}
@keyframes refreshRotate {
from {
transform: rotate(0);
}
to {
transform: rotate(90deg);
}
}
// .refresh:active {
// color: red;
// animation: refreshRotate 0.5s linear;
// }
}
\ 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