From c9a0e7808723c7a2534f07de2cfd35d1c9f2758a Mon Sep 17 00:00:00 2001
From: Mr.Zhang <710666463@qq.com>
Date: 星期三, 06 九月 2023 13:56:43 +0800
Subject: [PATCH] 小程序

---
 minipro_standard/pages/index/index.vue |   68 ++++++++++++++--------------------
 1 files changed, 28 insertions(+), 40 deletions(-)

diff --git a/minipro_standard/pages/index/index.vue b/minipro_standard/pages/index/index.vue
index 2c7dd0c..64e35c7 100644
--- a/minipro_standard/pages/index/index.vue
+++ b/minipro_standard/pages/index/index.vue
@@ -21,10 +21,9 @@
 				</view>
 			</view>
 		</u-sticky>
-		<scroll-view v-if="projectList.length" :style="windowHeight - (statusbarHeight + navHeight + 120) + 'px'"
-			scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
-			refresher-background="lightgreen" @refresherpulling="scrolltolower" @refresherrefresh="scrolltoupper"
-			@refresherrestore="onRestore" @refresherabort="onAbort">
+		<scroll-view v-if="projectList.length" scroll-y refresher-enabled="true" :refresher-triggered="triggered" @scrolltolower="loadMore"
+			@refresherrefresh="refresh"
+		>
 			<view v-for="(item, index) in projectList" :key="index">
 				<view class="box_list">
 					<view class="box_list_item" @click="jump(item)">
@@ -142,7 +141,9 @@
 					total: 0,
 					capacity: 10,
 					page: 1,
-				},
+				},
+				triggered: false,
+				finished: false,
 				projectList: []
 			}
 		},
@@ -180,20 +181,18 @@
 					})
 					.catch(err => {
 
+					})
+					.finally(() => {
+						this.triggered = false
 					})
 			},
-			onRestore() {
-				this.triggered = 'restore'; // 闇�瑕侀噸缃�
-				console.log("onRestore");
-			},
-			onAbort() {
-				console.log("onAbort");
-			},
-			scrolltolower() {
-				this.page.page = 1
+			refresh() {
+				if (this.triggered) return
+				this.triggered = true;
+				this.page.page = 1
 				this.loadData()
 			},
-			scrolltoupper() {
+			loadMore() {
 				this.page.page += 1
 				this.loadData()
 			},
@@ -202,24 +201,13 @@
 				this.searchForm.status = status
 				this.scrolltolower()
 			},
-			jump(item) {
+			jump(item) {
+				console.log(item);
 				if ((item.type === 0 || item.type === 2 || item.type === 5) && item.status === 0) { // 璺宠浆鍑哄簱(杞簱鍗�)
-				  uni.navigateTo({
-				  	url: 'pages/OutOperation/OutOperation',
-						query: {
-							id: item.objId,
-							dbid: item.id,
-							type: 7
-						}
-				  })
-					// router.push({
-					// 	name: 'issueOperation',
-					// 	query: {
-					// 		id: item.objId,
-					// 		dbid: item.id,
-					// 		type: 7
-					// 	}
-					// })
+				console.log('鍑哄簱');
+					uni.navigateTo({
+						url: `/pages/OutOperation/OutOperation?id=${item.objId}&dbid=${item.id}&type=7`
+					})
 				} else if ((item.type === 0 || item.type === 2 || item.type === 5) && item.status === 1) {
 					// router.push({
 					// 	name: 'wTransferDetail',
@@ -243,14 +231,14 @@
 						// 	}
 						// })
 						return
-					}
-					uni.navigateTo({
-						url: '/pages/InOperation/InOperation',
-						query: {
-							id: item.objId,
-							dbid: item.id,
-							type: 7
-						}
+					}
+					uni.navigateTo({
+						url: '/pages/InOperation/InOperation',
+						query: {
+							id: item.objId,
+							dbid: item.id,
+							type: 7
+						}
 					})
 					// router.push({
 					// 	name: 'warehousing',

--
Gitblit v1.9.3