ant-mini-scratch-card
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -54,13 +54,25 @@ Component({ | ||
// 在真机上该事件没有changedTouches属性 | ||
var point = e.touches[0]; | ||
this.lastPoint = point; | ||
if (e.touches && e.touches[0]) { | ||
var point = e.touches[0]; | ||
this.lastPoint = point; | ||
} | ||
}, | ||
onTouchMove: function onTouchMove(e) { | ||
var point = (e.changedTouches || e.touches)[0]; | ||
this.refresh(point); | ||
this.lastPoint = point; | ||
var point = (e.changedTouches || e.touches || [])[0]; | ||
if (point) { | ||
this.refresh(point); | ||
this.lastPoint = point; | ||
} | ||
}, | ||
onTouchEnd: function onTouchEnd(e) { | ||
if (!this.data.scraping) return; | ||
var point = (e.changedTouches || e.touches)[0]; | ||
var point = (e.changedTouches || e.touches || [])[0]; | ||
if (!point) { | ||
// 没有拿到point直接完成 | ||
this.onFinish(); | ||
this.setData({ scraping: false }); | ||
this.props.autoFadeOut && this.fadeOut(); | ||
} | ||
this.lastPoint = null; | ||
@@ -67,0 +79,0 @@ if (this.clearPercent > this.props.activePercent) { |
{ | ||
"name": "ant-mini-scratch-card", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "支付宝小程序刮刮卡组件", | ||
@@ -5,0 +5,0 @@ "files": [ |
17058
236