p-safety-monitoring-navbar.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <view>
  3. <view class="content">
  4. <view :style="{height:statusBarHeight + 'px'}">
  5. <!-- 这里是状态栏 -->
  6. </view>
  7. <view class="navbar">
  8. <view class="left" @click="click_left()">
  9. <uni-icons type="arrowleft" color="#fff" size="18"></uni-icons>
  10. </view>
  11. <view class="right" @click="go_search()">
  12. <view class="input_box">
  13. <view class="input_icon"></view>
  14. <view class="input_text">搜索</view>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <!-- 占位符 -->
  20. <view :style="{height: statusBarHeight + 'px'}"></view>
  21. <view style="height: 93rpx;"></view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. props:["mine"],
  27. data() {
  28. return {
  29. statusBarHeight: 20,
  30. };
  31. },
  32. created() {
  33. // 获取手机系统信息
  34. const info = uni.getSystemInfoSync()
  35. // 设置状态栏高度
  36. this.statusBarHeight = info.statusBarHeight
  37. },
  38. methods: {
  39. click_left() {
  40. uni.navigateBack();
  41. },
  42. go_search(){
  43. uni.navigateTo({
  44. url:"../../production/safety_monitoring/safety_monitoring_search/safety_monitoring_search?mine=" + this.mine,
  45. animationType: 'fade-in',
  46. animationDuration: 200
  47. })
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. .content {
  54. position: fixed;
  55. top: 0;
  56. left: 0;
  57. z-index: 999;
  58. background-color: #009FE8;
  59. }
  60. .navbar {
  61. width: 750rpx;
  62. box-sizing: border-box;
  63. padding-left: 31rpx;
  64. padding-right: 26rpx;
  65. padding-top: 14rpx;
  66. padding-bottom: 14rpx;
  67. display: flex;
  68. justify-content: space-between;
  69. .left {
  70. width: 42rpx;
  71. line-height: 65rpx;
  72. }
  73. .right {
  74. width: 620rpx;
  75. height: 65rpx;
  76. background: rgba(255, 255, 255, 0.2);
  77. border-radius: 33rpx;
  78. .input_box {
  79. display: flex;
  80. .input_icon {
  81. margin-left: 43rpx;
  82. margin-top: 16rpx;
  83. width: 34rpx;
  84. height: 34rpx;
  85. background-image: url(icon/search.png);
  86. background-size: cover;
  87. background-repeat: no-repeat;
  88. }
  89. .input_text {
  90. margin-left: 19rpx;
  91. font-size: 24rpx;
  92. font-family: PingFangSC-Regular, PingFang SC;
  93. font-weight: 400;
  94. color: #FFFFFF;
  95. line-height: 65rpx;
  96. }
  97. }
  98. }
  99. }
  100. </style>