From 29886b4fc9c5a0bbe8b1037dcd6e562d06d79ab8 Mon Sep 17 00:00:00 2001 From: kron Date: Tue, 29 Jul 2025 11:12:51 +0800 Subject: [PATCH] fix bug --- src/apis.js | 2 +- src/components/ScrollList.vue | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/apis.js b/src/apis.js index bcc0a25..32df37c 100644 --- a/src/apis.js +++ b/src/apis.js @@ -346,7 +346,7 @@ export const payOrderAPI = (id) => { }; export const getOrderListAPI = async (page) => { - const reuslt = await request("GET", `/user/order/list?page${page}`); + const reuslt = await request("GET", `/user/order/list?page=${page}`); return reuslt.items || []; }; diff --git a/src/components/ScrollList.vue b/src/components/ScrollList.vue index 5f042f0..5dd1708 100644 --- a/src/components/ScrollList.vue +++ b/src/components/ScrollList.vue @@ -23,19 +23,19 @@ const refresherrefresh = async () => { try { refreshing.value = true; page.value = 1; - const list = await props.onLoading(page.value); - if (list.length < props.pageSize) noMore.value = true; + const length = await props.onLoading(page.value); + if (length < props.pageSize) noMore.value = true; } finally { refreshing.value = false; } }; const scrolltolower = async () => { - if (loading.value) return; + if (loading.value || noMore.value) return; try { loading.value = true; page.value += 1; - const list = await props.onLoading(page.value); - if (list.length < props.pageSize) noMore.value = true; + const length = await props.onLoading(page.value); + if (length < props.pageSize) noMore.value = true; } finally { loading.value = false; }