html:
<view style="width:100px;height:100px;background-color: pink;" bind:touchstart="touchStart" bind:touchend="touchEnd" bind:touchcancel="touchCancel" bind:tap="tapEvent" bind:longtap="longTap"></view>
js:
touchStart(e) {
this.time = Date.now();
console.log('touchStart', this.time);
},
touchEnd(e) {
console.log('touchEnd', Date.now(), Date.now() - this.time);
},
touchCancel(e) {
console.log('touchCancel')
this.handleMicTouchEnd(e);
},
tapEvent(e) {
console.log('tapEvent', Date.now(), Date.now() - this.time);
},
longTap() {
console.log('longTap', Date.now(), Date.now() - this.time);
},
实际上触摸并未停止,但是touchend/tap/longtap 事件被提前触发了。