Commit 86568296 by wufan

fix:修复创建直播课上传图片限制

parent c420988c
...@@ -30,7 +30,8 @@ class AddLiveBasic extends React.Component { ...@@ -30,7 +30,8 @@ class AddLiveBasic extends React.Component {
showCutModal: false, showCutModal: false,
courseCatalogList:[], courseCatalogList:[],
showSelectFileModal: false, showSelectFileModal: false,
cutImageBlob: null cutImageBlob: null,
hasImgReady: false // 图片是否上传成功
} }
} }
componentWillUnmount() { componentWillUnmount() {
...@@ -142,6 +143,7 @@ class AddLiveBasic extends React.Component { ...@@ -142,6 +143,7 @@ class AddLiveBasic extends React.Component {
const _dataUrl = this.clip() const _dataUrl = this.clip()
self.setState({ self.setState({
dataUrl: _dataUrl, dataUrl: _dataUrl,
hasImgReady: false // 图片是否上传成功
}) })
}, 100) }, 100)
...@@ -197,7 +199,8 @@ class AddLiveBasic extends React.Component { ...@@ -197,7 +199,8 @@ class AddLiveBasic extends React.Component {
} }
render() { render() {
const { showCutModal, imageFile,courseCatalogList,showSelectFileModal,visible,cutImageBlob} = this.state; const { showCutModal, imageFile,courseCatalogList,showSelectFileModal,visible,cutImageBlob,hasImgReady
} = this.state;
const { data,pageType,isEdit} = this.props; const { data,pageType,isEdit} = this.props;
const { courseName,categoryName,coverUrl} = data; const { courseName,categoryName,coverUrl} = data;
const fileName = ''; const fileName = '';
...@@ -311,6 +314,7 @@ class AddLiveBasic extends React.Component { ...@@ -311,6 +314,7 @@ class AddLiveBasic extends React.Component {
<Button <Button
key="submit" key="submit"
type="primary" type="primary"
disabled={!hasImgReady}
onClick={() => { onClick={() => {
if (!cutFlag) { if (!cutFlag) {
cutFlag = true; cutFlag = 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