doum
2025-09-12 7d28e7367852aaa35587e4fd1bf29674ac17d5f6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<template>
  <view
    class="custombar"
    :style="{ height: statusbarHeight + navHeight + 'px' }"
  >
    <view class="status_bar" :style="{ height: statusbarHeight + 'px' }"></view>
    <view class="nav_bar" :style="{ height: navHeight + 'px' }">
      <view class="title">
        <text>{{ Title }}</text>
      </view>
    </view>
  </view>
</template>
 
<script>
import { mapState } from 'vuex'
 
export default {
  props: {
    Title: {
      type: String,
      default: ''
    }
  },
  computed: {
    ...mapState(['statusbarHeight', 'navHeight'])
  }
}
</script>
 
<style lang="less" scoped>
.custombar {
  position: sticky;
  top: 0rpx;
  left: 0;
  width: 100%;
  z-index: 999;
  height: 45px;
  background-color: #ffffff;
  .nav_bar {
    position: relative;
    z-index: 999;
    .return {
      position: absolute;
      transform: translateY(-50%);
      width: 40rpx;
      height: 40rpx;
      top: 50%;
      left: 30rpx;
      z-index: 99;
    }
    .title {
      position: relative;
      transform: translate(-50%, -50%);
      left: 50%;
      top: 50%;
      font-size: 0;
      padding-left: 30rpx;
      box-sizing: border-box;
      text {
        font-size: 36rpx;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 600;
        color: #111111;
      }
    }
  }
}
</style>