mui中confirm在苹果出现bug,confirm点击确定跳转页面再返回后,页面被遮罩盖住无法使用

项目中使用confirm

mui.confirm('您还未抽奖,现在去抽奖吗?', function (res) {

if (res.index === 1) {
window.location.href = Url
}

})

安卓手机没有问题,但苹果手机中点击“确认”跳转页面后,点击返回,返回的页面无法滚动,也无法点击任何元素。(点击确认按钮曾经出现的位置,发现页面还会跳转,说明确认按钮还在页面中)

解决办法

mui.confirm('您还未抽奖,现在去抽奖吗?', function (res) {
if (res.index === 1) {
$('.mui-popup-backdrop').remove(); // 去除遮罩
      $('.mui-popup').remove();         // 去除弹出窗口
      window.location.href = Url
}
});

还有一种解决办法就是延时,时间还不能太短,测试时100,200都不行,500可以,其他没测(因为时间比较长,还不确定,所以使用了上面的方法)
setTimeout(function () {
window.location.href = Url
}, 500);
原文地址:https://www.cnblogs.com/sgqwjr/p/10244977.html