From ed7bd02f3c812e904e43a76e16a4a5598f5bfd48 Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期四, 07 九月 2023 17:53:33 +0800
Subject: [PATCH] 小程序

---
 minipro_standard/pages/index/index.vue |   80 +++++++++++++++++-----------------------
 1 files changed, 34 insertions(+), 46 deletions(-)

diff --git a/minipro_standard/pages/index/index.vue b/minipro_standard/pages/index/index.vue
index 2c7dd0c..8da7917 100644
--- a/minipro_standard/pages/index/index.vue
+++ b/minipro_standard/pages/index/index.vue
@@ -9,7 +9,7 @@
 					:style="{paddingTop: `${statusbarHeight}px`, height: `${navHeight}px`, lineHeight:`${navHeight}px`, textAlign: 'center'}">
 					寰呭姙</view>
 				<view class="cY">
-					<u-search placeholder="鎼滅储鍏抽敭瀛�" bgColor="#f7f7f7" :showAction="false" @search="scrolltoupper"
+					<u-search placeholder="鎼滅储鍏抽敭瀛�" bgColor="#f7f7f7" :showAction="false" @search="search"
 						shape="square" v-model="searchForm.mixParam"></u-search>
 					<image src="../../static/filter@2x.png" class="img48 ml20" @click="filterAction" mode=""></image>
 				</view>
@@ -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,46 +181,31 @@
 					})
 					.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()
 			},
 			selectType(status) {
 				if (this.searchForm.status == status) return
-				this.searchForm.status = status
-				this.scrolltolower()
+				this.searchForm.status = status
+				this.search()
 			},
-			jump(item) {
+			jump(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
-					// 	}
-					// })
+					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 +229,9 @@
 						// 	}
 						// })
 						return
-					}
-					uni.navigateTo({
-						url: '/pages/InOperation/InOperation',
-						query: {
-							id: item.objId,
-							dbid: item.id,
-							type: 7
-						}
+					}
+					uni.navigateTo({
+						url: `/pages/InOperation/InOperation?id=${item.objId}&dbid=${item.id}&type=7`
 					})
 					// router.push({
 					// 	name: 'warehousing',
@@ -295,7 +276,10 @@
 					// 		id: item.objId
 					// 	}
 					// })
-				} else if (item.type === 9 && item.status === 0) { // 璋冩暣鍏ュ簱(鍏ュ簱鍗�)
+				} else if (item.type === 9 && item.status === 0) { // 璋冩暣鍏ュ簱(鍏ュ簱鍗�)
+					uni.navigateTo({
+						url: `/pages/InOperation/InOperation?id=${item.objId}&dbid=${item.id}&type=9`
+					})
 					// router.push({
 					// 	name: 'warehousing',
 					// 	query: {
@@ -326,8 +310,12 @@
 			},
 			confirm() {
 				this.searchForm.type = this.type
-				this.show = false
-				this.scrolltoupper()
+				this.show = false
+				this.search()
+			},
+			search() {
+				this.page.page = 1
+				this.loadData()
 			}
 		}
 	}

--
Gitblit v1.9.3