update: 进入app逻辑修改

main
fadeaway 5 months ago
parent 3ed42f088c
commit a6abfe35a5

@ -12,25 +12,21 @@ export default function EnterQueyueBtn() {
const { inWX } = useUA();
const handleEnterQueyue = () => {
if (inWX) {
window.location.href = '/html/download.html';
if (opening) return;
setOpening(true);
const { searchParams } = new URL(window.location.href);
const songId = (searchParams as any)?.get('id');
const result = confirm(inWX ? '是否离开微信,打开第三方应用' : '是否打开第三方应用');
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 {
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);
}
setOpening(false);
}
};

Loading…
Cancel
Save