问题一:安卓fixed在ios上不兼容处理(主要是position,换完之后间距需要做一些小修改)
问题二:new Date(YYYY-MM-DD HH:mm:ss).getTime()在ios上不兼容
time.replace(/\-/g, "/")
问题三:ios端元素监听touch长按事件会触发元素的click事件,这里记录ios端的处理方法(应用场景:聊天列表置顶,点击列表项进入聊天页面)
//定义两变量
timer: null, //定时器
longpress: false //是否长按
<div @touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd"></div>
touchStart() {
let that = this;
if (isiOS) {
clearTimeout(that.timer);
that.timer = setTimeout(() => {
that.longpress = true;
//ToDo 长按事件(判断长按时长1s)
}, 1000)
}
},
touchMove() {
console.log('move')
clearTimeout(this.timer);
this.longpress = true;
},
touchEnd(userId, userName, image) {
console.log('end')
clearTimeout(this.timer);
if (this.longpress == false) {
//不是长按,定义为点击事件
} else {
this.longpress = false;
}
},
问题四:input在ios上聚焦l弹出键盘,但是无法输入内容
input{
-webkit-user-select: text;
-user-select: text;
}