ソースを参照

添加手机适配

wkw 5 日 前
コミット
9661bc8554
1 ファイル変更18 行追加5 行削除
  1. 18 5
      components/nav-bar/index.vue

+ 18 - 5
components/nav-bar/index.vue

@@ -1,17 +1,21 @@
 <template>
-  <view class="nav-bar">
+  <view class="nav-bar" :style="{ paddingTop: 12 + BarHeight + 'px' }">
     <view class="go-back">
       <u-icon name="arrow-left" :color="color" size="32" @click="goBack"></u-icon>
     </view>
     <view class="nav-title" :style="{color:color}">
       {{ title }}
     </view>
+	<view class="go-back">
+	 
+	</view>
   </view>
 </template>
 <script>
 export default {
   data() {
     return {
+		BarHeight:'',
         goBack(){
             uni.navigateBack()
         }
@@ -21,6 +25,12 @@ export default {
     title: "",
     color:''
   },
+  mounted(){
+	// #ifdef APP-PLUS
+	let systemInfo = uni.getSystemInfoSync();
+	this.BarHeight = systemInfo.statusBarHeight;
+	// #endif
+  }
 };
 </script>
 <style lang="scss" scoped>
@@ -34,13 +44,16 @@ export default {
   font-weight: 700;
   line-height: 26px;
   display: flex;
-  justify-content: center;
+  // justify-content: center;
   align-items: center;
   position: relative;
   .go-back{
-    position: absolute;
-    top: 24rpx;
-    left: 32rpx;
+    width: 32.61px;
+	height: 26px;
+  }
+  .nav-title{
+	flex: 1;
+	text-align: center;
   }
 }
 </style>