Complete core mini program flows
This commit is contained in:
@@ -12,6 +12,7 @@ Page({
|
||||
care_notes: "",
|
||||
avatar_file_id: "",
|
||||
avatar_url: "",
|
||||
saving: false,
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.id) {
|
||||
@@ -45,6 +46,7 @@ Page({
|
||||
}
|
||||
},
|
||||
async save() {
|
||||
if (this.data.saving) return;
|
||||
if (!this.data.name.trim()) {
|
||||
wx.showToast({ title: "请输入名字", icon: "none" });
|
||||
return;
|
||||
@@ -61,6 +63,7 @@ Page({
|
||||
care_notes: this.data.care_notes,
|
||||
avatar_file_id: this.data.avatar_file_id || null,
|
||||
};
|
||||
this.setData({ saving: true });
|
||||
try {
|
||||
await secure(
|
||||
"/pets" + (this.data.id ? "/" + this.data.id : ""),
|
||||
@@ -70,6 +73,8 @@ Page({
|
||||
wx.navigateBack();
|
||||
} catch (e) {
|
||||
toast(e);
|
||||
} finally {
|
||||
this.setData({ saving: false });
|
||||
}
|
||||
},
|
||||
async archive() {
|
||||
|
||||
Reference in New Issue
Block a user