x-navbar.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <!-- 底部tabbar -->
  3. <view class="navmainbox">
  4. <view class="space_between">
  5. <view style="display: flex;align-items: center;padding: 0rpx 20rpx;">
  6. <image class="logo" src="/static/logo.png"></image>
  7. <view class="head_title">库房温湿度监测主机</view>
  8. </view>
  9. <view @click="reconnection">重连</view>
  10. <view class="navigation">
  11. <view class="navcont" :class="nowchos == index ? 'activebg' :''" v-for="(item,index) in dataList"
  12. :key="index" @click="gonavs(item,index)">
  13. <view class="card_icon_item center_in">
  14. <text class="iconfont icon_image" :class="[item.icon]"></text>
  15. </view>
  16. <view class="navchosbox" :class="nowchos == index ? 'activeName' :''">
  17. {{item.title}}
  18. </view>
  19. </view>
  20. <view class="navcont" @click="rebooting">
  21. <view class="card_icon_item_red center_in">
  22. <text class="iconfont icon_image icon-restart"></text>
  23. </view>
  24. <view class="navchosbox">重新启动</view>
  25. </view>
  26. </view>
  27. </view>
  28. <u-modal :show="rebootingShow" showCancelButton @confirm="confirm" @cancel="rebootingShow = false">
  29. <view class="slot-content">
  30. <view style="display: flex;align-items: center;">
  31. <u-icon name="error-circle-fill" color="#ff9900" size="30"></u-icon>
  32. <view class="circle_card">是否重新启动?</view>
  33. </view>
  34. </view>
  35. </u-modal>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. name: 'x-navbar',
  41. props: {
  42. nowchos: {
  43. type: Number,
  44. default () {
  45. return 0
  46. }
  47. },
  48. },
  49. data() {
  50. return {
  51. dataList: [{
  52. icon: 'icon-realtime',
  53. title: '实时数据',
  54. }, {
  55. icon: 'icon-lishishuju',
  56. title: '历史数据',
  57. }, {
  58. icon: 'icon-emergency',
  59. title: '报警查询',
  60. }, {
  61. icon: 'icon-shezhi',
  62. title: '基本设置',
  63. }],
  64. restartList: {
  65. icon: 'icon-restart',
  66. title: '重新启动',
  67. },
  68. rebootingShow: false,
  69. }
  70. },
  71. mounted() {
  72. },
  73. methods: {
  74. reconnection(){
  75. this.$emit('reconnection')
  76. },
  77. gonavs(e, cindex) {
  78. this.$emit('botomchos', cindex)
  79. },
  80. rebooting() {
  81. this.rebootingShow = true
  82. // this.$emit('rebooting')
  83. },
  84. // 确定重新启动
  85. confirm(){
  86. plus.runtime.restart()
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss">
  92. .navmainbox {
  93. background-color: #ffffff;
  94. width: 100%;
  95. border-bottom: 2rpx solid #ffffff;
  96. }
  97. .logo {
  98. flex: none;
  99. width: 30rpx;
  100. height: 30rpx;
  101. }
  102. .head_title {
  103. font-size: 9px;
  104. margin-left: 10rpx;
  105. font-weight: 600;
  106. }
  107. .navigation {
  108. z-index: 2;
  109. position: relative;
  110. display: flex;
  111. justify-content: center;
  112. align-items: center;
  113. height: 60rpx;
  114. padding-bottom: var(--window-bottom);
  115. }
  116. .navigation .navcont {
  117. cursor: pointer;
  118. position: relative;
  119. display: flex;
  120. flex-direction: column;
  121. align-items: center;
  122. justify-content: center;
  123. // width: 70rpx;
  124. margin: 0rpx 20rpx;
  125. height: 100%;
  126. border-bottom: 2rpx solid #ffffff;
  127. }
  128. .navchosbox {
  129. color: #727289 !important;
  130. margin-top: 2rpx;
  131. font-size: 6px;
  132. }
  133. .activeName {
  134. color: #3C9CFE !important;
  135. }
  136. .activebg {
  137. // background-color: #f4f4f5 !important;
  138. border-bottom: 2rpx solid #3C9CFE !important;
  139. }
  140. .card_icon_item {
  141. width: 15px;
  142. height: 15px;
  143. border-radius: 4px;
  144. background-color: #3C9CFE;
  145. }
  146. .card_icon_item_red {
  147. width: 15px;
  148. height: 15px;
  149. border-radius: 4px;
  150. background-color: #f56c6c;
  151. }
  152. .icon_image {
  153. z-index: 2024;
  154. color: #ffffff;
  155. font-size: 9px;
  156. }
  157. </style>