Commit 4d4b2d2d by zhangleyuan

feat:处理上传暖场图限制大小的问题

parent f1f62a01
...@@ -35,6 +35,7 @@ class AddLiveBasic extends React.Component { ...@@ -35,6 +35,7 @@ class AddLiveBasic extends React.Component {
} }
} }
componentWillUnmount() { componentWillUnmount() {
} }
componentDidMount(){ componentDidMount(){
...@@ -281,8 +282,9 @@ class AddLiveBasic extends React.Component { ...@@ -281,8 +282,9 @@ class AddLiveBasic extends React.Component {
onClose={() => this.setState({ showCutModal: false })} onClose={() => this.setState({ showCutModal: false })}
reUpload={() => { this.state.currentInputFile.click() }} reUpload={() => { this.state.currentInputFile.click() }}
/> />
{showSelectFileModal &&
<SelectPrepareFileModal <SelectPrepareFileModal
key="basic"
operateType="select" operateType="select"
multiple={false} multiple={false}
accept="image/jpeg,image/png,image/jpg" accept="image/jpeg,image/png,image/jpg"
...@@ -294,6 +296,7 @@ class AddLiveBasic extends React.Component { ...@@ -294,6 +296,7 @@ class AddLiveBasic extends React.Component {
}} }}
onSelect={this.handleSelectCover} onSelect={this.handleSelectCover}
/> />
}
<Modal <Modal
title="设置图片" title="设置图片"
width={1080} width={1080}
......
...@@ -391,7 +391,9 @@ class AddLiveIntro extends React.Component { ...@@ -391,7 +391,9 @@ class AddLiveIntro extends React.Component {
</div> </div>
</div> </div>
{/* 选择暖场图文件弹窗 */} {/* 选择暖场图文件弹窗 */}
{ showSelectFileModal &&
<SelectPrepareFileModal <SelectPrepareFileModal
key="instro"
operateType="select" operateType="select"
accept={selectType==="INTRO"?"image/jpeg,image/png,image/jpg":"video/mp4,image/jpeg,image/png,image/jpg"} accept={selectType==="INTRO"?"image/jpeg,image/png,image/jpg":"video/mp4,image/jpeg,image/png,image/jpg"}
selectTypeList={ selectType==="INTRO" ? ['JPG', 'JPEG', 'PNG']: ['MP4', 'JPG', 'JPEG', 'PNG'] } selectTypeList={ selectType==="INTRO" ? ['JPG', 'JPEG', 'PNG']: ['MP4', 'JPG', 'JPEG', 'PNG'] }
...@@ -402,6 +404,8 @@ class AddLiveIntro extends React.Component { ...@@ -402,6 +404,8 @@ class AddLiveIntro extends React.Component {
}} }}
onSelect={this.handleSelectVideo} onSelect={this.handleSelectVideo}
/> />
}
</div> </div>
) )
......
...@@ -76,7 +76,17 @@ class SelectPrepareFileModal extends React.Component { ...@@ -76,7 +76,17 @@ class SelectPrepareFileModal extends React.Component {
showNonCompliantFileModal: false, showNonCompliantFileModal: false,
} }
} }
componentDidMount() {
const { diskList = [], currentRootDisk} = this.props;
const _currentRootDisk = diskList[0] || currentRootDisk || defaultRootDisk;
this.setState({
query: defaultQuery,
currentRootDisk: _currentRootDisk,
folderPathList: [_currentRootDisk],
}, () => {
this.handleFetchFolderList();
});
}
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const { diskList = [], currentRootDisk} = nextProps; const { diskList = [], currentRootDisk} = nextProps;
if (nextProps.isOpen) { if (nextProps.isOpen) {
......
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