update:优化金币

This commit is contained in:
2026-08-20 16:10:17 +08:00
parent 42cfb5c3d8
commit 45957d04b1
14 changed files with 247 additions and 39 deletions
+14 -1
View File
@@ -8,6 +8,7 @@ import CoinEmptyState from "./components/CoinEmptyState.vue";
import { getGoldLogAPI } from "@/apis";
const PAGE_SIZE = 20;
const storeId = ref("");
const exchangeRecords = ref([]);
const page = ref(0);
const total = ref(0);
@@ -61,6 +62,7 @@ const loadRecords = async ({ reset = false } = {}) => {
page: nextPage,
pageSize: PAGE_SIZE,
type: 2,
storeId: storeId.value,
});
const list = Array.isArray(result?.list) ? result.list : [];
const mappedList = list.map(formatRecord);
@@ -80,7 +82,18 @@ const loadRecords = async ({ reset = false } = {}) => {
}
};
onLoad(() => loadRecords({ reset: true }));
onLoad((options = {}) => {
const currentStoreId = String(options.storeId || "");
if (!/^\d+$/.test(currentStoreId) || Number(currentStoreId) <= 0) {
uni.redirectTo({
url: "/pages/coin/nearby-stores",
});
return;
}
storeId.value = currentStoreId;
loadRecords({ reset: true });
});
</script>
<template>