Complete core mini program flows
ci-cd / verify (push) Successful in 5s
ci-cd / deploy (push) Skipped

This commit is contained in:
2026-10-04 09:26:58 +08:00
parent 5688db4d63
commit c72cf24f56
28 changed files with 490 additions and 65 deletions
+5
View File
@@ -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() {
+1 -1
View File
@@ -59,6 +59,6 @@
<view class="field-label">照顾备注</view>
<textarea value="{{care_notes}}" data-key="care_notes" bindinput="field" />
</view>
<button class="primary" bindtap="save">保存档案</button>
<button class="primary" bindtap="save" disabled="{{saving}}">保存档案</button>
<button wx:if="{{id}}" class="archive" bindtap="archive">归档这只宠物</button>
</view>