fix: 细节修改

main
fadeaway 8 months ago
parent 22478a1284
commit 96446c8452

@ -3,6 +3,8 @@
*/ */
'use client'; 'use client';
import { useEffect } from 'react';
import Image from 'next/image'; import Image from 'next/image';
import AppLogo from '@/components/AppLogo'; import AppLogo from '@/components/AppLogo';
@ -18,6 +20,10 @@ export default function Download() {
download(); download();
}; };
useEffect(() => {
document.title = '雀乐-下载';
}, []);
return ( return (
<main className="relative max-w-screen-sm min-h-screen mx-auto flex flex-col items-center text-white font-normal bg-gradient-to-b from-[#030303] to-[#1f1f20]"> <main className="relative max-w-screen-sm min-h-screen mx-auto flex flex-col items-center text-white font-normal bg-gradient-to-b from-[#030303] to-[#1f1f20]">
{inWX && ( {inWX && (

@ -4,23 +4,26 @@ import { useRef } from 'react';
import Image from 'next/image'; import Image from 'next/image';
import Link from 'next/link'; import Link from 'next/link';
import { useRouter } from 'next/navigation'; // import { useRouter } from 'next/navigation';
import AppLogo from '@/components/AppLogo'; import AppLogo from '@/components/AppLogo';
import WXShareBtn from '@/components/WXComponent/WXShareBtn'; import WXShareBtn from '@/components/WXComponent/WXShareBtn';
import { download } from '@/utils/download';
import useUA from '@/hooks/useUA'; import useUA from '@/hooks/useUA';
export default function Home() { export default function Home() {
const router = useRouter(); // const router = useRouter();
const firstScreenRef = useRef<HTMLDivElement>(null); const firstScreenRef = useRef<HTMLDivElement>(null);
const { inWX } = useUA(); const { inWX } = useUA();
const handleDownload = () => { const handleDownload = () => {
if (!inWX) { if (!inWX) {
window.open('//cdn.indie.cn/release/queyue.apk', '__blank'); download();
} else { } else {
router.push('/download'); // router.push('/download');
window.location.href = '/html/download.html';
} }
}; };
@ -34,7 +37,7 @@ export default function Home() {
{/* 首屏 */} {/* 首屏 */}
<div <div
ref={firstScreenRef} ref={firstScreenRef}
className="relative w-full min-h-screen flex flex-col items-center bg-[url(/img/index_background.png)] bg-center bg-cover" className="relative w-full min-h-screen flex flex-col items-center bg-[url(/html/img/index_background.png)] bg-center bg-cover"
> >
{/* title */} {/* title */}
{!inWX && <h1 className="text-center text-[17px] h-[44px] leading-[44px]"></h1>} {!inWX && <h1 className="text-center text-[17px] h-[44px] leading-[44px]"></h1>}

@ -2,27 +2,35 @@
import { useState } from 'react'; import { useState } from 'react';
import { useRouter } from 'next/navigation'; // import { useRouter } from 'next/navigation';
import useUA from '@/hooks/useUA';
export default function EnterQueyueBtn() { export default function EnterQueyueBtn() {
const router = useRouter(); // const router = useRouter();
const [opening, setOpening] = useState(false); const [opening, setOpening] = useState(false);
const { inWX } = useUA();
const handleEnterQueyue = () => { const handleEnterQueyue = () => {
if (opening) return; if (inWX) {
setOpening(true); window.location.href = '/html/download.html';
const { searchParams } = new URL(window.location.href);
const songId = (searchParams as any)?.get('id');
const result = confirm('离开微信,打开第三方应用');
if (result) {
window.location.href = `queyue://play/${songId}`; // 打开某手机上的某个app应用
setTimeout(function () {
// alert('打开应用无效跳转下载页');
router.push('/download');
}, 2000);
setOpening(false);
} else { } else {
setOpening(false); if (opening) return;
setOpening(true);
const { searchParams } = new URL(window.location.href);
const songId = (searchParams as any)?.get('id');
const result = confirm('离开微信,打开第三方应用');
if (result) {
window.location.href = `queyue://play/${songId}`; // 打开某手机上的某个app应用
setTimeout(function () {
// alert('打开应用无效跳转下载页');
// router.push('/download');
window.location.href = '/html/download.html';
}, 2000);
setOpening(false);
} else {
setOpening(false);
}
} }
}; };

@ -1,12 +1,13 @@
'use client'; 'use client';
import Image from 'next/image'; import Image from 'next/image';
import { useRouter } from 'next/navigation'; // import { useRouter } from 'next/navigation';
export default function JournalBanner() { export default function JournalBanner() {
const router = useRouter(); // const router = useRouter();
const handleClick = () => { const handleClick = () => {
router.push('/download'); // router.push('/download');
window.location.href = '/html/index.html';
}; };
return ( return (
<div <div

@ -1,12 +1,13 @@
'use client'; 'use client';
import Image from 'next/image'; import Image from 'next/image';
import { useRouter } from 'next/navigation'; // import { useRouter } from 'next/navigation';
export default function JournalComment({ journalInfo }: { journalInfo: any }) { export default function JournalComment({ journalInfo }: { journalInfo: any }) {
const router = useRouter(); // const router = useRouter();
const handleClick = () => { const handleClick = () => {
router.push('/download'); // router.push('/download');
window.location.href = '/html/download.html';
}; };
return ( return (
<section className="w-full flex items-center border-t-[0.8px] border-[#00000019] pt-[14px] pb-[35px] px-[18px] bg-white"> <section className="w-full flex items-center border-t-[0.8px] border-[#00000019] pt-[14px] pb-[35px] px-[18px] bg-white">

@ -41,8 +41,12 @@ export default function JournalContent() {
setLoading(true); setLoading(true);
getInfo((searchParams as any)?.get('id')) getInfo((searchParams as any)?.get('id'))
.then(([res0, res1]) => { .then(([res0, res1]) => {
setJournalInfo(res0?.data); const jInfo = res0?.data;
setJournalInfo(jInfo);
setSongList(res1?.data); setSongList(res1?.data);
if (jInfo?.journalNo && jInfo?.title) {
document.title = `雀乐 VOL.${jInfo?.journalNo} ${jInfo?.title}`;
}
}) })
.finally(() => { .finally(() => {
setLoading(false); setLoading(false);
@ -62,7 +66,7 @@ export default function JournalContent() {
<section className="relative w-full flex-1 bg-white mt-[-10px] rounded-tl-[12px] rounded-tr-[12px] z-1 py-[17px] px-[18px] pb-[79px]"> <section className="relative w-full flex-1 bg-white mt-[-10px] rounded-tl-[12px] rounded-tr-[12px] z-1 py-[17px] px-[18px] pb-[79px]">
<div className="flex items-center flex-wrap text-[#000000b2] mb-[5px]"> <div className="flex items-center flex-wrap text-[#000000b2] mb-[5px]">
<div className="text-[14px] font-medium leading-[19.6px]">VOL·{journalInfo?.journalNo}</div> <div className="text-[14px] font-medium leading-[19.6px]">VOL.{journalInfo?.journalNo}</div>
<div className="ml-[11px] flex items-center flex-wrap text-[12px] leading-[12px]"> <div className="ml-[11px] flex items-center flex-wrap text-[12px] leading-[12px]">
{journalInfo?.tags?.map((tag: string, index: number) => ( {journalInfo?.tags?.map((tag: string, index: number) => (
<div <div

@ -1,12 +1,13 @@
'use client'; 'use client';
import Image from 'next/image'; import Image from 'next/image';
import { useRouter } from 'next/navigation'; // import { useRouter } from 'next/navigation';
export default function MusicBanner() { export default function MusicBanner() {
const router = useRouter(); // const router = useRouter();
const handleClick = () => { const handleClick = () => {
router.push('/download'); // router.push('/download');
window.location.href = '/html/index.html';
}; };
return ( return (
<div <div

@ -32,7 +32,11 @@ export default function MusicPanel() {
setLoading(true); setLoading(true);
getMusic((searchParams as any)?.get('id')) getMusic((searchParams as any)?.get('id'))
.then((res) => { .then((res) => {
setMusicInfo(res?.data); const mInfo = res?.data;
setMusicInfo(mInfo);
if (mInfo?.journalNo && mInfo?.title) {
document.title = `雀乐 VOL.${mInfo?.journalNo}-${mInfo?.title}`;
}
}) })
.finally(() => { .finally(() => {
setLoading(false); setLoading(false);
@ -80,7 +84,7 @@ export default function MusicPanel() {
<div className="w-full mt-[20px]"> <div className="w-full mt-[20px]">
<div className="text-[12px] h-[22px] w-[fit-content] flex items-center text-white rounded-full px-[8px] py-[0] bg-[#2b2b2c]"> <div className="text-[12px] h-[22px] w-[fit-content] flex items-center text-white rounded-full px-[8px] py-[0] bg-[#2b2b2c]">
VOL&nbsp;{musicInfo?.journalNo} VOL.{musicInfo?.journalNo}
</div> </div>
</div> </div>
<h5 className="mt-[9px] font-medium text-[20px] leading-[28px] w-full min-h-[28px]">{musicInfo?.title}</h5> <h5 className="mt-[9px] font-medium text-[20px] leading-[28px] w-full min-h-[28px]">{musicInfo?.title}</h5>

@ -1,7 +1,7 @@
'use client'; 'use client';
import Image from 'next/image'; import Image from 'next/image';
import { useRouter } from 'next/navigation'; // import { useRouter } from 'next/navigation';
import styles from './index.module.css'; import styles from './index.module.css';
@ -10,14 +10,15 @@ import { useJournalAudioContext } from '@/context/JournalAudioContext';
export default function SongItem(props: { data: ISong }) { export default function SongItem(props: { data: ISong }) {
const song = props?.data || {}; const song = props?.data || {};
const { id, pic, title, artist, album } = song; const { id, pic, title, artist, album } = song;
const router = useRouter(); // const router = useRouter();
const { curSong, setCurSong, playing, setPlaying } = useJournalAudioContext(); const { curSong, setCurSong, playing, setPlaying } = useJournalAudioContext();
const activeTextColor = curSong?.id && id && curSong?.id === id ? 'text-[#b44343ff]' : ''; const activeTextColor = curSong?.id && id && curSong?.id === id ? 'text-[#b44343ff]' : '';
// 点击歌曲封面跳转到单曲页面 // 点击歌曲封面跳转到单曲页面
const handleCoverClick = () => { const handleCoverClick = () => {
router.push(`/music?id=${id}`); // router.push(`/music?id=${id}`);
window.location.href = `/html/music.html?id=${id}`;
}; };
// 点击歌曲信息播放歌曲 // 点击歌曲信息播放歌曲
@ -28,7 +29,8 @@ export default function SongItem(props: { data: ISong }) {
// 点击右侧图标,弹出弹窗(目前先跳转到下载页) // 点击右侧图标,弹出弹窗(目前先跳转到下载页)
const handleBudsClick = () => { const handleBudsClick = () => {
router.push('/download'); // router.push('/download');
window.location.href = '/html/download.html';
}; };
return ( return (

@ -1,10 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"lib": [ "lib": ["dom", "dom.iterable", "esnext"],
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
@ -22,19 +18,9 @@
} }
], ],
"paths": { "paths": {
"@/*": [ "@/*": ["./src/*"]
"./src/*"
]
} }
}, },
"include": [ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "html/types/**/*.ts"],
"next-env.d.ts", "exclude": ["node_modules"]
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"dist/types/**/*.ts"
],
"exclude": [
"node_modules"
]
} }

Loading…
Cancel
Save