t-i-navbar.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view>
  3. <view class="content">
  4. <view class="status_bar">
  5. <!-- 这里是状态栏 -->
  6. </view>
  7. <view class="navbar">
  8. <view class="left" @click="switch_kuang()">
  9. <image v-if="mine_code == 'ningdongyunying'" src="./icon/ningdongyunying.png" mode=""></image>
  10. <image v-if="mine_code == 'zaoquan'" src="./icon/zaoquan.png" mode=""></image>
  11. <uni-icons type="arrowdown" color="#fff" v-if="mine_code == 'ningdongyunying'"></uni-icons>
  12. </view>
  13. <view class="search">
  14. <view class="box">
  15. <view class="left">
  16. <view class="icon">
  17. <image src="./icon/search.png" mode=""></image>
  18. </view>
  19. <view class="text">搜索</view>
  20. </view>
  21. <view class="scan">
  22. <image src="./icon/saoma.png" mode=""></image>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="right">
  27. <view class="icon">
  28. <image src="./icon/day.png" mode=""></image>
  29. </view>
  30. <view class="num">21℃</view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="status_bar"></view>
  35. <view style="height: 88rpx;"></view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. name: "t-i-navbar",
  41. data() {
  42. return {
  43. mine_code:""
  44. };
  45. },
  46. created() {
  47. // 初始化当前煤矿编码
  48. this.mine_code = uni.getStorageSync('mine_code')
  49. },
  50. methods:{
  51. switch_kuang(){
  52. if(this.mine_code == 'ningdongyunying'){
  53. uni.navigateTo({
  54. url:"../../index/switch-kuang/switch-kuang"
  55. })
  56. }
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss">
  62. .content{
  63. position: fixed;
  64. top: 0;
  65. left: 0;
  66. z-index: 999;
  67. width: 750rpx;
  68. background-image: url(./icon/bg_img.jpg);
  69. background-size: 750rpx 334rpx;
  70. background-repeat: no-repeat;
  71. }
  72. .navbar{
  73. box-sizing: border-box;
  74. padding: 10rpx 25rpx;
  75. display: flex;
  76. align-items: center;
  77. justify-content: space-between;
  78. height: 88rpx;
  79. .left{
  80. display: flex;
  81. align-items: center;
  82. width: 170rpx;
  83. image{
  84. width: 165rpx;
  85. height: 48rpx;
  86. margin-right: 10rpx;
  87. }
  88. }
  89. .search{
  90. width: 370rpx;
  91. .box{
  92. display: flex;
  93. justify-content: space-between;
  94. align-items: center;
  95. height: 68rpx;
  96. background-color: rgba(255,255,255,.4);
  97. border-radius: 50rpx;
  98. box-sizing: border-box;
  99. padding: 0 20rpx;
  100. .left{
  101. display: flex;
  102. .icon{
  103. image{
  104. width: 21rpx;
  105. height: 21rpx;
  106. }
  107. }
  108. .text{
  109. color: #FFFFFF;
  110. font-size: 24rpx;
  111. }
  112. }
  113. .scan{
  114. image{
  115. width: 27rpx;
  116. height: 25rpx;
  117. }
  118. }
  119. }
  120. }
  121. .right{
  122. margin-left: 20rpx;
  123. border-left: 2rpx solid #FFFFFF;
  124. box-sizing: border-box;
  125. padding-left: 20rpx;
  126. display: flex;
  127. align-items: center;
  128. justify-content: space-between;
  129. height: 40rpx;
  130. .icon{
  131. margin-right: 10rpx;
  132. image{
  133. width: 40rpx;
  134. height: 40rpx;
  135. }
  136. }
  137. .num{
  138. color: #FFFFFF;
  139. font-size: 24rpx;
  140. }
  141. }
  142. }
  143. </style>