stationIndex.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <view class="stationFaultwarn">
  3. <view class="box-bg">
  4. <uni-nav-bar :fixed="true" dark left-icon="left" background-color='#202246' :title="stationName"
  5. @clickLeft="back" />
  6. </view>
  7. <view class="falutWarn_main">
  8. <view class="faultwarn_main_com flex" style="margin:10px 0" v-for="(item,index) in faultwarnData"
  9. :key="index">
  10. <view class="faultwarn_main_com_left">
  11. <view class="faultwarnLeftTop">{{item.name}}</view>
  12. <view class="faultwarnLeftBot">{{item.code}}</view>
  13. </view>
  14. <view class="faultwarn_main_com_right">
  15. <view class="faultwarnRightTop" :style="getSty(item)">{{item.reson}}
  16. </view>
  17. <view class="faultwarnRightBot" :style="getSty(item)">{{item.date}}
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <station-bar ref="stationBar"></station-bar>
  23. </view>
  24. </template>
  25. <script>
  26. import companyHeader from '../common/companyHeader.vue'
  27. import stationBar from '../common/stationTab.vue'
  28. export default {
  29. onLoad: function() {
  30. this.stationName = uni.getStorageSync('stationName')
  31. },
  32. components: {
  33. companyHeader,
  34. stationBar
  35. },
  36. data() {
  37. return {
  38. stationName: '',
  39. faultwarnData: []
  40. }
  41. },
  42. created() {
  43. this.faultwarnData = [{
  44. name: '乌力吉',
  45. code: 'A25',
  46. reson: '通讯站点诊断类故障',
  47. date: '2017-01-06 13:34:34'
  48. },
  49. {
  50. name: '宝龙山',
  51. code: 'A25',
  52. reson: '通讯站点诊断类故障通讯站点诊断类故障通 讯站点诊断类故障',
  53. date: '2017-01-06 13:34:34'
  54. },
  55. ]
  56. },
  57. mounted() {
  58. this.$refs.stationBar.showTab = '故障预警'
  59. },
  60. methods: {
  61. back() {
  62. this.$tab.switchTab('/pages/home/index')
  63. },
  64. getSty(item) {
  65. let sty = ''
  66. if (item.reson.length > 16) {
  67. sty = 'top: 5px'
  68. } else {
  69. sty = 'top: 15px'
  70. }
  71. return sty
  72. },
  73. changeMsg() {
  74. this.$tab.navigateTo('/pages/common/messagePage')
  75. },
  76. changeStation() {
  77. this.$tab.navigateTo('/pages/common/stationListPage')
  78. },
  79. }
  80. }
  81. </script>
  82. <style lang="scss">
  83. page {
  84. background-color: #202246;
  85. }
  86. .stationFaultwarn {
  87. width: 100vw;
  88. background: url('../../static/jnImage/loginPage/windBack.png'), url('../../static/jnImage/loginPage/backWav.png');
  89. background-repeat: no-repeat, repeat;
  90. background-size: 100% 260px, 100% 5px;
  91. .box-bg {
  92. width: 100vw;
  93. padding: 0;
  94. .uni-navbar {
  95. .uni-navbar__content {
  96. padding: 5px 0;
  97. height: 50px;
  98. }
  99. }
  100. }
  101. .falutWarn_main {
  102. padding: 0 20px;
  103. margin-top: 20px;
  104. .faultwarn_main_com {
  105. height: 60px;
  106. background: #3F4572;
  107. border-radius: 5px;
  108. .faultwarn_main_com_left {
  109. width: 20%;
  110. background-color: #610900;
  111. color: #fff;
  112. border-radius: 5px 0 0 5px;
  113. text-align: center;
  114. .faultwarnLeftTop {
  115. font-size: 30upx;
  116. position: relative;
  117. top: 15px;
  118. }
  119. .faultwarnLeftBot {
  120. position: relative;
  121. top: 20px;
  122. }
  123. }
  124. .faultwarn_main_com_right {
  125. padding-left: 10px;
  126. width: 80%;
  127. .faultwarnRightTop {
  128. margin-bottom: 5px;
  129. color: #6A98CB;
  130. font-size: 30upx;
  131. position: relative;
  132. // top: 5px;
  133. }
  134. .faultwarnRightBot {
  135. color: #9A9BA6;
  136. position: relative;
  137. // top: 5px;
  138. }
  139. }
  140. }
  141. }
  142. }
  143. </style>