fix: 页面跳转

main
fadeaway 7 months ago
parent 690703d2dc
commit 7364f33785

@ -3,7 +3,7 @@
import { useRef } from 'react';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
// import { useRouter } from 'next/navigation';
import AppLogo from '@/components/AppLogo';
import ImageWithBasePath from '@/components/ImageWithBasePath';
@ -14,7 +14,7 @@ import { download } from '@/utils/download';
import useUA from '@/hooks/useUA';
export default function Home() {
const router = useRouter();
// const router = useRouter();
const firstScreenRef = useRef<HTMLDivElement>(null);
const { inWX } = useUA();
@ -22,7 +22,8 @@ export default function Home() {
if (!inWX) {
download();
} else {
router.push('/download');
// router.push('/download');
window.location.href = '/download.html';
}
};

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

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

@ -1,13 +1,14 @@
'use client';
import { useRouter } from 'next/navigation';
// import { useRouter } from 'next/navigation';
import ImageWithBasePath from '@/components/ImageWithBasePath';
export default function JournalComment({ journalInfo }: { journalInfo: any }) {
const router = useRouter();
// const router = useRouter();
const handleClick = () => {
router.push('/download');
// router.push('/download');
window.location.href = '/download.html';
};
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">

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

@ -1,7 +1,7 @@
'use client';
import Image from 'next/image';
import { useRouter } from 'next/navigation';
// import { useRouter } from 'next/navigation';
import ImageWithBasePath from '@/components/ImageWithBasePath';
@ -12,14 +12,15 @@ import { useJournalAudioContext } from '@/context/JournalAudioContext';
export default function SongItem(props: { data: ISong }) {
const song = props?.data || {};
const { id, pic, title, artist, album } = song;
const router = useRouter();
// const router = useRouter();
const { curSong, setCurSong, playing, setPlaying } = useJournalAudioContext();
const activeTextColor: string = curSong?.id && id && curSong?.id === id ? 'text-[#C43737ff]' : '';
// 点击歌曲封面跳转到单曲页面
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 = () => {
router.push('/download');
// router.push('/download');
window.location.href = '/download.html';
};
return (

Loading…
Cancel
Save