Files
sundynix-pets/pets-fe/pages/pets/pets.js
T
Blizzard cb4ffa13e9
ci-cd / verify (push) Successful in 1m31s
ci-cd / deploy (push) Skipped
Add one-way task completion and exportable pet identity cards
2026-10-05 11:32:32 +08:00

23 lines
420 B
JavaScript

const { secure, toast } = require("../../utils/api");
Page({
data: { pets: [] },
onShow() {
this.load();
},
async load() {
try {
this.setData({ pets: await secure("/pets") });
} catch (e) {
toast(e);
}
},
add() {
wx.navigateTo({ url: "/pages/pet-edit/pet-edit" });
},
edit(e) {
wx.navigateTo({
url: "/pages/pet-edit/pet-edit?id=" + e.detail.id,
});
},
});