From 9bf513d35d0f262678ffb6c9dadc637e9047ce56 Mon Sep 17 00:00:00 2001 From: alger Date: Wed, 22 Oct 2025 21:52:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E6=97=A5=E6=8E=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/lang/zh-CN/common.ts | 2 + src/i18n/lang/zh-CN/comp.ts | 6 +- src/renderer/api/music.ts | 22 + .../common/songItemCom/CompactSongItem.vue | 14 +- src/renderer/router/other.ts | 11 + src/renderer/store/modules/user.ts | 8 + src/renderer/views/music/HistoryRecommend.vue | 379 ++++++++++++++++++ src/renderer/views/music/MusicListPage.vue | 26 +- 8 files changed, 458 insertions(+), 10 deletions(-) create mode 100644 src/renderer/views/music/HistoryRecommend.vue diff --git a/src/i18n/lang/zh-CN/common.ts b/src/i18n/lang/zh-CN/common.ts index 746a97f..153cdb5 100644 --- a/src/i18n/lang/zh-CN/common.ts +++ b/src/i18n/lang/zh-CN/common.ts @@ -43,6 +43,8 @@ export default { collapse: '收起', songCount: '{count}首', language: '语言', + today: '今天', + yesterday: '昨天', tray: { show: '显示', quit: '退出', diff --git a/src/i18n/lang/zh-CN/comp.ts b/src/i18n/lang/zh-CN/comp.ts index e39e4e4..7a64ee5 100644 --- a/src/i18n/lang/zh-CN/comp.ts +++ b/src/i18n/lang/zh-CN/comp.ts @@ -117,7 +117,11 @@ export default { cancelCollect: '取消收藏', addToPlaylist: '添加到播放列表', addToPlaylistSuccess: '添加到播放列表成功', - songsAlreadyInPlaylist: '歌曲已存在于播放列表中' + songsAlreadyInPlaylist: '歌曲已存在于播放列表中', + historyRecommend: '历史日推', + fetchDatesFailed: '获取日期列表失败', + fetchSongsFailed: '获取歌曲列表失败', + noSongs: '暂无歌曲' }, playlist: { import: { diff --git a/src/renderer/api/music.ts b/src/renderer/api/music.ts index 34eb53f..dd41fa2 100644 --- a/src/renderer/api/music.ts +++ b/src/renderer/api/music.ts @@ -188,3 +188,25 @@ export function subscribeAlbum(params: { t: number; id: number }) { params }); } + +/** + * 获取历史日推可用日期列表 + */ +export function getHistoryRecommendDates() { + return request({ + url: '/history/recommend/songs', + method: 'get' + }); +} + +/** + * 获取历史日推详情数据 + * @param date 日期,格式:YYYY-MM-DD + */ +export function getHistoryRecommendSongs(date: string) { + return request({ + url: '/history/recommend/songs/detail', + method: 'get', + params: { date } + }); +} diff --git a/src/renderer/components/common/songItemCom/CompactSongItem.vue b/src/renderer/components/common/songItemCom/CompactSongItem.vue index f824659..af3d002 100644 --- a/src/renderer/components/common/songItemCom/CompactSongItem.vue +++ b/src/renderer/components/common/songItemCom/CompactSongItem.vue @@ -34,7 +34,7 @@