//打开遮罩(禁止滚动)
openOverlay() {
this.showOverlay = true;
let uniPlatform = uni.getSystemInfoSync().uniPlatform;
// H5禁止滚动
if (uniPlatform == 'web') {
var mo = function(e) {
e.preventDefault();
};
document.body.style.overflow = 'hidden';
document.addEventListener("touchmove", mo, false); //禁止页面滑动
}
},
//关闭遮罩(开启滚动)
closeOverLay: function() {
this.showOverlay = false;
let uniPlatform = uni.getSystemInfoSync().uniPlatform; //获取设备信息(判断是否为web设备)
if (uniPlatform == 'web') {
var mo = function(e) {
e.preventDefault();
};
console.log("document", document)
document.body.style.overflow = ''; //出现滚动条
document.removeEventListener("touchmove", mo, false);
}
},