Authored by TaoHuang

fix input

... ... @@ -55,6 +55,7 @@ export default {
},
mounted() {
this.inputChange = debounce(this.onChange.bind(this), 500);
this.init();
},
watch: {
chgPrice(newVal) {
... ... @@ -180,7 +181,24 @@ export default {
this.$root.reportApp('', 'BUSINESS_UFO_SELL_CHANGE', {
locfun: 'click:changePrice:no'
});
}
},
init() {
let myFunction;
if (this.$yoho.isiOS) { // 是ios============(因为查到只有在微信环境下,ios手机上才会出现input失去焦点的时候页面被顶起)
document.body.addEventListener('focusin', () => { // 软键盘弹起事件
clearTimeout(myFunction);
});
document.body.addEventListener('focusout', () => { // 软键盘关闭事件
clearTimeout(myFunction);
myFunction = setTimeout(function() {
window.scrollTo({top: 0, left: 0, behavior: 'smooth'})// 重点 =======当键盘收起的时候让页面回到原始位置
}, 200);
})
}
},
},
components: {Modal, InputUfo}
};
... ...