2 Commits 076aa5409e ... 7e6ecbb29b

Autor SHA1 Mensaje Fecha
  luxf 7e6ecbb29b bug修改 hace 4 días
  luxf c53c0df866 样式的bug hace 4 días
Se han modificado 2 ficheros con 25 adiciones y 10 borrados
  1. 4 3
      components/common/u-dropdown-select/index.vue
  2. 21 7
      components/layout/nav-bar.vue

+ 4 - 3
components/common/u-dropdown-select/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view class="u-dropdown-select" :class="{ 'active': showOptions }" @touchstart="touchStart">
-			<view class="u-dropdown-label">{{ label || placeholder }} </view>
+			<view class="u-dropdown-label">{{ label || placeholder }}</view>
 			<van-icon name="arrow-down" />
 		</view>
 		<view v-if="showOptions" class="u-dropdown-select-mask" :style="{ 'top': offsetTop +'px' }" @click="showOptions = false"></view>
@@ -12,7 +12,7 @@
 			<view class="u-dropdown-options">
 				<template v-if="list.length">
 					<template v-for="(item, index) in list">
-						<view class="u-dropdown-option" :class="{ 'active': item.active }" @click="clickOption(item, index)">
+						<view class="u-dropdown-option" :class="{ 'active': item.active }" @click="clickOption(item, list, index)">
 							<view>{{ item.label }}</view>
 							<van-icon class="van-icon" name="arrow" />
 						</view>
@@ -193,9 +193,10 @@
 				})
 				this.$emit('input', undefined)
 			},
-			clickOption(item) {
+			clickOption(item, list, index) {
 				this.cleanListActive()
 				this.$set(item, 'active', true)
+				this.$set(list, index, item)
 			},
 			touchStart() {
 				this.showOptions = !this.showOptions

+ 21 - 7
components/layout/nav-bar.vue

@@ -51,9 +51,9 @@
 				uni.getSystemInfo({
 					success(res) {
 						const os = res.system.toLowerCase()
+						console.log(res)
 						self.$config.os = os
 						if (os.includes('windows') || os.includes('mac')) {
-							// 可在pc端隐藏导航
 							self.$emit('init', {
 								detail: {
 									navbarHeight: 0,
@@ -70,6 +70,13 @@
 							// 		pageHeight: windowInfo.screenHeight -  (windowInfo.screenWidth / 750 * 100)
 							// 	}
 							// })
+						} else {
+							self.$emit('init', {
+								detail: {
+									navbarHeight: self.hideNavbar ? 0 : (self.statusBarHeight + self.titleBarHeight),
+									pageHeight: windowInfo.screenHeight - (self.hideNavbar ? 0 : (self.statusBarHeight + self.titleBarHeight)) - res.safeAreaInsets.bottom
+								}
+							})
 						}
 					}
 				})
@@ -87,16 +94,23 @@
 									pageHeight: windowInfo.screenHeight -  (windowInfo.screenWidth / 750 * 120)
 								}
 							})
+						} else {
+							self.$emit('init', {
+								detail: {
+									navbarHeight: self.hideNavbar ? 0 : (self.statusBarHeight + self.titleBarHeight),
+									pageHeight: windowInfo.screenHeight - (self.hideNavbar ? 0 : (self.statusBarHeight + self.titleBarHeight))- res.safeAreaInsets.bottom
+								}
+							})
 						}
 					}
 				})
 			}
-			this.$emit('init', {
-				detail: {
-					navbarHeight: self.hideNavbar ? 0 : (this.statusBarHeight + this.titleBarHeight),
-					pageHeight: windowInfo.screenHeight - (self.hideNavbar ? 0 : (this.statusBarHeight + this.titleBarHeight))
-				}
-			})
+			// this.$emit('init', {
+			// 	detail: {
+			// 		navbarHeight: self.hideNavbar ? 0 : (this.statusBarHeight + this.titleBarHeight),
+			// 		pageHeight: windowInfo.screenHeight - (self.hideNavbar ? 0 : (this.statusBarHeight + this.titleBarHeight))
+			// 	}
+			// })
 		},
 		methods: {
 			hasSlot() {