From 9a61e46d96536f3299e57f7259ae1c9972256ec6 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 30 九月 2025 09:42:09 +0800
Subject: [PATCH] 1. 隐藏未完成的账户匹配页面 2. 根据第三方新的接口文档修改接口url地址
---
src/composables/fetchData.js | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/src/composables/fetchData.js b/src/composables/fetchData.js
index 3598753..4b5458e 100644
--- a/src/composables/fetchData.js
+++ b/src/composables/fetchData.js
@@ -1,13 +1,13 @@
// 鎺ュ彛鏁版嵁鐨勮幏鍙�
-import { onActivated, onDeactivated, ref, watch } from 'vue';
+import { ref, watch, computed } from 'vue';
-export function useFetchData(fetch) {
+export function useFetchData() {
// 鍒嗛〉淇℃伅
- const currentPage = ref(1);
- const totalPage = ref(1);
+ const page = ref(1);
+ const pageNum = ref(1);
const pageSize = ref(20);
const total = ref(0);
- watch(currentPage, (nValue, oValue) => {
+ watch(page, (nValue, oValue) => {
if (nValue != oValue) {
fetchData();
}
@@ -21,14 +21,20 @@
// 鍔犺浇鐘舵��, 0: 鍔犺浇瀹屾垚; 1: 鍔犺浇涓�; 2: 宸插叏閮ㄥ姞杞�; 3: 鍔犺浇澶辫触;
const loadStatus = ref(0);
+ const loading = computed(() => {
+ return loadStatus.value == 1;
+ });
+
// 鏁版嵁鑾峰彇
- function fetchData() {
+ function fetchData(fetch) {
loadStatus.value = 1;
- fetch(currentPage.value, pageSize.value)
+ fetch(page.value, pageSize.value)
.then((pageInfo) => {
- currentPage.value = pageInfo.currentPage;
- totalPage.value = pageInfo.totalPage;
- total.value = pageInfo.total;
+ if (pageInfo) {
+ page.value = pageInfo.page ? pageInfo.page : 1;
+ pageNum.value = pageInfo.pageNum ? pageInfo.pageNum : 1;
+ total.value = pageInfo.total ? pageInfo.total : 0;
+ }
loadStatus.value = 0;
})
@@ -40,5 +46,5 @@
});
}
- return {currentPage, totalPage, pageSize, total, loadStatus, fetchData}
+ return { page, pageNum, pageSize, total, loadStatus, loading, fetchData };
}
--
Gitblit v1.9.3