dev_hjm
hjm 6 years ago
parent 908f16c190
commit 855fd745bf

@ -9,6 +9,8 @@ import { Button } from 'antd'
import { getUploader } from './AliyunUploaderManager' import { getUploader } from './AliyunUploaderManager'
import { reducer, initialState } from './VideoReducer' import { reducer, initialState } from './VideoReducer'
import { deleteVideoInCloud } from './VideoUtil' import { deleteVideoInCloud } from './VideoUtil'
import uploadIcon from './images/upload.png'
let uploader let uploader
const files = [] const files = []
const MAX_FILE_COUNT = 3 const MAX_FILE_COUNT = 3
@ -186,6 +188,8 @@ function VideoUploadList (props) {
dispatch({type: 'updateTitle', title, index}) dispatch({type: 'updateTitle', title, index})
} }
// login // login
const noUploads = (!state.videoes || state.videoes.length == 0);
const protocolLine = <div>上传视频即表示您已同意<span style={{color: theme.foreground_select}}>上传内容协议</span></div>
return ( return (
<div className="educontent videoUploadList" style={{ marginBottom: '200px' }}> <div className="educontent videoUploadList" style={{ marginBottom: '200px' }}>
<style>{` <style>{`
@ -194,10 +198,15 @@ function VideoUploadList (props) {
padding: 16px 20px; padding: 16px 20px;
padding-top: 0px; padding-top: 0px;
position: relative; position: relative;
padding-bottom: 36px;
} }
.videoUploadList .cBreadcrumb { .videoUploadList .cBreadcrumb {
margin-top: 16px; margin-top: 16px;
} }
.videoUploadList .title {
margin-bottom: 4px;
}
.videoUploadList .title .head { .videoUploadList .title .head {
display: inline-block; display: inline-block;
margin-right: 8px; margin-right: 8px;
@ -209,10 +218,20 @@ function VideoUploadList (props) {
padding-top: 10px; padding-top: 10px;
margin-top: 20px; margin-top: 20px;
margin-bottom: 30px; margin-bottom: 30px;
color: #777;
}
.videoUploadList .section .description.noUploads {
text-align: 'center';
} }
.videoUploadList .publishBtn { .videoUploadList .publishBtn {
padding: 0 16px padding: 0 16px
} }
.videoUploadList .publishRow .publishBtn {
padding: 6px 24px;
height: auto;
}
.videoUploadList .addVideoBtn { .videoUploadList .addVideoBtn {
position: absolute; position: absolute;
right: 30px; right: 30px;
@ -225,6 +244,10 @@ function VideoUploadList (props) {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.noUploads {
text-align: center;
}
/* item */ /* item */
@ -259,6 +282,18 @@ function VideoUploadList (props) {
</div> </div>
<div className="section"> <div className="section">
{/* noUploads */}
{noUploads && <div className="noUploads" style={{paddingTop: '72px'}}>
<img src={uploadIcon} onClick={() => document.getElementById('fileUpload').click()}></img>
<div style={{
color: '#000000',
fontSize: '18px',
fontWeight: 'bold',
marginBottom: '20px'
}}>选择您要上传的视频</div>
{protocolLine}
</div>}
<div> <div>
{state.videoes.map((item, vIndex) => { {state.videoes.map((item, vIndex) => {
return ( return (
@ -276,28 +311,37 @@ function VideoUploadList (props) {
<i className="iconfont icon-tishi" style={{color: '#FF6F6F', verticalAlign: 'text-bottom'}}></i> <i className="iconfont icon-tishi" style={{color: '#FF6F6F', verticalAlign: 'text-bottom'}}></i>
<span>单次最多支持3个视频文件上传</span> <span>单次最多支持3个视频文件上传</span>
</div>} </div>}
<div className="description">
{!noUploads && <ActionBtn className="publishBtn" onClick={() => document.getElementById('fileUpload').click()}
>继续添加</ActionBtn>}
<div className={`description ${noUploads ? 'noUploads' : ''}`}>
<div className="">视频大小不支持断点续传单个视频文件最大200M单次最多支持3个视频文件上传 </div> <div className="">视频大小不支持断点续传单个视频文件最大200M单次最多支持3个视频文件上传 </div>
<div className="">视频规格aviflvf4vm4vmovmp4rmvbswfwebm </div> <div className="">视频规格aviflvf4vm4vmovmp4rmvbswfwebm </div>
<div className="">温馨提示请勿上传违法视频平台将为每一个视频分配一个地址您可以通过引用改地址将视频使用在开发社区等模块</div> <div className="">温馨提示请勿上传违法视频平台将为每一个视频分配一个地址您可以通过引用改地址将视频使用在开发社区等模块</div>
</div> </div>
{(!state.videoes || state.videoes.length < MAX_FILE_COUNT) && <Button type="primary" icon="plus-square" {!noUploads && <React.Fragment>
{/* {(state.videoes.length < MAX_FILE_COUNT) && <Button type="primary" icon="plus-square"
onClick={() => { document.getElementById('fileUpload').click()}} onClick={() => { document.getElementById('fileUpload').click()}}
className="fr addVideoBtn" className="fr addVideoBtn"
> >
添加更多视频 添加更多视频
</Button>} </Button>} */}
<input type="file" id="fileUpload" style={{display: 'none'}} onChange={onUploadChange}
accept="video/*"
></input>
<div style={{}} className="publishRow"> <div style={{}} className="publishRow">
<ActionBtn className="publishBtn" onClick={() => onPublish()} <ActionBtn className="publishBtn" onClick={() => onPublish()}
>立即发布</ActionBtn> >立即发布</ActionBtn>
<div>上传视频即表示您已同意<span style={{color: theme.foreground_select}}>上传内容协议</span></div> {protocolLine}
</div> </div>
</React.Fragment>}
</div> </div>
<input type="file" id="fileUpload" style={{display: 'none'}} onChange={onUploadChange}
accept="video/*"
></input>
</div> </div>
) )
} }

Loading…
Cancel
Save