mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-08 17:26:41 +08:00
fix: 订阅历史记录不请求后端
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user