var L = 250 / 750 * wx.getSystemInfoSync().screenWidth;
var R = 500 / 750 * wx.getSystemInfoSync().screenWidth;
var T = 550 / 1500 * wx.getSystemInfoSync().screenHeight;
var B = 750 / 1500 * wx.getSystemInfoSync().screenHeight;
var xL = x;
var xR = xL + 160 / 750 * wx.getSystemInfoSync().screenWidth;
var yT = y;
var yB = yT + 90 / 1500 * wx.getSystemInfoSync().screenHeight;
// console.log(xL,xR, yT,yB);
// console.log(L, R, T, B);
if (xL > L && xR < R && yT > T && yB < B) {
return 1;
}
else {
return 0;
}
这里我的机型变换到xr时和6时他的y轴就出现很大问题,x轴还好
我是用movable-view的bindChange来获取的,而且我还想问一下那个x、y值是不是默认这个组件左上角的坐标