wxml

<view class="index-order-container" bindtouchstart="touchStart" bindtouchmove="touchMove" bindtouchend="touchEnd">



js

touchStart: function (e) {

console.log('触摸开始事件!!')

touchDot = e.touches[0].pageX; // 获取触摸时的原点

},

// 触摸移动事件

touchMove: function (e) {

const that = this;

console.log(e)

touchMove = e.touches[0].pageX;

console.log("touchMove:" + touchMove + " touchDot:" + touchDot + " diff:" + (touchMove - touchDot)+'time:'+time);

// 向左滑动  

if (touchMove - touchDot <= -40 ) {

console.log('向左滑动');

that.doSwichTab(2)

}

// 向右滑动

if (touchMove - touchDot >= 40 ) {

console.log('向右滑动');

that.doSwichTab(0)

}

},

// 触摸结束事件

touchEnd: function (e) {

console.log('触摸结束事件')

},



当滑动之后,第一次点击就无效,之后点击才能生效。

麻烦大大,请查看下,是否为bug?

展开全部
收起
1回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • 薛嘉言

    13人对此回答表示赞同

    麻烦给个相关的代码片段,我们定位下问题

    展开
    13
    0回复
    发布于 6年前

    评论(0)

    收起评论

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部