Commit 75061134 by wufan

fix:优化传文件到oss

parent 9349a9c6
......@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-11-30 10:47:38
* @LastEditors: wufan
* @LastEditTime: 2020-12-24 13:37:32
* @LastEditTime: 2020-12-24 18:33:10
* @Description: web店铺banner页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -49,6 +49,7 @@ class StoreWebDecoration extends React.Component {
diskList: [],
photoclip: null,
preview: "",
cutImageBlob: null
};
}
......@@ -229,8 +230,10 @@ class StoreWebDecoration extends React.Component {
jpgFillColor: "transparent",
},
done: (dataUrl) => {
const cutImage = this.convertBase64UrlToBlob(dataUrl);
this.getSignature(cutImage, fileName);
const cutImageBlob = this.convertBase64UrlToBlob(dataUrl);
this.setState({
cutImageBlob
})
setTimeout(() => {
cutFlag = false;
}, 2000);
......@@ -272,6 +275,11 @@ class StoreWebDecoration extends React.Component {
(addBannerPath) => {
this.setState({
addBannerPath,
visible: false
},()=>{
this.state.choosedBannerId
? this.editStoreBanner()
: this.addStoreBanner();
});
}
);
......@@ -332,6 +340,7 @@ class StoreWebDecoration extends React.Component {
showSelectFileModal,
diskList,
visible,
cutImageBlob
} = this.state;
const DraggableContainer = (props) => (
<SortableContainer
......@@ -414,10 +423,7 @@ class StoreWebDecoration extends React.Component {
cutFlag = true;
this.refs.hiddenBtn.click();
}
this.setState({ visible: false });
this.state.choosedBannerId
? this.editStoreBanner()
: this.addStoreBanner();
this.getSignature(cutImageBlob);
}}
>
确定
......
......@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-11-30 10:47:38
* @LastEditors: wufan
* @LastEditTime: 2020-12-24 13:38:10
* @LastEditTime: 2020-12-24 18:30:46
* @Description: web店铺banner页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -49,6 +49,7 @@ class StoreWebDecoration extends React.Component {
diskList: [],
photoclip: null,
preview: "",
cutImageBlob: null
};
}
......@@ -228,8 +229,10 @@ class StoreWebDecoration extends React.Component {
jpgFillColor: "transparent",
},
done: (dataUrl) => {
const cutImage = this.convertBase64UrlToBlob(dataUrl);
this.getSignature(cutImage, fileName);
const cutImageBlob = this.convertBase64UrlToBlob(dataUrl);
this.setState({
cutImageBlob
})
setTimeout(() => {
cutFlag = false;
}, 2000);
......@@ -268,6 +271,11 @@ class StoreWebDecoration extends React.Component {
(addBannerPath) => {
this.setState({
addBannerPath,
visible: false
},()=>{
this.state.choosedBannerId
? this.editStoreBanner()
: this.addStoreBanner();
});
}
);
......@@ -330,6 +338,7 @@ class StoreWebDecoration extends React.Component {
showSelectFileModal,
diskList,
visible,
cutImageBlob
} = this.state;
const DraggableContainer = (props) => (
<SortableContainer
......@@ -412,10 +421,7 @@ class StoreWebDecoration extends React.Component {
cutFlag = true;
this.refs.hiddenBtn.click();
}
this.setState({ visible: false });
this.state.choosedBannerId
? this.editStoreBanner()
: this.addStoreBanner();
this.getSignature(cutImageBlob);
}}
>
确定
......
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