点击商品飞入购物车问题?
就是像美团外卖一样,点击物品飞入购物车,不管点击“+”哪里 那个红点都是从同一个位置飞入购物车
//点击点的坐标 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); }, |