fix: issues

This commit is contained in:
Rogee
2024-12-15 01:48:25 +08:00
parent 5da2894283
commit 77a3bd6af8
3 changed files with 13 additions and 11 deletions

View File

@@ -3,8 +3,8 @@
<van-back-top bottom="80" />
<van-list style="padding-bottom: 3em" v-model:loading="loading" :finished="finished" finished-text="没有更多了"
offset="100" @load="loadData">
<van-list style="padding-bottom: 3em" v-model:loading="loading" :finished="finished"
:finished-text="bought ? '您还没有购买' : '没有更多了'" offset="100" @load="loadData">
<list-item-card v-for="item in items" :key="item" :item="item" :bought="bought" />
</van-list>
</template>
@@ -55,16 +55,17 @@ export default defineComponent({
return;
}
if (res.data.length < pageLimit.value) {
finished.value = true;
}
if (offset.value == "") {
items.value = res.data;
} else {
items.value = items.value.concat(res.data);
}
offset.value = res.data[res.data.length - 1].hash;
offset.value = res.data[res.data.length - 1]?.hash;
if (res.data.length < pageLimit.value) {
finished.value = true;
}
})
.catch((err) => {
console.error("ERROR", err);