Browse Source

upload

master
HolyKnightIX 1 year ago
parent
commit
d5a9a9dcea
2 changed files with 23 additions and 11 deletions
  1. +21
    -9
      miniprogram/pages/chat/chat.js
  2. +2
    -2
      miniprogram/pages/index/index.less

+ 21
- 9
miniprogram/pages/chat/chat.js View File

@@ -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)
},



+ 2
- 2
miniprogram/pages/index/index.less View File

@@ -1,5 +1,5 @@
.content {
padding: 50rpx 0;
padding: 0 0 25rpx 0;

.logo {
width: 500rpx;
@@ -15,7 +15,7 @@

.introduction {
width: 600rpx;
height: 830rpx;
height: 850rpx;
margin: 50rpx auto;
padding: 0 20rpx;
border: 1px dashed #747474;


Loading…
Cancel
Save