feat: 下载历史数量限制为 30 条
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
|
||||
.fav-body {
|
||||
padding: @section-gap-xs @page-padding-x;
|
||||
padding-bottom: calc(48rpx + env(safe-area-inset-bottom) + 120rpx);
|
||||
padding-bottom: 48rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { NAV_INNER_PX } from '../../utils/navMetrics';
|
||||
import { getFavoriteList, removeFavorite } from '../../utils/favorites';
|
||||
import { getDownloadLogs } from '../../utils/downloadLogs';
|
||||
import {
|
||||
DOWNLOAD_HISTORY_MAX,
|
||||
getDownloadLogs,
|
||||
} from '../../utils/downloadLogs';
|
||||
import type { FavoriteRecord } from '../../utils/favorites';
|
||||
import type { DownloadLogRecord } from '../../utils/downloadLogs';
|
||||
import { getCategoryName } from '../../core/data/categories';
|
||||
@@ -223,7 +226,7 @@ Page({
|
||||
async loadDownloads() {
|
||||
this.setData({ dlLoading: true });
|
||||
try {
|
||||
const records = await getDownloadLogs();
|
||||
const records = await getDownloadLogs(1, DOWNLOAD_HISTORY_MAX);
|
||||
this.setData({ downloadSections: groupDownloadsByDate(records) });
|
||||
} finally {
|
||||
this.setData({ dlLoading: false });
|
||||
|
||||
@@ -38,12 +38,15 @@ export async function addDownloadLog(worksheetId: string): Promise<boolean> {
|
||||
}
|
||||
}
|
||||
|
||||
/** 收藏页下载历史展示条数上限 */
|
||||
export const DOWNLOAD_HISTORY_MAX = 30;
|
||||
|
||||
/**
|
||||
* 获取下载历史
|
||||
* 获取下载历史(默认最近 30 条)
|
||||
*/
|
||||
export async function getDownloadLogs(
|
||||
page = 1,
|
||||
pageSize = 20,
|
||||
pageSize = DOWNLOAD_HISTORY_MAX,
|
||||
): Promise<DownloadLogRecord[]> {
|
||||
try {
|
||||
await getUser();
|
||||
|
||||
Reference in New Issue
Block a user