|
|
@ -12,25 +12,21 @@ export default function EnterQueyueBtn() {
|
|
|
|
const { inWX } = useUA();
|
|
|
|
const { inWX } = useUA();
|
|
|
|
|
|
|
|
|
|
|
|
const handleEnterQueyue = () => {
|
|
|
|
const handleEnterQueyue = () => {
|
|
|
|
if (inWX) {
|
|
|
|
if (opening) return;
|
|
|
|
window.location.href = '/html/download.html';
|
|
|
|
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 {
|
|
|
|
} else {
|
|
|
|
if (opening) return;
|
|
|
|
setOpening(false);
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|