ソースを参照

修复tab下拉加载数据错乱问题

空白格 2 年 前
コミット
04eec81246

+ 2 - 0
h5_web/pages/cooperativeEnterprise/cooperativeEnterprise.vue

@@ -188,6 +188,7 @@
 			 * @param { String } value
 			 */
 			searchKeyword(value) {
+				this.$refs.paging.reload(true)
 				this.getList(1, 10, this.keyword, this.tradeType)
 			},
 			/**
@@ -200,6 +201,7 @@
 						this.tradeType = item.value
 					}
 				})
+				this.$refs.paging.reload(true)
 				this.getList(1, 10, this.keyword, this.tradeType)
 			},
 			/**

+ 8 - 9
h5_web/pages/policyInfo/policyInfo.vue

@@ -79,7 +79,7 @@
 				}).then(res => {
 					if (res.code == 200) {
 						this.tabsList = res.data;
-						this.getList(0, 1, 10, this.tabsList[0].text);
+						this.getList(1, 10);
 					} else {
 						uni.showToast({
 							icon: 'none',
@@ -118,16 +118,15 @@
 			},
 			/**
 			 * 获取列表
-			 * @param { Number } idx
 			 * @param { Number } pageNum
 			 * @param { Number } pageSize
 			 * @param { Number } artCategoryId
 			 */
-			getList(idx, pageNum, pageSize, artCategoryId) {
+			getList(pageNum, pageSize) {
 				this.$u.api.policyInfo.getPolicyInfoList({
 					pageNum,
 					pageSize,
-					artCategoryId
+					artCategoryId: this.tabsList[this.tabCurrent].text
 				}).then(res => {
 					if (res.code === 200) {
 						this.$refs.policyInfoPaging.complete(res.rows || []);
@@ -136,28 +135,28 @@
 							icon: 'none',
 							title: res.msg
 						});
-						this.$refs.policyInfoPaging.complete([]);
+						this.$refs.policyInfoPaging.complete(false);
 					}
 				}).catch(err => {
-					// console.log("err: ",err);
 					uni.showToast({
 						title: '系统异常!',
 						type: 'error'
 					});
-					this.$refs.policyInfoPaging.complete([]);
+					this.$refs.policyInfoPaging.complete(false);
 				});
 			},
 			// tab栏切换
 			tabsChange(index) {
 				this.tabCurrent = index;
-				this.getList(index, 1, 10, this.tabsList[index]?.text);
+				this.$refs.policyInfoPaging.reload(true);
+				// this.getList(1, 10, this.tabsList[index]?.text);
 			},
 			/**
 			 * 列表加载触发
 			 */
 			policyInfoQueryList(pageNo, pageSize) {
 				if (this.tabsList.length > 0) {
-					this.getList(this.tabCurrent, pageNo, pageSize, this.tabsList[this.tabCurrent]?.text);
+					this.getList(pageNo, pageSize);
 				}
 			},
 			/**

+ 2 - 0
h5_web/pages/recruitment/recruitment.vue

@@ -261,12 +261,14 @@
 			 * @param { String } value
 			 */
 			searchKeyword(value) {
+				this.$refs.recruitmentPaging.reload(true)
 				this.getRecruitmentJobList(this.dataAreaTabsList[this.dataAreaTabsCurrent]?.text, 1, 10, this
 					.headerTopKeyword);
 			},
 			// tab栏切换
 			dataAreaTabsChange(index) {
 				this.dataAreaTabsCurrent = index;
+				this.$refs.recruitmentPaging.reload(true)
 				this.getRecruitmentJobList(this.dataAreaTabsList[index]?.text, 1, 10, this.headerTopKeyword);
 			},
 			/**

+ 3 - 2
h5_web/pages/schools/schools.vue

@@ -79,14 +79,14 @@
 							title: res.msg,
 							type: 'error'
 						})
-						this.$refs.paging.complete([])
+						this.$refs.paging.complete(false)
 					}
 				}).catch(() => {
 					this.$refs.uToast.show({
 						title: '系统异常!',
 						type: 'error'
 					})
-					this.$refs.paging.complete([])
+					this.$refs.paging.complete(false)
 				})
 			},
 			/**
@@ -125,6 +125,7 @@
 			 * 关键词搜索回车触发
 			 */
 			keywordChange() {
+				this.$refs.paging.reload(true)
 				this.getList(1, 10, this.keyword)
 			},
 			/**