Przeglądaj źródła

新加键盘监控 控制按钮显示隐藏

Qukatie 1 dzień temu
rodzic
commit
6c455249a1
4 zmienionych plików z 48 dodań i 15 usunięć
  1. 2 2
      manifest.json
  2. 16 1
      pages/home/claim/details.vue
  3. 14 1
      pages/home/store/details.vue
  4. 16 11
      static/customicons.css

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "库比森轮胎-经销商端",
     "name" : "库比森轮胎-经销商端",
     "appid" : "__UNI__D89E6F8",
     "appid" : "__UNI__D89E6F8",
     "description" : "",
     "description" : "",
-    "versionName" : "1.0.19",
-    "versionCode" : 1019,
+    "versionName" : "1.0.20",
+    "versionCode" : 1020,
     "transformPx" : false,
     "transformPx" : false,
     "ios" : {
     "ios" : {
         "bundleIdentifer" : "uni.app.UNID89E6F8" // 替换为你的 Bundle ID
         "bundleIdentifer" : "uni.app.UNID89E6F8" // 替换为你的 Bundle ID

+ 16 - 1
pages/home/claim/details.vue

@@ -146,7 +146,7 @@
 		</view> -->
 		</view> -->
 		<view v-if="form.claimSourceType==1" class="nav-bottom-height">
 		<view v-if="form.claimSourceType==1" class="nav-bottom-height">
 		</view>
 		</view>
-		<view v-if="form.claimSourceType==1" class="goods-nav-bottom">
+		<view v-show="!keyboardShow" v-if="form.claimSourceType==1" class="goods-nav-bottom">
 			<uni-goods-nav v-if="!form.id" :fill="true" :options="[]" :buttonGroup="buttonGroup"
 			<uni-goods-nav v-if="!form.id" :fill="true" :options="[]" :buttonGroup="buttonGroup"
 				@buttonClick="buttonClick" />
 				@buttonClick="buttonClick" />
 			<uni-goods-nav v-if="form.auditStatus==0" :fill="true" :options="[]" :buttonGroup="buttonGroup2"
 			<uni-goods-nav v-if="form.auditStatus==0" :fill="true" :options="[]" :buttonGroup="buttonGroup2"
@@ -174,6 +174,7 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
+				keyboardShow:false,
 				buttonGroup: [{
 				buttonGroup: [{
 					text: '保存',
 					text: '保存',
 					backgroundColor: '#03803B',
 					backgroundColor: '#03803B',
@@ -234,6 +235,20 @@
 				this.getDetail(option.id)
 				this.getDetail(option.id)
 			}
 			}
 		},
 		},
+		onShow() {
+			// 监听键盘高度变化
+			uni.onKeyboardHeightChange((res) => {
+				// 根据键盘高度调整布局
+				if (res.height > 0) {
+					this.keyboardShow = true
+				} else {
+					this.keyboardShow = false
+				}
+			});
+		},
+		onUnload() {
+			uni.offKeyboardHeightChange();
+		},
 		methods: {
 		methods: {
 			buttonClick(e) {
 			buttonClick(e) {
 				if (e.index == 0) {
 				if (e.index == 0) {

+ 14 - 1
pages/home/store/details.vue

@@ -265,7 +265,7 @@
 		</view> -->
 		</view> -->
 		<view v-if="form.enableOrNot!=1" class="nav-bottom-height">
 		<view v-if="form.enableOrNot!=1" class="nav-bottom-height">
 		</view>
 		</view>
-		<view v-if="form.enableOrNot!=1&&!popupShow" class="goods-nav-bottom">
+		<view v-show="!keyboardShow" v-if="form.enableOrNot!=1&&!popupShow" class="goods-nav-bottom">
 			<uni-goods-nav v-if="form.checkStatus=='录入'||form.checkStatus=='审核驳回'" :fill="true" :options="[]"
 			<uni-goods-nav v-if="form.checkStatus=='录入'||form.checkStatus=='审核驳回'" :fill="true" :options="[]"
 				:buttonGroup="buttonGroup" @buttonClick="buttonClick" />
 				:buttonGroup="buttonGroup" @buttonClick="buttonClick" />
 			<uni-goods-nav v-if="!(form.checkStatus=='录入'||form.checkStatus=='审核驳回')" :fill="true" :options="[]"
 			<uni-goods-nav v-if="!(form.checkStatus=='录入'||form.checkStatus=='审核驳回')" :fill="true" :options="[]"
@@ -306,6 +306,7 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
+				keyboardShow:false,
 				modalShow: false,
 				modalShow: false,
 				popupShow: false,
 				popupShow: false,
 				buttonGroup: [{
 				buttonGroup: [{
@@ -410,7 +411,19 @@
 				this.getDetail(option.id)
 				this.getDetail(option.id)
 			}
 			}
 		},
 		},
+		onShow() {
+			// 监听键盘高度变化
+			uni.onKeyboardHeightChange((res) => {
+				// 根据键盘高度调整布局
+				if (res.height > 0) {
+					this.keyboardShow=true
+				} else {
+					this.keyboardShow=false
+				}
+			});
+		},
 		onUnload() {
 		onUnload() {
+			uni.offKeyboardHeightChange();
 			uni.$off();
 			uni.$off();
 		},
 		},
 		methods: {
 		methods: {

+ 16 - 11
static/customicons.css

@@ -1,15 +1,18 @@
 @font-face {
 @font-face {
-  font-family: "customicons"; /* Project id 2878519 */
-  src:url('/static/customicons.ttf') format('truetype');
+	font-family: "customicons";
+	/* Project id 2878519 */
+	src: url('/static/customicons.ttf') format('truetype');
 }
 }
+
 .nav-bottom-height {
 .nav-bottom-height {
 	height: calc(50px + env(safe-area-inset-bottom)) !important;
 	height: calc(50px + env(safe-area-inset-bottom)) !important;
 }
 }
+
 .goods-nav-bottom {
 .goods-nav-bottom {
-	// display: flex;
-	// flex-direction: column;
+	/* display: flex; */
+	/* flex-direction: column; */
 	position: fixed;
 	position: fixed;
-	z-index:1000;
+	z-index: 1000;
 	left: 0;
 	left: 0;
 	right: 0;
 	right: 0;
 	/* #ifdef H5 */
 	/* #ifdef H5 */
@@ -18,21 +21,23 @@
 	/* #endif */
 	/* #endif */
 	bottom: 0;
 	bottom: 0;
 	/* #ifndef APP-PLUS */
 	/* #ifndef APP-PLUS */
-	bottom: env(safe-area-inset-bottom);
+	padding-bottom: constant(safe-area-inset-bottom);
+	padding-bottom: env(safe-area-inset-bottom);
 	/* #endif */
 	/* #endif */
 }
 }
+
 .customicons {
 .customicons {
-  font-family: "customicons" !important;
+	font-family: "customicons" !important;
 }
 }
 
 
 .youxi:before {
 .youxi:before {
-  content: "\e60e";
+	content: "\e60e";
 }
 }
 
 
 .wenjian:before {
 .wenjian:before {
-  content: "\e60f";
+	content: "\e60f";
 }
 }
 
 
 .zhuanfa:before {
 .zhuanfa:before {
-  content: "\e610";
-}
+	content: "\e610";
+}