瀏覽代碼

bug 修复

lilei 4 年之前
父節點
當前提交
78128c847e
共有 1 個文件被更改,包括 12 次插入10 次删除
  1. 12 10
      pages/spotCheckCenter/spotChecking.vue

+ 12 - 10
pages/spotCheckCenter/spotChecking.vue

@@ -75,9 +75,9 @@ export default {
 		};
 	},
 	onLoad() {
-		this.getRow();
+		this.resetPage();
 		uni.$on("updatePointTaskList",()=>{
-			this.getRow(1);
+			this.resetPage();
 		})
 	},
 	onUnload() {
@@ -93,9 +93,9 @@ export default {
 		// tabs通知swiper切换
 		tabsChange(index) {
 			this.swiperCurrent = index;
+			this.resetPage();
 		},
 		swiperChange(event) {
-			console.log(event.detail);
 			this.list = [];
 			this.status = 'loading';
 		},
@@ -108,16 +108,13 @@ export default {
 		// swiper滑动结束,分别设置tabs和swiper的状态
 		animationfinish(e) {
 			let current = e.detail.current;
-			if (current != this.current) {
-				this.$refs.uTabs.setFinishCurrent(current);
-				this.swiperCurrent = current;
-				this.current = current;
-				this.getRow();
-			}
+			this.$refs.uTabs.setFinishCurrent(current);
+			this.swiperCurrent = current;
+			this.current = current;
+			this.resetPage();
 		},
 		// scroll-view到底部加载更多
 		onreachBottom() {
-			console.log(this.list.length, this.total);
 			if (this.list.length < this.total) {
 				this.pageNo += 1;
 				this.getRow();
@@ -125,6 +122,11 @@ export default {
 				this.status = 'nomore';
 			}
 		},
+		resetPage(){
+			this.status = 'loading';
+			this.list = [];
+			this.getRow(1);
+		},
 		// 查询列表
 		getRow(pageNo) {
 			let _this = this;