|
|
@@ -14,7 +14,8 @@ Page({ |
|
|
|
istouching: false, |
|
|
|
isHolding: false, |
|
|
|
scrollTop: 0, |
|
|
|
timer: null |
|
|
|
timer: null, |
|
|
|
clearTimer: null |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
@@ -196,7 +197,15 @@ Page({ |
|
|
|
|
|
|
|
// 点击开始,在触发messageTouchEnd之前即为长按 |
|
|
|
messageTouchStart(e) { |
|
|
|
console.log(e, 'e'); |
|
|
|
const timer = this.data.timer |
|
|
|
const clearTimer = this.data.clearTimer |
|
|
|
clearTimeout(timer) |
|
|
|
clearTimeout(clearTimer) |
|
|
|
this.setData({ |
|
|
|
timer: null, |
|
|
|
clearTimer: null, |
|
|
|
}) |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
istouching: true, |
|
|
|
istouchingIndex: e.currentTarget.dataset.index, |
|
|
@@ -204,12 +213,7 @@ Page({ |
|
|
|
this.setData({ |
|
|
|
isHolding: true |
|
|
|
}) |
|
|
|
setTimeout(() => { |
|
|
|
this.setData({ |
|
|
|
isHolding: false |
|
|
|
}) |
|
|
|
}, 4000); |
|
|
|
}, 500) |
|
|
|
}, 200) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
@@ -217,7 +221,12 @@ Page({ |
|
|
|
messageTouchEnd(e) { |
|
|
|
this.setData({ |
|
|
|
istouching: false, |
|
|
|
istouchingIndex: e.currentTarget.dataset.index |
|
|
|
istouchingIndex: e.currentTarget.dataset.index, |
|
|
|
clearTimer: setTimeout(() => { |
|
|
|
this.setData({ |
|
|
|
isHolding: false |
|
|
|
}) |
|
|
|
}, 4000) |
|
|
|
}) |
|
|
|
const timer = this.data.timer |
|
|
|
clearTimeout(timer) |
|
|
@@ -230,6 +239,9 @@ Page({ |
|
|
|
this.setData({ |
|
|
|
isHolding: false |
|
|
|
}) |
|
|
|
const timer = this.data.timer |
|
|
|
clearTimeout(timer) |
|
|
|
|
|
|
|
this.setClipboardData(message) |
|
|
|
}, |
|
|
|
|
|
|
|