| | |
| | | popUpTxt = '成功加入顧問清單'; |
| | | startPosition = 0; |
| | | endPosition = 0; |
| | | startYPosition = 0; |
| | | endYPosition = 0; |
| | | |
| | | moveStart(event: TouchEvent) { |
| | | this.startPosition = event.changedTouches[0].clientX; |
| | | this.startYPosition = event.changedTouches[0].clientY; |
| | | } |
| | | |
| | | moveEnd(event: TouchEvent) { |
| | | this.endPosition = event.changedTouches[0].clientX; |
| | | if (this.endPosition < this.startPosition) { |
| | | this.nextCard(); |
| | | return; |
| | | } |
| | | this.endYPosition = event.changedTouches[0].clientY; |
| | | if (Math.abs(this.endYPosition - this.startYPosition) < 50) { |
| | | if (this.endPosition < this.startPosition) { |
| | | this.nextCard(); |
| | | return; |
| | | } |
| | | |
| | | if (this.endPosition > this.startPosition) { |
| | | this.prevCard(); |
| | | if (this.endPosition > this.startPosition) { |
| | | this.prevCard(); |
| | | } |
| | | } |
| | | } |
| | | |