gjy 3 vuotta sitten
vanhempi
commit
16d4a764fd
1 muutettua tiedostoa jossa 17 lisäystä ja 3 poistoa
  1. 17 3
      pages/task/my_task.vue

+ 17 - 3
pages/task/my_task.vue

@@ -30,7 +30,7 @@
 				<u-tag :text="item.taskType" type="success" v-if="item.taskType == '出库任务'"/>
 				<u-tag :text="item.taskType" type="primary" v-if="item.taskType == '入库任务'"/>
 			</view>
-			<view v-show="isLoadMore">
+			<view v-show="isSole">
 				<uni-load-more :status="loadStatus"></uni-load-more>
 			</view>
 		</view>
@@ -52,8 +52,10 @@
 				limit: 10, //每次取条目数
 				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
 				isLoadMore: false, //是否加载中
+				isSole:false,
 				showTran: true,
 				scrollTop: 0,
+				isContent:true,
 				statusFlag: 1,
 				current: 1,
 				warehouseInOutInfo: {
@@ -71,6 +73,12 @@
 			// this.userInfo =  uni.getStorageSync("userInfo")
 			this.warehouseInOutInfo.phone = this.userInfo.phone
 		},
+		onReachBottom() { //上拉触底函数
+			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+				this.warehouseInOutInfo.currentPage += 1
+				this.getIndexBuyData()
+			}
+		},
 		// onLoad(options) {
 		// 	this.getIndexBuyData()
 		// },
@@ -161,14 +169,20 @@
 						//采购信息
 						if (data.length > 0) {
 							that.taskInfo = that.taskInfo.concat(data)
-							that.isLoadMore = false
+							
 						} else {
 							if (that.pages > 1) {
 								that.pages -= 1
 							}
-							that.isLoadMore = true
+							
+							that.isLoadMore = false
 							that.loadStatus = 'nomore'
 						}
+						if(res.data.data.records.length==0){
+							that.isSole=true
+						}else{
+							that.isSole=false
+						}
 						uni.hideLoading()
 						this.taskInfo = res.data.data.records
 					} else {