Quellcode durchsuchen

前端防止重复请求

gjy vor 2 Jahren
Ursprung
Commit
4b51f62184

+ 2 - 1
pages/dataReport/breakdownofprofit.vue

@@ -120,7 +120,7 @@
 		},
 		onReachBottom() { //上拉触底函数
 			// if (this.statusFlag == 3) {
-			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+			if (!this.show2) { //此处判断,上锁,防止重复请求
 				this.pageSize += 1
 				this.currentPage += 1
 				this.getList()
@@ -129,6 +129,7 @@
 		},
 		methods: {
 			contractclick(status) {
+				this.show=false
 				this.contractList = []
 				this.currentPage = 1
 				this.agreementType = status

+ 3 - 1
pages/dataReport/contractdetails/contractdetails.vue

@@ -144,7 +144,7 @@
 		},
 		onReachBottom() { //上拉触底函数
 			// if (this.statusFlag == 3) {
-			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+			if (!this.show) { //此处判断,上锁,防止重复请求
 				this.pageSize += 1
 				this.currentPage += 1
 				this.getList()
@@ -153,11 +153,13 @@
 		},
 		methods: {
 			contractclick(status) {
+				this.show=false
 				this.currentPage = 1
 				this.agreementType = status
 				this.getList()
 			},
 			searchTypeclick(status) {
+				this.show=false
 				this.currentPage = 1
 				this.searchType = status
 				this.getList()

+ 3 - 1
pages/dataReport/costbreakdown.vue

@@ -159,7 +159,7 @@
 		},
 		onReachBottom() { //上拉触底函数
 			// if (this.statusFlag == 3) {
-			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+			if (!this.show) { //此处判断,上锁,防止重复请求
 				this.pageSize += 1
 				this.currentPage += 1
 				this.getList()
@@ -181,11 +181,13 @@
 				this.getList()
 			},
 			costTypeclick(status) {
+				this.show=false
 				this.currentPage = 1
 				this.costType = status
 				this.getList()
 			},
 			expenseclick(status) {
+				this.show=false
 				this.currentPage = 1
 				this.expensesPurpose = status
 				this.getList()