From 49e3612d8f4f0dbd3ce261b17f20ad59da59db55 Mon Sep 17 00:00:00 2001
From: 付延余 <f-yanyu@outlook.com>
Date: 星期四, 22 十二月 2022 14:18:58 +0800
Subject: [PATCH] 日发运计划接口同步后台更新。数字键盘动作更新。主页、申请页列表功能按钮更新(撤回,编辑,删除)。完善页面细节

---
 pages/jihua/jihua.vue |   61 +++++++++++++++++++++---------
 1 files changed, 43 insertions(+), 18 deletions(-)

diff --git a/pages/jihua/jihua.vue b/pages/jihua/jihua.vue
index 1529468..bfe7338 100644
--- a/pages/jihua/jihua.vue
+++ b/pages/jihua/jihua.vue
@@ -162,6 +162,7 @@
 	onPageScroll(e) {
 		// 浼犲叆scrollTop鍊煎苟瑙﹀彂鎵�鏈塭asy-loadimage缁勪欢涓嬬殑婊氬姩鐩戝惉浜嬩欢
 		this.scrollTop = e.scrollTop;
+		// console.log('灞忓箷婊氬姩鐩戝惉浜嬩欢',this.scrollTop);
 	},
 	// 鐐瑰嚮瀵艰埅鏍忚彍鍗曞悗
 	onNavigationBarButtonTap(e) {
@@ -194,17 +195,17 @@
 			},
 			deep: true,
 			immediate: true
-		},
-		scrollTop: {
-			handler: function(newV, oldV) {
-				if (newV != oldV) {
-					this.keyBoardClose();
-					// this.keyBoardShow = false;
-				}
-			}
-		},
-		deep: true,
-		immediate: true
+		}
+		// scrollTop: {
+		// 	handler: function(newV, oldV) {
+		// 			if (newV != oldV) {
+		// 				this.keyBoardClose();
+		// 				// this.keyBoardShow = false;
+		// 			}
+		// 	},
+		// 	deep: true,
+		// 	immediate: true
+		// }
 	},
 	methods: {
 		init() {
@@ -265,12 +266,16 @@
 		//鎻愪氦
 		dataFormSubmit() {
 			this.overlayShow = true;
+			uni.showLoading({
+				title:'鍔犺浇涓�...'
+			})
 			this.fyData.forEach(e => {
 				if(!e.shippingDate && e.numPlan){
 					e.shippingDate = this.info.shippingDate
 				}
 			});
 			this.$reqPost('addObj', this.fyData).then(res => {
+				uni.hideLoading();
 				if(res.code == 0){
 					setTimeout(()=>{
 						uni.showToast({
@@ -322,13 +327,15 @@
 		// 淇敼寮瑰嚭妗�
 		editPopupClose(){
 			console.log('淇敼寮瑰嚭妗咰lose');
-			// this.editPopupShow = false;
+			this.editPopupShow = false;
+			this.keyBoardShow = false;
 		},
 		editPopupOpen(){
 			console.log('淇敼寮瑰嚭妗哋pen');
 		},
 		// 鍒囨崲鍏ㄩ儴鍜屽凡璁剧疆
 		groupChange(n) {
+			this.initVariable();
 			this.isTomJihua = n;
 			if (n == '宸茶缃殑璁″垝') {
 				this.xscarshippingdayplan();
@@ -338,6 +345,7 @@
 		},
 		//鍒囨崲浠婃棩鍜屾槑鏃�
 		tabClick(item) {
+			this.initVariable();
 			if (item.index == 1) {
 				this.info.shippingDate = this.tomorrowDate();
 				if (this.isTomJihua == '宸茶缃殑璁″垝') {
@@ -354,6 +362,16 @@
 				}
 			}
 		},
+		// 鍒濆鍖栧彉閲�
+		initVariable(){
+			this.keyBoardShow = false;
+			this.keyBoardValue = null;
+			this.fayunPlanFocusId = null;
+			uni.pageScrollTo({
+				scrollTop: 0,
+				duration: 300
+			});
+		},
 		inputChange(val) {
 			console.log('鍏ㄩ儴璁″垝', val);
 		},
@@ -363,10 +381,6 @@
 		},   
 		// input鑾峰彇鐒︾偣
 		faYunPlanCarsFocus(item) {
-			// 鑾峰彇璇ョ劍鐐瑰湪椤甸潰鐨勪綅缃�
-			// let boxBottom = document.getElementById('#u-dropdown');
-			// console.log('鍏冪礌',boxBottom);
-			// let bottom = this.$refs.planViewRef.offsetHeight
 			this.keyBoardShow = true;
 			this.fayunPlanFocusId = item.orderId;
 			this.keyBoardValue = item.numPlan + '';
@@ -375,6 +389,17 @@
 			} else{
 				this.isCursor = true;
 			}
+			
+			// 鏍规嵁鍒楄〃涓嬫爣锛屼娇灞忓箷婊氬姩鍒扮浉搴斿彲瑙嗕綅缃�
+			for(let i = 0;i<this.fyData.length;i++){
+				if(this.fyData[i].orderId == item.orderId){
+					uni.pageScrollTo({
+						scrollTop: i*144,
+						duration: 300
+					});
+				}
+			}
+			
 		},
 		// 閿洏
 		valChange(val) {
@@ -393,7 +418,7 @@
 						item.numPlan = val;
 						this.keyBoardValue = item.numPlan;
 					}
-				}
+				}  
 			});
 		},
 		backspace() {
@@ -538,7 +563,7 @@
 	display: flex;
 	flex-direction: column;
 	width: 100%;
-	padding: vww(44) vww(10) vww(70) vww(10);
+	padding: vww(44) vww(10) vww(270) vww(10);
 	box-sizing: border-box;
 	.main-inside {
 		width: 100%;

--
Gitblit v1.9.1