deviceListLine.vue 5.9 KB

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