fix: 页面跳转

main
fadeaway 7 months ago
parent 690703d2dc
commit 7364f33785

@ -3,7 +3,7 @@
import { useRef } from 'react'; import { useRef } from 'react';
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 ImageWithBasePath from '@/components/ImageWithBasePath'; import ImageWithBasePath from '@/components/ImageWithBasePath';
@ -14,7 +14,7 @@ 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();
@ -22,7 +22,8 @@ export default function Home() {
if (!inWX) { if (!inWX) {
download(); download();
} else { } else {
router.push('/download'); // router.push('/download');
window.location.href = '/download.html';
} }
}; };

@ -2,12 +2,12 @@
import { useState } from 'react'; import { useState } from 'react';
import { useRouter } from 'next/navigation'; // import { useRouter } from 'next/navigation';
import useUA from '@/hooks/useUA'; 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 { inWX } = useUA();
@ -20,7 +20,8 @@ export default function EnterQueyueBtn() {
if (result) { if (result) {
window.location.href = `queyue://play/${songId}`; // 打开某手机上的某个app应用 window.location.href = `queyue://play/${songId}`; // 打开某手机上的某个app应用
setTimeout(function () { setTimeout(function () {
router.push('/download'); // router.push('/download');
window.location.href = '/download.html';
}, 500); }, 500);
setOpening(false); setOpening(false);
} else { } else {

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

@ -1,13 +1,14 @@
'use client'; 'use client';
import { useRouter } from 'next/navigation'; // import { useRouter } from 'next/navigation';
import ImageWithBasePath from '@/components/ImageWithBasePath'; import ImageWithBasePath from '@/components/ImageWithBasePath';
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 = '/download.html';
}; };
return ( return (
<section className="fixed bottom-0 left-[50%] translate-x-[-50%] z-[999] w-full max-w-screen-sm flex items-center border-t-[0.8px] border-[#00000019] pt-[14px] pb-[35px] px-[18px] bg-white"> <section className="fixed bottom-0 left-[50%] translate-x-[-50%] z-[999] w-full max-w-screen-sm flex items-center border-t-[0.8px] border-[#00000019] pt-[14px] pb-[35px] px-[18px] bg-white">

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

@ -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 ImageWithBasePath from '@/components/ImageWithBasePath'; import ImageWithBasePath from '@/components/ImageWithBasePath';
@ -12,14 +12,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: string = curSong?.id && id && curSong?.id === id ? 'text-[#C43737ff]' : ''; const activeTextColor: string = curSong?.id && id && curSong?.id === id ? 'text-[#C43737ff]' : '';
// 点击歌曲封面跳转到单曲页面 // 点击歌曲封面跳转到单曲页面
const handleCoverClick = () => { const handleCoverClick = () => {
router.push(`/music?id=${id}`); // router.push(`/music?id=${id}`);
window.location.href = `/music.html?id=${id}`;
}; };
// 点击歌曲信息播放歌曲 // 点击歌曲信息播放歌曲
@ -30,7 +31,8 @@ export default function SongItem(props: { data: ISong }) {
// 点击右侧图标,弹出弹窗(目前先跳转到下载页) // 点击右侧图标,弹出弹窗(目前先跳转到下载页)
const handleBudsClick = () => { const handleBudsClick = () => {
router.push('/download'); // router.push('/download');
window.location.href = '/download.html';
}; };
return ( return (

Loading…
Cancel
Save