From 45fb4b11ad51bb38306765b11a6747402e382cee Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Sat, 20 Feb 2021 17:37:33 +0800
Subject: [PATCH] fix

---
 hive-app/pages/manager/employeeReport.vue |   53 ++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 44 insertions(+), 9 deletions(-)

diff --git a/hive-app/pages/manager/employeeReport.vue b/hive-app/pages/manager/employeeReport.vue
index 5610f24..1d0910f 100644
--- a/hive-app/pages/manager/employeeReport.vue
+++ b/hive-app/pages/manager/employeeReport.vue
@@ -34,7 +34,7 @@
 					</view>
 					<view class="list-row">
 						<text>订单提成</text>
-						<text>¥无数据</text>
+						<text>¥{{item.goodsAmount | formatNum}}</text>
 					</view>
 					<view class="list-row">
 						<text>本金消耗</text>
@@ -61,6 +61,9 @@
 						<text>{{item.serviceTime}}分钟</text>
 					</view>
 				</view>
+			</view>
+			<view v-if="list.length">
+				<uni-load-more :status="loadStatus" color="#a5abaf"></uni-load-more>
 			</view>
 		</view>
 		<view v-else>
@@ -116,10 +119,12 @@
 </template>
 
 <script>
+	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 	import HTabs from "@/components/liuyuno-tabs/liuyuno-tabs.vue";
 	export default {
 		components: {
-		    HTabs
+		    HTabs,
+			uniLoadMore
 		},
 		data() {
 		  return {
@@ -139,12 +144,25 @@
 				}
 			],
 			list: [],
-			staffId: ''
+			staffId: '',
+			loadStatus: 'more',
+			pageNum: 1
 		  }  
 		},
 		onLoad(options) {
 			this.initTitle();
 			this.loadEmloyeeList();
+			this.loadList()
+		},
+		onPullDownRefresh(){
+			this.reloadData();
+			let timer = setTimeout(function () {
+				uni.stopPullDownRefresh();
+				clearTimeout(timer);
+				timer = null;
+			}, 800);
+		},
+		onReachBottom(){
 			this.loadList()
 		},
 		onNavigationBarButtonTap(e){
@@ -160,6 +178,12 @@
 			}
 		},
 		methods:{
+			reloadData(){
+				this.list = [];
+				this.pageNum = 1;
+				this.loadStatus = 'more';
+				this.loadList();
+			},
 			initTitle(){
 				let roleInfo = this.$httpUtils.getRoleInfo();
 				if(roleInfo){
@@ -176,7 +200,7 @@
 				}
 				this.tabIndex = val;
 				if(val != 3){
-					this.loadList()
+					this.reloadData()
 				}
 			},
 			toAnalyse(title, type){
@@ -200,20 +224,31 @@
 				})
 			},
 			loadList(){
+				if(this.loadStatus!=='more'){
+					return;
+				}
 				this.$httpUtils.request('/api/statistics/findVipAchieve', {
-					"pageNum": 1,
-					"pageSize": 100,
+					"pageNum": this.pageNum,
+					"pageSize": 10,
 					"staffId": this.staffId,
 					"type": this.tabIndex
 				}, 'POST').then((res) => {
 					if(res.status == 200){
-						this.list = res.rows;
+						let result = res.rows;
+						if(result.length < 10){
+							this.loadStatus = 'noMore';
+						} else {
+							this.pageNum ++ ;
+							this.loadStatus = 'more';
+						}
+						this.list = this.list.concat(result);
 					}
 				})
 			},
-			setData(item){
+			setData(selectItem){
+				let item = selectItem[0];
 				this.staffId = item.id;
-				this.loadList();
+				this.reloadData();
 				setTimeout(() => {
 					uni.setNavigationBarTitle({
 						title: item.name+'的业绩报表'

--
Gitblit v1.9.1