feat:下载历史修改

This commit is contained in:
R524809
2026-05-25 18:32:18 +08:00
parent 000d7d8a7f
commit facb569598
5 changed files with 45 additions and 29 deletions
+4 -4
View File
@@ -14,10 +14,10 @@ export const defaultPrintConfig: PrintConfig = {
};
export const defaultShareConfig = {
// title: '涂鸦丫 - 一张会“教知识”的涂色卡',
title: '涂鸦丫 - 快来生成宝宝的专属学习卡',
path: '/pages/mathIndex/mathIndex',
imageUrl: 'https://cdn.joeyone.cn/doodle/share-img/index-share-v2.png',
// title: '涂鸦丫·儿童打印练习纸,数学练字拼音一键打印',
title: '涂鸦丫|轻松生成幼儿练习纸,幼小衔接宝妈推荐',
path: '/pages/home/home',
imageUrl: 'https://cdn.joeyone.cn/doodle/share-img/share-v3-800.png',
};
/**
+5 -2
View File
@@ -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';
@@ -225,7 +228,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 });
+5 -2
View File
@@ -34,12 +34,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();