浏览代码

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

hwb0 3 年之前
父节点
当前提交
ee20b53239
共有 1 个文件被更改,包括 20 次插入8 次删除
  1. 20 8
      pages/index/index.vue

+ 20 - 8
pages/index/index.vue

@@ -188,18 +188,30 @@
 		methods: {
 		methods: {
 			// 切换盲票
 			// 切换盲票
 			changeTicket({ detail }) {
 			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 }) {
 			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)
+				}
 			},
 			},
 			
 			
 			// 点击名称
 			// 点击名称