<button data-time="{{lastTapTime}}" data-title="Title" bindtap="doubleClick">Double click on the</button>
Copy the code

Js:

data: {
    lastTapTime:0,},doubleClick: function (e) {
    var curTime = e.timeStamp
    var lastTime = e.currentTarget.dataset.time  / / the e.c. with our fabrication: urrentTarget. Dataset. Time to access the custom data binding to the component
    console.log("Last click time:"+lastTime)
    console.log("This time click time:" + curTime)
    console.log('-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --');
    if (curTime - lastTime > 0) {
      if (curTime - lastTime < 300) {// Is a double click event
        console.log("Pretty quick double click, use:" + (curTime - lastTime))
      }
      
    }
    this.setData({
      lastTapTime: curTime
    })
  },
Copy the code