用bindtouchmove做页面元素view的缩放时,
在安卓上,感觉很明显的卡顿现象,手指移动离开后,过了大约500s才开始缩放,在ios上就很顺畅,社区的开发人员能解决一下么?在线等,着急…
moveEvent: function (e) {
//单点触摸
if (e.touches.length == 1) {
console.log(‘单点’)
return;
} else if (e.touches.length == 2) {
console.log(‘双点’)
let x = app.globalData.left;
let y = app.globalData.top;
let x1 = e.touches[0].pageX;
let y1 = e.touches[0].pageY;
let x2 = e.touches[1].pageX;
let y2 = e.touches[1].pageY;
let xMove = x2 - x1;
let yMove = y2 - y1;
let newDis = Math.sqrt(xMove * xMove + yMove * yMove);
let newDistances = Math.sqrt(((e.touches[1].clientX - e.touches[0].clientX) * (e.touches[1].clientX - e.touches[0].clientX)) + ((e.touches[1].clientY - e.touches[0].clientY) * (e.touches[1].clientY - e.touches[0].clientY)));
let distances = that.data.distances;
let oldDis = that.data.distance;
//let scale = newDis / oldDis;
let scale = that.data.scale + 0.0003 * (newDistances - distances);
console.log(scale);
that.setData({
scale: scale
})
}