lilei %!s(int64=4) %!d(string=hai) anos
pai
achega
121d7637ac
Modificáronse 1 ficheiros con 18 adicións e 9 borrados
  1. 18 9
      pages/spotCheckCenter/spotChecking.vue

+ 18 - 9
pages/spotCheckCenter/spotChecking.vue

@@ -71,7 +71,8 @@ export default {
 			pageNo: 1,
 			pageSize: 10,
 			list: [],
-			total: 0
+			total: 0,
+			action:'swiperChange', // 操作类型,上划分页,或左右滑动
 		};
 	},
 	onLoad() {
@@ -93,11 +94,11 @@ export default {
 		// tabs通知swiper切换
 		tabsChange(index) {
 			this.swiperCurrent = index;
-			this.resetPage();
 		},
-		swiperChange(event) {
-			this.list = [];
+		swiperChange(e) {
+			this.action = 'swiperChange'
 			this.status = 'loading';
+			this.typeId = this.tabList[e.detail.current].code
 		},
 		// swiper-item左右移动,通知tabs的滑块跟随移动
 		transition(e) {
@@ -111,21 +112,30 @@ export default {
 			this.$refs.uTabs.setFinishCurrent(current);
 			this.swiperCurrent = current;
 			this.current = current;
-			this.resetPage();
+			if(this.status!="nomore"){
+				this.resetPage();
+			}
 		},
 		// scroll-view到底部加载更多
 		onreachBottom() {
+			this.action = 'onreachBottom'
 			if (this.list.length < this.total) {
 				this.pageNo += 1;
-				this.getRow();
 			} else {
 				this.status = 'nomore';
 			}
 		},
 		resetPage(){
 			this.status = 'loading';
-			this.list = [];
-			this.getRow(1);
+			// 上划分页
+			if(this.action == 'onreachBottom'){
+				this.getRow();
+			}
+			// 左右切换tab
+			if(this.action == 'swiperChange'){
+				this.list = [];
+				this.getRow(1);
+			}
 		},
 		// 查询列表
 		getRow(pageNo) {
@@ -133,7 +143,6 @@ export default {
 			if (pageNo) {
 				this.pageNo = pageNo;
 			}
-			this.typeId = this.tabList[this.swiperCurrent].code
 			let params = {
 				pageNo: this.pageNo,
 				pageSize: this.pageSize,