stationsList.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <view>
  3. <u-navbar title="我的站点"></u-navbar>
  4. <view class="deviceList" >
  5. <view style="text-align: center;margin-top: 100px" v-if="!list.length">
  6. <img src="@/assets/img/blankpage.png">
  7. <view>查询为空</view>
  8. </view>
  9. <view v-for="(item ,index) in list" :key="item.id"
  10. @click="gotoUrl('pagesFinance/user/deviceList?id='+item.id)"
  11. class="deviceList-item deviceList-bg1" >
  12. <view class="deviceList-main">
  13. <span class="btn12 " v-if="item.type=='1,2'" >快/慢</span>
  14. <span class="btn12 btn1" v-if="item.type=='1'" >慢冲</span>
  15. <span class="btn12 btn2" v-if="item.type=='2'" >快冲</span>
  16. {{item.name}}</view>
  17. <view class="deviceList-head">{{item.address}}<span style="float: right;" class="iconfont more">&#xe600;</span></view>
  18. <view class="deviceList-foot">
  19. <view class="deviceList-label" style="color: #333333;" >总数{{item.totalNum}}</view>
  20. <view class="deviceList-label" style="color: #7a68f6;" v-if="item.fastNum" >/直流{{item.fastNum}}</view>
  21. <view class="deviceList-label" style="color: #5cbe7d;" v-if="item.slowNum" >/交流{{item.slowNum}}</view>
  22. <!-- <view class="deviceList-label">{{item.roleName}}</view> -->
  23. </view>
  24. </view>
  25. <u-divider v-if="list.length&&list.length==recordsTotal" color="#B6BDC3" style="margin-top:20px;" bg-color="#f4f0f0">已经到底了</u-divider>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import * as API from '@/apis/finance.js'
  31. export default {
  32. data() {
  33. return {
  34. form: {
  35. },
  36. startDate:'',
  37. endDate:'',
  38. pageIndex: 1,
  39. recordsTotal: 0,
  40. list: [],
  41. value1: -1,
  42. value2: -1,
  43. value3: -1,
  44. stationList:[],
  45. options0: [
  46. {
  47. label: '全部',
  48. value: -1,
  49. },
  50. {
  51. label: '自行车充电',
  52. value: 0,
  53. },
  54. {
  55. label: '交流慢充',
  56. value: 2,
  57. },
  58. {
  59. label: '直流快充',
  60. value: 1,
  61. }
  62. ],
  63. options1: [{
  64. label: '全部',
  65. value: '-1',
  66. },
  67. {
  68. label: '自行车充电',
  69. value: 0,
  70. },
  71. {
  72. label: '交流慢充',
  73. value: 2,
  74. },
  75. {
  76. label: '直流快充',
  77. value: 1,
  78. }
  79. ],
  80. options2: [
  81. ],
  82. options3: [
  83. {
  84. label: '全部',
  85. value: -1,
  86. },
  87. {
  88. label: '在线',
  89. value: 1,
  90. },
  91. {
  92. label: '离线',
  93. value: 0,
  94. },
  95. ],
  96. }
  97. },
  98. onReachBottom() {
  99. if (this.list.length < this.recordsTotal) {
  100. this.myLoadmore();
  101. }
  102. },
  103. methods: {
  104. change1(e){
  105. this.form.type=e
  106. if(e==-1){
  107. this.form.type=""
  108. }
  109. this.getList(true)
  110. },
  111. change2(e){
  112. this.form.stationId=e
  113. if(e==-1){
  114. this.form.stationId=""
  115. }
  116. this.getList(true)
  117. },
  118. change3(e){
  119. this.form.onlineStatus=e
  120. if(e==-1){
  121. this.form.onlineStatus=""
  122. }
  123. this.getList(true)
  124. },
  125. getStation() {
  126. API.stationList().then((res) => {
  127. this.options2.push({
  128. label: '全部',
  129. value:-1,
  130. })
  131. this.stationList = res.data.stationList
  132. this.stationList.forEach(item=>{
  133. this.options2.push({
  134. label: item.name,
  135. value: item.id,
  136. })
  137. })
  138. }).catch(error => {
  139. uni.showToast({
  140. title: error
  141. })
  142. })
  143. },
  144. myLoadmore() {
  145. this.pageIndex += 1;
  146. this.getList()
  147. },
  148. getList(bl) {
  149. uni.showLoading({
  150. title: "加载中",
  151. mask: true,
  152. })
  153. if (bl) {
  154. this.list = [];
  155. this.pageIndex = 1;
  156. }
  157. this.form.pageIndex= this.pageIndex
  158. API.stationsList(this.form).then((res) => {
  159. this.list = [
  160. ...this.list,
  161. ...res.data.data
  162. ];
  163. uni.hideLoading()
  164. }).catch(error => {
  165. uni.showToast({
  166. title: error
  167. })
  168. })
  169. },
  170. onReady() {
  171. //this.getStation()
  172. this.getList()
  173. }
  174. }
  175. }
  176. </script>
  177. <style>
  178. page{
  179. background-color: #F7F7F7;
  180. }
  181. </style>
  182. <style lang="scss" scoped>
  183. .btn12{
  184. color: #fff;
  185. background-color: #449ca8;
  186. font-size: 16px;
  187. border-radius: 50px;
  188. padding: 1px 5px;
  189. }
  190. .btn1{
  191. background-color: #5cbe7d;
  192. }
  193. .btn2{
  194. background-color: #7a68f6;
  195. }
  196. .deviceDropdown{
  197. background-color: #fff;
  198. }
  199. .deviceList-item{
  200. margin: 16px;
  201. border-radius: 8px;
  202. .deviceList-head{
  203. color: #9e9e9e;
  204. font-size: 16px;
  205. padding: 8px 16px;
  206. }
  207. .deviceList-main{
  208. font-size: 20px/* */;
  209. padding:5px 16px 0px 16px;
  210. font-weight: bold;
  211. }
  212. .deviceList-foot{
  213. display: flex;
  214. align-items: center;
  215. flex-wrap: wrap;
  216. padding: 0 16px 16px;
  217. .deviceList-label{
  218. // background-color: #F0F2F4 ;
  219. // padding: 4px 10px;
  220. margin: 1px;
  221. border-radius: 4px;
  222. }
  223. }
  224. }
  225. .deviceList-bg1{
  226. //background:url(../../assets/img/charging_type_fast.png) no-repeat #fff;
  227. background-size:100%;
  228. background-color: #ffffff ;
  229. }
  230. .deviceList-bg2{
  231. background:url(../../assets/img/charging_type_slow.png) no-repeat #fff;
  232. background-size:100%;
  233. }
  234. .deviceList-bg3{
  235. background:url(../../assets/img/charging_type_bike.png) no-repeat #fff;
  236. background-size:100%;
  237. }
  238. </style>