stationTab.vue 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view class="stationBar flex justify-between">
  3. <view class="stationBarItem" @click="changeTab('首页')">
  4. <image src="../../static/jnImage/indexPage/homeS.png" mode="" v-if="showTab === '首页'"></image>
  5. <image src="../../static/jnImage/indexPage/home.png" mode="" v-else></image>
  6. <view class="stationBarText" :style="showTab === '首页' ? 'color: #FF8902' : ''">首页</view>
  7. </view>
  8. <view class="stationBarItem" @click="changeTab('电量预测')">
  9. <image src="../../static/jnImage/indexPage/powerS.png" mode="" v-if="showTab === '电量预测'"></image>
  10. <image src="../../static/jnImage/indexPage/power.png" mode="" v-else></image>
  11. <view class="stationBarText" :style="showTab === '电量预测' ? 'color: #FF8902' : ''">电量预测</view>
  12. </view>
  13. <view class="stationBarItem" @click="changeTab('故障分类')">
  14. <image src="../../static/jnImage/indexPage/typeS.png" mode="" v-if="showTab === '故障分类'"></image>
  15. <image src="../../static/jnImage/indexPage/type.png" mode="" v-else></image>
  16. <view class="stationBarText" :style="showTab === '故障分类' ? 'color: #FF8902' : ''">故障分类</view>
  17. </view>
  18. <view class="stationBarItem" @click="changeTab('数据简报')">
  19. <image src="../../static/jnImage/indexPage/reportS.png" mode="" v-if="showTab === '数据简报'"></image>
  20. <image src="../../static/jnImage/indexPage/report.png" mode="" v-else></image>
  21. <view class="stationBarText" :style="showTab === '数据简报' ? 'color: #FF8902' : ''">数据简报</view>
  22. </view>
  23. <view class="stationBarItem" @click="changeTab('故障预警')">
  24. <image src="../../static/jnImage/indexPage/warnS.png" mode="" v-if="showTab === '故障预警'"></image>
  25. <image src="../../static/jnImage/indexPage/warn.png" mode="" v-else></image>
  26. <view class="stationBarText" :style="showTab === '故障预警' ? 'color: #FF8902' : ''">故障预警</view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. showTab: ''
  35. };
  36. },
  37. methods: {
  38. changeTab(it) {
  39. this.showTab = it
  40. // this.$emit('stationTab', it)
  41. if (it === '首页') {
  42. this.$tab.redirectTo('/pages/home/stationIndex')
  43. } else if (it === '电量预测') {
  44. this.$tab.redirectTo('/pages/power/stationIndex')
  45. } else if (it === '故障分类') {
  46. this.$tab.redirectTo('/pages/type/stationIndex')
  47. } else if (it === '数据简报') {
  48. this.$tab.redirectTo('/pages/report/stationIndex')
  49. } else if (it === '故障预警') {
  50. this.$tab.redirectTo('/pages/warn/stationIndex')
  51. }
  52. // uni.setStorageSync('stationTab', it)
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="scss">
  58. .stationBar {
  59. padding: 0 20px;
  60. height: 50px;
  61. width: 100vw;
  62. background-color: #000;
  63. position: fixed;
  64. bottom: 0;
  65. .stationBarItem {
  66. text-align: center;
  67. position: relative;
  68. top: 6px;
  69. image {
  70. width: 20px;
  71. height: 20px;
  72. }
  73. .stationBarText {
  74. color: #6A98CB;
  75. font-size: 26upx;
  76. }
  77. }
  78. }
  79. </style>