From 7986bc00e330411ffc73da24fdd168c6af8cf295 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期一, 27 三月 2023 10:46:12 +0800
Subject: [PATCH] 0327测试

---
 pages/customer-page/customer-index/customer-index.vue |   52 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 41 insertions(+), 11 deletions(-)

diff --git a/pages/customer-page/customer-index/customer-index.vue b/pages/customer-page/customer-index/customer-index.vue
index d35997e..cce6dc0 100644
--- a/pages/customer-page/customer-index/customer-index.vue
+++ b/pages/customer-page/customer-index/customer-index.vue
@@ -48,7 +48,7 @@
 		</view>
 		<view class="history-numbers">
 			<combined-title title="鍘嗗彶鎻愮叅鍗�"></combined-title>
-			<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y">
+			<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltolower="historyScrolltolower">
 				<uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁" :loading="loading">
 					<uni-tr>
 						<uni-th width="100" align="center">鍙戣繍鏃ユ湡</uni-th>
@@ -69,8 +69,8 @@
 						<uni-td align="center">{{ item.tmCount }}</uni-td>
 					</uni-tr>
 				</uni-table>
+				<view class="more_text" v-if="showMoreData">娌℃湁鏁版嵁浜�...</view>
 			</scroll-view>
-			<view class="uni-pagination-box"><uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total" @change="change2" /></view>
 		</view>
 		<!-- 棰嗗彇寮瑰嚭妗� -->
 		<u-popup :show="show" @close="close" @open="open" mode="center" round="10">
@@ -88,9 +88,23 @@
 import combinedTitle from '@/components/combined-title/combined-title.vue';
 import { customerId } from '@/utils/status';
 export default {
+	props: {
+		orderPlanDataStore: {
+			type: Array,
+			default: []
+		}
+	},
 	components: {
 		card,
 		combinedTitle
+	},
+	watch: {
+		orderPlanDataStore(v) {
+			if (v.length > 0) {
+				console.log(v, 'props');
+				this.orderPlanData = v;
+			}
+		}
 	},
 	data() {
 		return {
@@ -110,7 +124,9 @@
 			// 褰撳墠椤�
 			pageCurrent: 1,
 			// 鏁版嵁鎬婚噺
-			total: 0
+			total: 0,
+			// 鏄惁鏄剧ず鏇村鏁版嵁
+			showMoreData: false
 		};
 	},
 	onLoad() {},
@@ -121,6 +137,7 @@
 		init() {
 			this.GetOrderPlan();
 			this.getJhOrderPlanDataPage();
+			if (this.pageCurrent * this.pageSize >= this.total) return (this.showMoreData = true);
 		},
 		// 鑾峰彇鍙戣繍璁″垝鍒楄〃
 		GetOrderPlan() {
@@ -128,22 +145,31 @@
 				title: '鍔犺浇涓�...'
 			});
 			this.$reqGet('GetOrderPlan').then(res => {
-				this.orderPlanData = res.data;
-				uni.hideLoading();
+				if (res.data) {
+					this.orderPlanData = res.data;
+					uni.hideLoading();
+				}
 			});
 		},
 		// 鑾峰彇鍘嗗彶鎻愮叅鍗�
 		getJhOrderPlanDataPage() {
 			this.loading = true;
 			this.$reqGet('getJhOrderPlanDataPage', { current: this.pageCurrent, size: this.pageSize }).then(res => {
-				this.historyCoalData = res.data.records;
-				this.total = res.data.total;
-				this.loading = false;
+				if (res.data.records) {
+					this.historyCoalData = [...this.historyCoalData, ...res.data.records];
+					this.total = res.data.total;
+					this.loading = false;
+				}
 			});
 		},
 		change2(e) {
-			console.log(e, '椤电爜鏀瑰彉');
 			this.pageCurrent = e.current;
+			this.getJhOrderPlanDataPage();
+		},
+		// 涓婃媺鍔犺浇
+		historyScrolltolower() {
+			if (this.pageCurrent * this.pageSize >= this.total) return (this.showMoreData = true);
+			this.pageCurrent++;
 			this.getJhOrderPlanDataPage();
 		},
 		popupDetermineClick() {
@@ -192,7 +218,6 @@
 		},
 		// 鎻愮叅鍗曡鎯�
 		cardBodyClick(name) {
-			console.log('鎻愮叅鍗曡鎯�', name);
 			let code = null;
 			this.orderPlanData.forEach(item => {
 				if (item.id == name) {
@@ -218,7 +243,12 @@
 	height: 60rpx;
 }
 .scroll-Y {
-	height: 600rpx;
+	height: 300rpx;
+	.more_text {
+		color: #999;
+		font-size: 24rpx;
+		text-align: center;
+	}
 }
 ::v-deep.customer-index {
 	width: 94%;

--
Gitblit v1.9.1