微信二维码识别
一:页面a以及click无效
移动端click事件执行顺序:touchstart---> touchmove---> touchend----> click
点击click事件首先会触发start事件,之后300ms之后才会触发click事件(中间时间是判断用户是否是双击)
①:可以在touchstart中代替click事件触发 :tagName =='A' 确定之后 window.location.href =url
②:在touchend结束之后touch距离>x 触发click
③:fastclick
④:zepto ontap事件
二:微信内置浏览器打开页面长按二维码无法识别原因:
1、二维码作为背景图出现在页面,二维码需要以img才会识别
2、touchstart与touchmove中同时静止了默认事件 ---------》 解决办法:可以只在touchmove中禁止默认事件,在touchstart不要禁止默认事件
3、图片上面有一层遮罩或者被其他的元素挡住了

浙公网安备 33010602011771号