瀏覽代碼

增加分页参数

htc 10 月之前
父節點
當前提交
f6071b83dd
共有 1 個文件被更改,包括 19 次插入4 次删除
  1. 19 4
      pagesHouse/home/bill.vue

+ 19 - 4
pagesHouse/home/bill.vue

@@ -77,7 +77,10 @@
 				merchantId: uni.getStorageSync('merchantId'),
 				merchantType: uni.getStorageSync('merchantType'),
 				pageDataList:[],
-				merchantOrderDTOSList:[],
+				merchantOrderDTOSList:[],
+				page:1,
+				limit:10,
+				isOver:false,
 			}
 		},
 		onLoad() {
@@ -86,6 +89,14 @@
 			} else {
 				this.getList2()
 			}
+		},
+		onReachBottom() {
+			if (this.isOver) return;
+			if (this.merchantType == 10) {
+				this.getList()
+			} else {
+				this.getList2()
+			}
 		},
 		methods: {
 			confirmDate(e) {
@@ -112,12 +123,16 @@
 					startDate: this.date,
 					endDate: '',
 					dateType: '1',
-					merchantId: uni.getStorageSync('merchantId')
+					merchantId: uni.getStorageSync('merchantId'),
+					page:this.page,
+					limit:this.limit
 				}).then(res => {
-					console.log(res.data)
 					if (res.data.code === 0) {
 						this.info = res.data.data;
-						this.pageDataList = this.info.pageData.list;
+						this.page++;
+						let { list, total } = res.data.data.pageData;
+						if (this.pageDataList.length + list.length > total || list.length == 0) return this.isOver = true;
+						this.pageDataList = [...this.pageDataList, ...list];
 						this.merchantOrderDTOSList = this.info.merchantOrderDTOS;
 					} else {
 						this.info = {