updated(){
var _this= this;
//键盘弹起遮挡输入框
document.body.addEventListener('focusin', (e) =>{
var timer1 = setInterval(function() {
document.body.scrollTop = document.body.scrollHeight;
_this.scrollToBottom()
clearInterval(timer1);
}, 100)
})
// 软键盘消失后,解决页面无法回弹
document.body.addEventListener('focusout', (e) =>{
var ua = navigator.userAgent.toLowerCase();
if(/iphone|ipad|ipod/.test(ua)) {
var currentPosition, timer2;
var speed = 1;
timer2 = setInterval(function() {
currentPosition=document.documentElement.scrollTop || document.body.scrollTop;
currentPosition-=speed;
window.scrollTo(0,currentPosition);
currentPosition+=speed;
window.scrollTo(0,currentPosition);
clearInterval(timer2);
}, 1);
}
})
},