fix: 订阅历史记录不请求后端

This commit is contained in:
machine
2024-10-21 22:44:15 +08:00
parent ee8b57da91
commit 7a97005524
@@ -42,6 +42,7 @@ const progressText = ref('正在重新订阅...')
// 调用API查询列表
async function loadHistory({ done }: { done: any }) {
console.log('🚀 ~ loadHistory ~ loadHistory:', loadHistory)
// 如果正在加载中,直接返回
if (loading.value) {
done('ok')
@@ -52,6 +53,15 @@ async function loadHistory({ done }: { done: any }) {
try {
// 设置加载中
loading.value = true
const url = `subscribe/history/${props.type}`
const params = {
params: {
page: currentPage.value,
count: pageSize.value,
},
}
console.log('history url:', url)
console.log('history params:', params)
currData.value = await api.get(`subscribe/history/${props.type}`, {
params: {
page: currentPage.value,
@@ -145,12 +155,14 @@ const dropdownItems = ref([
}
"
/>
<VList lines="two" v-if="historyList.length > 0">
<!-- <VList lines="two" v-if="historyList.length > 0"> -->
<VList lines="two">
<VInfiniteScroll mode="intersect" side="end" :items="historyList" class="overflow-hidden" @load="loadHistory">
<template #loading>
<LoadingBanner />
</template>
<template #empty />
<template v-if="historyList.length > 0">
<template v-for="(item, i) in historyList" :key="i">
<VListItem>
<template #prepend>
@@ -202,6 +214,7 @@ const dropdownItems = ref([
</template>
</VListItem>
</template>
</template>
</VInfiniteScroll>
</VList>
<VCardText v-if="historyList.length === 0" class="text-center"> 没有已完成的订阅 </VCardText>