| | |
| | | > |
| | | <div |
| | | class="fill" |
| | | @touchstart="moveStart" |
| | | @touchend="moveEnd" |
| | | > |
| | | <UiAvatar |
| | | :size="200" |
| | |
| | | @Prop() consultantList!: Consultant[]; |
| | | isVisiblePopUp = false; |
| | | popUpTxt = '成功加入顧問清單'; |
| | | startPosition = 0; |
| | | endPosition = 0; |
| | | |
| | | moveStart(event: TouchEvent) { |
| | | this.startPosition = event.changedTouches[0].clientX; |
| | | } |
| | | |
| | | moveEnd(event: TouchEvent) { |
| | | this.endPosition = event.changedTouches[0].clientX; |
| | | if (this.endPosition < this.startPosition) { |
| | | this.nextCard(); |
| | | return; |
| | | } |
| | | |
| | | if (this.endPosition > this.startPosition) { |
| | | this.prevCard(); |
| | | } |
| | | } |
| | | |
| | | nextCard() { |
| | | (this.$refs.carouselRef as ElCarousel).next(); |
| | |
| | | this.popUpTxt = txt; |
| | | this.isVisiblePopUp = true; |
| | | } |
| | | |
| | | showAgentDetail(agentNo: string): void { |
| | | this.$router.push(`/agentInfo/${agentNo}`); |
| | | } |