Przeglądaj źródła

首页切换盲票限制过度切换

hwb0 3 lat temu
rodzic
commit
ee20b53239
1 zmienionych plików z 20 dodań i 8 usunięć
  1. 20 8
      pages/index/index.vue

+ 20 - 8
pages/index/index.vue

@@ -188,18 +188,30 @@
 		methods: {
 			// 切换盲票
 			changeTicket({ detail }) {
-				this.ticketIndex = detail.current
-				this.ticketTitleIndex = detail.current
-				this.getTicketDetail(this.ticketList[detail.current].boxId)
-				this.setNum(detail.current)
+				if(this.clickLoading) {
+					this.clickLoading = false
+					this.ticketIndex = detail.current
+					this.ticketTitleIndex = detail.current
+					this.getTicketDetail(this.ticketList[detail.current].boxId)
+					this.setNum(detail.current)
+					setTimeout(()=> {
+						this.clickLoading = true
+					}, 500)
+				}
 			},
 			
 			// 切换盲票名称
 			changeTicketTitle({ detail }) {
-				this.ticketIndex = detail.current
-				this.ticketTitleIndex = detail.current
-				this.getTicketDetail(this.ticketList[detail.current].boxId)
-				this.setNum(detail.current)
+				if(this.clickLoading) {
+					this.clickLoading = false
+					this.ticketIndex = detail.current
+					this.ticketTitleIndex = detail.current
+					this.getTicketDetail(this.ticketList[detail.current].boxId)
+					this.setNum(detail.current)
+					setTimeout(()=> {
+						this.clickLoading = true
+					}, 500)
+				}
 			},
 			
 			// 点击名称