update: 进入app逻辑修改

main
fadeaway 7 months ago
parent 3ed42f088c
commit a6abfe35a5

@ -12,14 +12,11 @@ export default function EnterQueyueBtn() {
const { inWX } = useUA(); const { inWX } = useUA();
const handleEnterQueyue = () => { const handleEnterQueyue = () => {
if (inWX) {
window.location.href = '/html/download.html';
} else {
if (opening) return; if (opening) return;
setOpening(true); setOpening(true);
const { searchParams } = new URL(window.location.href); const { searchParams } = new URL(window.location.href);
const songId = (searchParams as any)?.get('id'); const songId = (searchParams as any)?.get('id');
const result = confirm('离开微信,打开第三方应用'); const result = confirm(inWX ? '是否离开微信,打开第三方应用' : '是否打开第三方应用');
if (result) { if (result) {
window.location.href = `queyue://play/${songId}`; // 打开某手机上的某个app应用 window.location.href = `queyue://play/${songId}`; // 打开某手机上的某个app应用
setTimeout(function () { setTimeout(function () {
@ -31,7 +28,6 @@ export default function EnterQueyueBtn() {
} else { } else {
setOpening(false); setOpening(false);
} }
}
}; };
return ( return (

Loading…
Cancel
Save