kefu.wxs 430 B

12345678910111213141516
  1. function touchmove(event, ownerInstance) {
  2. var touch = event.touches[0];
  3. var per = event.instance.getDataset().per - 0;
  4. var x = touch.clientX * per - 70;
  5. var y = touch.clientY * per - 84;
  6. ownerInstance.selectComponent('.kefu').setStyle({
  7. top: y + 'rpx',
  8. left: x + 'rpx'
  9. })
  10. return false // 不往上冒泡,相当于调用了同时调用了stopPropagation和preventDefault
  11. }
  12. module.exports = {
  13. touchmove: touchmove
  14. }