Commit a4ac5e12 authored by gongguan's avatar gongguan

奖品图片上传图片操作较快时图片无法保存的bug

parent f6f20e7f
...@@ -41,6 +41,7 @@ Component({ ...@@ -41,6 +41,7 @@ Component({
OBJECT_TYPE, OBJECT_TYPE,
LOWER_TYPE, LOWER_TYPE,
showDialogMask: true, showDialogMask: true,
canSavePrize: true,
dialogTop: "", dialogTop: "",
rankTips: { rankTips: {
status: "success", status: "success",
...@@ -292,9 +293,11 @@ Component({ ...@@ -292,9 +293,11 @@ Component({
}) })
}, },
uploadImage: throttleHandle(async function() { uploadImage: throttleHandle(async function() {
if (!this.data.showDialogMask) return;
try { try {
this.setData({ this.setData({
showDialogMask: false, showDialogMask: false,
canSavePrize: false
}); });
const res = await chooseImage(); const res = await chooseImage();
this.setData({ this.setData({
...@@ -334,10 +337,12 @@ Component({ ...@@ -334,10 +337,12 @@ Component({
image: url, image: url,
}, },
showDialogMask: true, showDialogMask: true,
canSavePrize: true
}); });
} catch (error) { } catch (error) {
this.setData({ this.setData({
showDialogMask: true, showDialogMask: true,
canSavePrize: true
}); });
console.error(error); console.error(error);
} }
...@@ -361,6 +366,13 @@ Component({ ...@@ -361,6 +366,13 @@ Component({
}); });
}, },
updatePrize() { updatePrize() {
if (!this.data.canSavePrize) {
my.showToast({
type: "fail",
content: "请等待图片上传完毕",
});
return
}
const { const {
name, name,
ename, ename,
......
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