小程序
小游戏
企业微信
微信支付
扫描小程序码分享
<canvas class="myCard" canvas-id="myCard{{index}}" bindlongtap="longTap" wx:for="{{cardList}}" data-index="{{index}}" wx:key="{{index}}"></canvas> 循环绘制了几个,然后长按,玩着玩着就不好使了
1 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
bindtouchstart+bindtouchend+setTimeout也凉凉,玩着玩着bindtouchstart就出发不了了,什么鬼鬼啊,模拟器两种方法都没问题,,,一上真机就挂,,,,,只有bindtap能一直玩,我emmmmm
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
},
move(e) {
if (this.moveFlag) {
this.oldPageScroll = e.changedTouches[0].y;
this.moveFlag = false;
console.log(e);
wx.pageScrollTo({
scrollTop: this.scrolltop + this.pageScroll - this.oldPageScroll,
duration: 0
})
}
end(e) {
this.moveFlag = true;
onPageScroll(e) {
console.log('onPageScroll', e.scrollTop);
this.scrolltop = e.scrollTop;
<canvas class="myCard" canvas-id="myCard{{index}}" disable-scroll="true" bindlongtap="longTap" bindtouchstart="start" bindtouchend="end" bindtouchmove="move" wx:for="{{cardList}}" data-index="{{index}}" wx:key="{{index}}"></canvas>
longTap(e){
console.log(e.target.dataset.index);
this.index = e.target.dataset.index;
this.setData({
coverViewFlag: true,
untying: "解绑(" + this.data.cardList[this.index].cardNumber.substr(-4,4) + ")"
start(e){
this.pageScroll = e.changedTouches[0].y;
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
bindtouchstart+bindtouchend+setTimeout也凉凉,玩着玩着bindtouchstart就出发不了了,什么鬼鬼啊,模拟器两种方法都没问题,,,一上真机就挂,,,,,只有bindtap能一直玩,我emmmmm
},
move(e) {
if (this.moveFlag) {
this.oldPageScroll = e.changedTouches[0].y;
this.moveFlag = false;
console.log(e);
wx.pageScrollTo({
scrollTop: this.scrolltop + this.pageScroll - this.oldPageScroll,
duration: 0
})
}
},
end(e) {
this.moveFlag = true;
},
onPageScroll(e) {
console.log('onPageScroll', e.scrollTop);
this.moveFlag = true;
this.scrolltop = e.scrollTop;
}
<canvas class="myCard" canvas-id="myCard{{index}}" disable-scroll="true" bindlongtap="longTap" bindtouchstart="start" bindtouchend="end" bindtouchmove="move" wx:for="{{cardList}}" data-index="{{index}}" wx:key="{{index}}"></canvas>
longTap(e){
console.log(e.target.dataset.index);
this.index = e.target.dataset.index;
this.setData({
coverViewFlag: true,
untying: "解绑(" + this.data.cardList[this.index].cardNumber.substr(-4,4) + ")"
})
},
start(e){
console.log(e);
this.moveFlag = true;
this.pageScroll = e.changedTouches[0].y;
},
move(e) {
if (this.moveFlag) {
this.oldPageScroll = e.changedTouches[0].y;
this.moveFlag = false;
console.log(e);
wx.pageScrollTo({
scrollTop: this.scrolltop + this.pageScroll - this.oldPageScroll,
duration: 0
})
}
},
end(e) {
this.moveFlag = true;
},
onPageScroll(e) {
console.log('onPageScroll', e.scrollTop);
this.moveFlag = true;
this.scrolltop = e.scrollTop;
},