diff --git a/src/pages/bet_record/index.vue b/src/pages/bet_record/index.vue index 15d0b04..25eac06 100644 --- a/src/pages/bet_record/index.vue +++ b/src/pages/bet_record/index.vue @@ -92,7 +92,7 @@ const data = ref([]); const page = ref({ page: 1, - size: 10, + size: 20, total: 0, }); @@ -104,16 +104,14 @@ Taro.useDidShow(() => { getList(); }); -Taro.useReachBottom(async () => { - if (page.value.page * page.value.size >= page.value.total) { - Taro.showToast({ +Taro.useReachBottom(() => { + if (page.value.total === data.value.length) + return Taro.showToast({ title: "没有更多了", icon: "none", }); - return; - } page.value.page++; - await getList(); + getList(); }); const getList = async () => { @@ -137,7 +135,7 @@ const getList = async () => { periods_num: item.PeriodsNum, })) || []; data.value.push(...arr); - page.value.total = res.data.total || 0; + page.value.total = res.total; Taro.hideLoading(); };