From fdab50c963c871eeddf79840b6369eec8d6a4b64 Mon Sep 17 00:00:00 2001 From: mackt <1033530438@qq.com> Date: Wed, 17 Apr 2024 23:44:49 +0800 Subject: [PATCH] feat(component): BUttonFM --- public/img/icon/FM-active.svg | 3 +++ src/app/vol/list/[category]/[[...page]]/page.tsx | 4 ++-- src/components/ButtonFM.tsx | 14 ++++++++++++++ src/components/index.ts | 1 + src/services/client/audio.ts | 9 +++++++++ 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 public/img/icon/FM-active.svg create mode 100644 src/components/ButtonFM.tsx diff --git a/public/img/icon/FM-active.svg b/public/img/icon/FM-active.svg new file mode 100644 index 0000000..4d7f65c --- /dev/null +++ b/public/img/icon/FM-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/app/vol/list/[category]/[[...page]]/page.tsx b/src/app/vol/list/[category]/[[...page]]/page.tsx index b554d31..da5a3d2 100644 --- a/src/app/vol/list/[category]/[[...page]]/page.tsx +++ b/src/app/vol/list/[category]/[[...page]]/page.tsx @@ -1,7 +1,7 @@ /** 期刊列表 */ import { notFound } from 'next/navigation'; -import { Category, JournalRecommendList, Pagination, JournalItem, RedirectCheck } from '@/components'; +import { Category, JournalRecommendList, JournalItem, Pagination, RedirectCheck, ButtonFM } from '@/components'; import { apiSearchCategoryList, apiGetJournalRecommendWithCollect, apiJournalList } from '@/services'; import type { Metadata } from 'next'; @@ -69,7 +69,7 @@ export default async function Journal({ params }: { params: { category?: string;
{categoryInfo?.nameCh ?? '全部'}
-

电台

+
{/* 期刊列表 */} diff --git a/src/components/ButtonFM.tsx b/src/components/ButtonFM.tsx new file mode 100644 index 0000000..685c06b --- /dev/null +++ b/src/components/ButtonFM.tsx @@ -0,0 +1,14 @@ +'use client'; + +export default function FM() { + const handlePlayFM = () => {}; + + return ( +
+ 电台 +
+ ); +} diff --git a/src/components/index.ts b/src/components/index.ts index 193a4b6..ee6d7f7 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -45,3 +45,4 @@ export { default as CommentList } from './Comment/MainComment/CommentList'; export { default as PlayerButton } from './AudioPlayer/PlayerButton'; export { default as Pagination } from './Pagination'; export { default as ButtonScrollTop } from './ButtonScrollTop'; +export { default as ButtonFM } from './ButtonFM'; diff --git a/src/services/client/audio.ts b/src/services/client/audio.ts index 0bca160..d26633c 100644 --- a/src/services/client/audio.ts +++ b/src/services/client/audio.ts @@ -23,3 +23,12 @@ export const apiGetSongCollect = async ({ ); return result; }; + +/** 收藏歌曲 + * @pageNum 页码,不传或者小于1,则返回所有收藏歌曲 + * @pageSize 每页条数,不传或者小于1,则返回所有收藏歌曲 + */ +export const apiGetSongRandom = async ({ limit }: { limit: number }) => { + const result: FetchResponse> = await clientHttp.get(`/queyueapi/music/song/random?limit=${limit}`); + return result; +};