收藏
回答

点击商品飞入购物车问题?

就是像美团外卖一样,点击物品飞入购物车,不管点击“+”哪里  那个红点都是从同一个位置飞入购物车

//点击点的坐标
this.finger['x'] = e.touches["0"].clientX;
 this.finger['y'] = e.touches["0"].clientY;
 
//动画
  startAnimation: function() {
    var index = 0,
        that = this,
        bezier_points = that.linePos['bezier_points'];
    this.setData({
      hide_good_box: false,
      bus_x: that.finger['x'],
      bus_y: that.finger['y']
    })
    index = bezier_points.length;
    this.timer = setInterval(function() {
      index--;
      that.setData({
        bus_x: bezier_points[index]['x'],
        bus_y: bezier_points[index]['y']
      })
      if (index<1) {
        clearInterval(that.timer);
        // that.addGoodToCartFn();
        that.setData({
          hide_good_box: true
        })
      }
    }, 20);
  },


回答关注问题邀请回答
收藏

1 个回答

  • YU,
    YU,
    2020-04-13

    你用的是贝塞尔曲线js库吗在安卓机上会出现卡顿得情况嘛

    2020-04-13
    有用
    回复
登录 后发表内容
问题标签