update
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-07-19 19:03:30 +08:00
parent cab39ebbe0
commit 94cf94bb2f

View File

@@ -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();
};
</script>