stationListPage.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="stationList">
  3. <view class="stationList_top" @click="back">
  4. <text>退出</text>
  5. </view>
  6. <view class="stationList_logo flex justify-end">
  7. <view class="stationList_logo_sty flex">
  8. <!-- <image src="../../static/jnImage/loginPage/logo.png" mode=""></image> -->
  9. <text>请选择风场/电站</text>
  10. </view>
  11. </view>
  12. <view class="stationList_List">
  13. <uni-list>
  14. <uni-list-item v-for="(item, index) in windData" :key="index" :title="item.wpname"
  15. thumb="../../static/jnImage/commonPage/wind.png" thumb-size="sm" clickable
  16. @click="onClick(item.wpname, item.wpid)" />
  17. </uni-list>
  18. <uni-list>
  19. <uni-list-item v-for="(item, index) in powerData" :key="index" :title="item.wpname"
  20. thumb="../../static/jnImage/commonPage/power.png" thumb-size="sm" clickable
  21. @click="onClick(item.wpname, item.wpid)" />
  22. </uni-list>
  23. </view>
  24. <view class="stationListback flex justify-center">
  25. <image src="../../static/jnImage/commonPage/closed.png" mode="" @click="back"></image>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import {
  31. windPowerDataApi
  32. } from '../../api/common.js'
  33. export default {
  34. data() {
  35. return {
  36. windData: [],
  37. powerData: []
  38. }
  39. },
  40. created() {
  41. this.requestData("0", "-1");
  42. this.requestData("0", "-2");
  43. },
  44. methods: {
  45. requestData(type1, type2) {
  46. windPowerDataApi({
  47. company: type1,
  48. type: type2
  49. })
  50. .then((res) => {
  51. if (Object.values(res.data.data).length) {
  52. if (res.data.data.powerVos.length > 0) {
  53. res.data.data.powerVos.forEach(item => {
  54. let obj = {
  55. wpname: item.wpname,
  56. wpid: item.wpid
  57. }
  58. if (type2 === "-1") {
  59. this.windData.push(obj)
  60. } else {
  61. this.powerData.push(obj)
  62. }
  63. })
  64. }
  65. } else {
  66. this.windData = [];
  67. this.powerData = [];
  68. }
  69. });
  70. },
  71. back() {
  72. this.$tab.navigateBack()
  73. },
  74. onClick(name, wpid) {
  75. uni.setStorageSync('stationName', name)
  76. uni.setStorageSync('stationWpid', wpid)
  77. this.$tab.redirectTo('/pages/home/stationIndex')
  78. },
  79. }
  80. }
  81. </script>
  82. <style lang="scss">
  83. page {
  84. background-color: #202246;
  85. }
  86. .stationList {
  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. .stationList_top {
  92. width: 100vw;
  93. height: 60px;
  94. line-height: 60px;
  95. text {
  96. margin-left: 30px;
  97. font-size: 36upx;
  98. color: #4287FF;
  99. }
  100. }
  101. .stationList_logo {
  102. margin-bottom: 40px;
  103. .stationList_logo_sty {
  104. height: 80px;
  105. width: 60%;
  106. background: url('../../static/jnImage/commonPage/stationBack.png');
  107. background-size: cover;
  108. position: relative;
  109. image {
  110. width: 60px;
  111. height: 45px;
  112. position: absolute;
  113. top: 20px;
  114. left: 20px;
  115. }
  116. text {
  117. color: #4287FF;
  118. font-size: 34upx;
  119. position: absolute;
  120. top: 50px;
  121. left: 80px;
  122. font-style: italic;
  123. }
  124. }
  125. }
  126. .stationList_List {
  127. .uni-list {
  128. .uni-list--border-top,
  129. .uni-list--border-bottom {
  130. background-color: rgba(255, 255, 255, 0.3) !important;
  131. }
  132. .uni-list--border:after {
  133. background-color: rgba(255, 255, 255, 0.3) !important;
  134. }
  135. .uni-list-item {
  136. background-color: #021D64 !important;
  137. .uni-list-item__container {
  138. .uni-list-item__content {
  139. .uni-list-item__content-title {
  140. color: #fff;
  141. }
  142. }
  143. }
  144. }
  145. }
  146. }
  147. .stationListback {
  148. margin-top: 30px;
  149. image {
  150. width: 30px;
  151. height: 30px;
  152. }
  153. }
  154. }
  155. </style>