From 9382add3225e3f401140dc7644212e50f7428e2e Mon Sep 17 00:00:00 2001 From: fadeaway Date: Mon, 25 Mar 2024 23:04:14 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/journal/page.tsx | 29 +++------------------ src/app/music/page.tsx | 8 ++---- src/app/page.tsx | 10 +++++--- src/components/JournalBanner/index.tsx | 27 ++++++++++++++++++++ src/components/JournalComment/index.tsx | 34 +++++++++++++++++++++++++ src/components/MusicBanner/index.tsx | 21 +++++++++++++++ 6 files changed, 95 insertions(+), 34 deletions(-) create mode 100644 src/components/JournalBanner/index.tsx create mode 100644 src/components/JournalComment/index.tsx create mode 100644 src/components/MusicBanner/index.tsx diff --git a/src/app/journal/page.tsx b/src/app/journal/page.tsx index 48b9117..81dc000 100644 --- a/src/app/journal/page.tsx +++ b/src/app/journal/page.tsx @@ -4,6 +4,8 @@ import Image from 'next/image'; import ArticalWrap from '@/components/ArticalWrap'; +import JournalBanner from '@/components/JournalBanner'; +import JournalComment from '@/components/JournalComment'; import SongList from '@/components/SongList'; import type { Metadata } from 'next'; @@ -32,11 +34,7 @@ export default async function Journal({ searchParams: { id } }: any) { const songList = res1?.data; return (
-
- queyue - 邀你一起来【雀乐】听歌 - right-arrow -
+ {/* 期刊封面图 */}
@@ -68,26 +66,7 @@ export default async function Journal({ searchParams: { id } }: any) { -
-
- 说点想说的 -
-
- icon_comment - {journalInfo && journalInfo.totalCommentReplyInt > 0 && ( -
- {journalInfo?.totalCommentReply} -
- )} -
-
+
); } diff --git a/src/app/music/page.tsx b/src/app/music/page.tsx index 4024497..384357c 100644 --- a/src/app/music/page.tsx +++ b/src/app/music/page.tsx @@ -1,9 +1,9 @@ /** * 歌曲播放页面 */ -import Image from 'next/image'; import EnterQueyueBtn from '@/components/EnterQueyueBtn'; +import MusicBanner from '@/components/MusicBanner'; import MusicPanel from '@/components/MusicPanel'; async function getMusic(songId: string) { @@ -16,11 +16,7 @@ export default async function Music({ searchParams: { id } }: any) { const musicInfo = res?.data; return (
-
- queyue - 邀你一起来【雀乐】听歌 - right-arrow -
+ diff --git a/src/app/page.tsx b/src/app/page.tsx index d3f8371..49ac5fb 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -4,20 +4,24 @@ import { useRef } from 'react'; import Image from 'next/image'; import Link from 'next/link'; +import { useRouter } from 'next/navigation'; import AppLogo from '@/components/AppLogo'; import WXShareBtn from '@/components/WXComponent/WXShareBtn'; -import { download } from '@/utils/download'; - import useUA from '@/hooks/useUA'; export default function Home() { + const router = useRouter(); const firstScreenRef = useRef(null); const { inWX } = useUA(); const handleDownload = () => { - download(); + if (!inWX) { + window.open('//cdn.indie.cn/release/queyue.apk', '__blank'); + } else { + router.push('/download'); + } }; const handleSlideDown = () => { diff --git a/src/components/JournalBanner/index.tsx b/src/components/JournalBanner/index.tsx new file mode 100644 index 0000000..de66024 --- /dev/null +++ b/src/components/JournalBanner/index.tsx @@ -0,0 +1,27 @@ +'use client'; + +import Image from 'next/image'; +import { useRouter } from 'next/navigation'; + +export default function JournalBanner() { + const router = useRouter(); + const handleClick = () => { + router.push('/download'); + }; + return ( +
+ queyue + 邀你一起来【雀乐】听歌 + right-arrow +
+ ); +} diff --git a/src/components/JournalComment/index.tsx b/src/components/JournalComment/index.tsx new file mode 100644 index 0000000..673f7e0 --- /dev/null +++ b/src/components/JournalComment/index.tsx @@ -0,0 +1,34 @@ +'use client'; + +import Image from 'next/image'; +import { useRouter } from 'next/navigation'; + +export default function JournalComment({ journalInfo }: { journalInfo: any }) { + const router = useRouter(); + const handleClick = () => { + router.push('/download'); + }; + return ( +
+
+ 说点想说的 +
+
+ icon_comment + {journalInfo && journalInfo.totalCommentReplyInt > 0 && ( +
{journalInfo?.totalCommentReply}
+ )} +
+
+ ); +} diff --git a/src/components/MusicBanner/index.tsx b/src/components/MusicBanner/index.tsx new file mode 100644 index 0000000..4cf2f1a --- /dev/null +++ b/src/components/MusicBanner/index.tsx @@ -0,0 +1,21 @@ +'use client'; + +import Image from 'next/image'; +import { useRouter } from 'next/navigation'; + +export default function MusicBanner() { + const router = useRouter(); + const handleClick = () => { + router.push('/download'); + }; + return ( +
+ queyue + 邀你一起来【雀乐】听歌 + right-arrow +
+ ); +}