<button bindtouchstart="handleTouchStart" bindtouchend="handleTouchEnd" bindlongpress="handleLongPress" bindtap="handleClick">点击/长按</button> <!-- button 可以换成view-->//touch starthandleTouchStart: function(e) {        this.startTime = e.timeStamp;        //console.log(" startTime = " + e.timeStamp);  },  //touch endhandleTouchEnd: function(e) {        this.endTime = e.timeStamp;        //console.log(" endTime = " + e.timeStamp);  },  handleClick: function(e) {        //console.log("endTime - startTime = " + (this.endTime - this.startTime));        if (this.endTime - this.startTime < 350) {          console.log("点击");        }  },  handleLongPress: function(e) {    //console.log("endTime - startTime = " + (this.endTime - this.startTime));console.log("长按");  },

个人微信号 qicong88 ,欢迎来聊

TAG标签: 微信小程序微信小程序点击事件

http://www.xiaochengxub.com/read-106457.html