|
|
|
@ -10,6 +10,7 @@ import { getUploader } from './AliyunUploaderManager'
|
|
|
|
|
import { reducer, initialState } from './VideoReducer'
|
|
|
|
|
import { deleteVideoInCloud } from './VideoUtil'
|
|
|
|
|
import uploadIcon from './images/upload.png'
|
|
|
|
|
import uploadHoverIcon from './images/upload_hover.png'
|
|
|
|
|
|
|
|
|
|
let uploader
|
|
|
|
|
const files = []
|
|
|
|
@ -167,21 +168,29 @@ function VideoUploadList (props) {
|
|
|
|
|
const _input = document.getElementById('fileUpload')
|
|
|
|
|
_input.value = ''
|
|
|
|
|
}
|
|
|
|
|
// uploader.deleteFile(index);
|
|
|
|
|
function cancelUpload(index, isSuccess) {
|
|
|
|
|
// TODO 确定取消?
|
|
|
|
|
function doDelete(index, isSuccess) {
|
|
|
|
|
uploader.deleteFile(index)
|
|
|
|
|
// uploader.cancelFile(index)
|
|
|
|
|
if (isSuccess) {
|
|
|
|
|
deleteVideoInCloud(username, state.videoes[index].videoId)
|
|
|
|
|
}
|
|
|
|
|
// else {
|
|
|
|
|
// uploader.cancelFile(index)
|
|
|
|
|
// }
|
|
|
|
|
clearInput()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clearInput()
|
|
|
|
|
dispatch({type: 'removeVideo', index})
|
|
|
|
|
// setVideoes([...videoes.splice(index, 1)])
|
|
|
|
|
}
|
|
|
|
|
// uploader.deleteFile(index);
|
|
|
|
|
function cancelUpload(index, isSuccess) {
|
|
|
|
|
props.confirm({
|
|
|
|
|
content: <div>
|
|
|
|
|
<div>您确认要{isSuccess ? '删除' : '取消上传'}该视频吗?</div>
|
|
|
|
|
</div>,
|
|
|
|
|
onOk: () => {
|
|
|
|
|
doDelete(index, isSuccess)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function onPublish() {
|
|
|
|
|
if (state.videoes.length == 0) {
|
|
|
|
|
showNotification('请先上传视频')
|
|
|
|
@ -291,6 +300,26 @@ function VideoUploadList (props) {
|
|
|
|
|
border-bottom: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.noUploads img {
|
|
|
|
|
width: 64px;
|
|
|
|
|
height: 48px;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.noUploads .uploadHoverIcon {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
.noUploads .imgWrap:hover .uploadHoverIcon {
|
|
|
|
|
display: inline;
|
|
|
|
|
}
|
|
|
|
|
.noUploads .imgWrap:hover .uploadIcon {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
.noUploads .imgWrap {
|
|
|
|
|
width: 72px;
|
|
|
|
|
height: 54px;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
`}</style>
|
|
|
|
|
<CBreadcrumb
|
|
|
|
|
className="mb26"
|
|
|
|
@ -308,8 +337,13 @@ function VideoUploadList (props) {
|
|
|
|
|
|
|
|
|
|
<div className="section">
|
|
|
|
|
{/* noUploads */}
|
|
|
|
|
{noUploads && <div className="noUploads" style={{paddingTop: '72px'}}>
|
|
|
|
|
<img src={uploadIcon} onClick={() => document.getElementById('fileUpload').click()}></img>
|
|
|
|
|
{noUploads && <div className="noUploads" style={{paddingTop: '72px'}} >
|
|
|
|
|
<div className="imgWrap" onClick={() => document.getElementById('fileUpload').click()}>
|
|
|
|
|
<img className="uploadIcon" src={uploadIcon} ></img>
|
|
|
|
|
<img className="uploadHoverIcon" src={uploadHoverIcon} ></img>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div style={{
|
|
|
|
|
color: '#000000',
|
|
|
|
|
fontSize: '18px',
|
|
|
|
|