feat: 最後量測時間

This commit is contained in:
skytek_xinliang
2026-09-16 09:29:54 +08:00
parent 56dfb84890
commit 057bd335d6
4 changed files with 33 additions and 5 deletions
+6 -1
View File
@@ -143,6 +143,7 @@
:error="physicalFitnessError"
:items="physicalFitnessItems"
:loading="physicalFitnessLoading"
:received-at="physicalFitnessReceivedAt"
@refresh="loadPhysicalFitness"
/>
@@ -424,6 +425,7 @@ const generatePhysicalFitnessLoading = ref(false);
const generateResult = ref("");
const generateError = ref("");
const physicalFitnessItems = ref<PhysicalFitnessItem[]>([]);
const physicalFitnessReceivedAt = ref<string | null>(null);
const physicalFitnessLoading = ref(false);
const physicalFitnessError = ref("");
const redirectingToLogin = ref(false);
@@ -507,6 +509,7 @@ function getRequiredUserID(): string | null {
async function loadPhysicalFitness() {
if (!store.isLoggedIn) {
physicalFitnessItems.value = [];
physicalFitnessReceivedAt.value = null;
physicalFitnessError.value = "";
return;
}
@@ -520,7 +523,9 @@ async function loadPhysicalFitness() {
physicalFitnessError.value = "";
try {
physicalFitnessItems.value = await fetchPhysicalFitness(userID);
const physicalFitnessResponse = await fetchPhysicalFitness(userID);
physicalFitnessItems.value = physicalFitnessResponse.results;
physicalFitnessReceivedAt.value = physicalFitnessResponse.ReceivedAt;
updateTodayTimeString();
} catch (error) {
physicalFitnessError.value = getApiErrorMessage(