|
@@ -73,6 +73,7 @@ Component({
|
|
|
activeObj: {},
|
|
activeObj: {},
|
|
|
followObj: {},
|
|
followObj: {},
|
|
|
workId: 0,
|
|
workId: 0,
|
|
|
|
|
+ _submitting: false,
|
|
|
},
|
|
},
|
|
|
attached() {
|
|
attached() {
|
|
|
// 从存储中拿到之前的对话信息
|
|
// 从存储中拿到之前的对话信息
|
|
@@ -146,6 +147,8 @@ Component({
|
|
|
},
|
|
},
|
|
|
async onSubmit() {
|
|
async onSubmit() {
|
|
|
const submitBtn = this.selectComponent('#submitBtn');
|
|
const submitBtn = this.selectComponent('#submitBtn');
|
|
|
|
|
+ if (this.data._submitting) return;
|
|
|
|
|
+ this.setData({ _submitting: true });
|
|
|
const data = {
|
|
const data = {
|
|
|
thumbnail: [] as any,
|
|
thumbnail: [] as any,
|
|
|
source: [] as any,
|
|
source: [] as any,
|
|
@@ -156,11 +159,13 @@ Component({
|
|
|
console.log('[Analysis] Upload in progress, resetting button');
|
|
console.log('[Analysis] Upload in progress, resetting button');
|
|
|
wx.showToast({ title: `请等待图片上传完毕`, icon: "none" });
|
|
wx.showToast({ title: `请等待图片上传完毕`, icon: "none" });
|
|
|
submitBtn?.resetState();
|
|
submitBtn?.resetState();
|
|
|
|
|
+ this.setData({ _submitting: false });
|
|
|
return;
|
|
return;
|
|
|
} else if (item.required && !this.data.original[index]) {
|
|
} else if (item.required && !this.data.original[index]) {
|
|
|
console.log('[Analysis] Missing required image, resetting button');
|
|
console.log('[Analysis] Missing required image, resetting button');
|
|
|
wx.showToast({ title: `请上传${item.label}`, icon: "none" });
|
|
wx.showToast({ title: `请上传${item.label}`, icon: "none" });
|
|
|
submitBtn?.resetState();
|
|
submitBtn?.resetState();
|
|
|
|
|
+ this.setData({ _submitting: false });
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (this.data.original[index])
|
|
if (this.data.original[index])
|
|
@@ -213,9 +218,10 @@ Component({
|
|
|
console.log('[Analysis] Submit failed, resetting button');
|
|
console.log('[Analysis] Submit failed, resetting button');
|
|
|
wx.showToast({ title: error?.errMsg ?? "提交失败", icon: "none" });
|
|
wx.showToast({ title: error?.errMsg ?? "提交失败", icon: "none" });
|
|
|
submitBtn?.resetState();
|
|
submitBtn?.resetState();
|
|
|
|
|
+ this.setData({ _submitting: false });
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- console.log("对话管家",data)
|
|
|
|
|
|
|
+ // console.log("对话管家",data)
|
|
|
// 对话管家
|
|
// 对话管家
|
|
|
this.getOpenerEventChannel().emit("update", data);
|
|
this.getOpenerEventChannel().emit("update", data);
|
|
|
wx.navigateBack();
|
|
wx.navigateBack();
|