stationList.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. <template>
  2. <view>
  3. <u-navbar title="地锁列表"></u-navbar>
  4. <view class="main">
  5. <view class="top">
  6. <view class="search">
  7. <view class="searchBox">
  8. <u-search shape="square" placeholder="使用站点名称/编号搜索" maxlength="12" v-model="testName"
  9. :show-action="false" :animation="true"></u-search>
  10. <u-button type="primary" size="mini" @click="testBtn">搜素</u-button>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="tabs" v-if="0">
  15. <u-picker v-model="tabsFrom.show1" :default-selector="[tabsFrom.show1Index]" mode="selector"
  16. :range="tabsFrom.selector1" range-key="label" @confirm="selector1confirm"></u-picker>
  17. <u-picker-select title="日期选择" v-model="tabsFrom.show2" :defaultTime="tabsFrom.show2Index"
  18. :endYear="endYear" mode="time" :params="params" @confirm="selector2confirm"
  19. @reset="selector2reset"></u-picker-select>
  20. <view class="tabsItem" @click="tabsFrom.show1=!tabsFrom.show1">{{tabsFrom.show1Text}} <u-icon
  21. name="arrow-up" v-if="tabsFrom.show1"></u-icon><u-icon v-else name="arrow-down"></u-icon></view>
  22. <view class="tabsItem" @click="tabsFrom.show2=!tabsFrom.show2">{{tabsFrom.show2Text}} <u-icon
  23. name="arrow-up" v-if="tabsFrom.show2"></u-icon><u-icon v-else name="arrow-down"></u-icon></view>
  24. <view class="tabsItem" @click="tabsFrom.show3=!tabsFrom.show3">{{tabsFrom.show3Text}} <u-icon
  25. name="arrow-up" v-if="tabsFrom.show3"></u-icon><u-icon v-else name="arrow-down"></u-icon></view>
  26. </view>
  27. <view class="tabsclass" v-if="0">
  28. <u-tabs :list="tabslist" active-color="#333" inactive-color="#777" :current="current"
  29. @change="change"></u-tabs>
  30. </view>
  31. <view class="list">
  32. <view class="line" v-for="(item,i) in list" :key="i"
  33. @click="gotoUrl('/pages/station/stationInfo?id='+item.id)">
  34. <view class="body">
  35. <view class="imgclass">
  36. <image class="img" src="@/assets/img/station/index0.svg" mode=""></image>
  37. </view>
  38. <view class="item">
  39. <view class="name">
  40. {{item.stationNo}}<span style="margin: 0 8rpx;color:rgba(119, 119, 119, 1);" >|</span>
  41. {{item.name}}
  42. </view>
  43. <view class="value">
  44. <span class="span span1">在用{{item.gunWorkNum}}</span> /
  45. <span class="span span2">空闲{{item.gunFreeNum}}</span>/
  46. <span class="span span3">故障{{item.gunFaultNum}}</span>/
  47. <span class="span span4">离线{{item.gunOfflineNum}}</span>/
  48. <span class="span span5">共{{item.gunNum}}台</span>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="goto">
  53. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
  59. </view>
  60. </template>
  61. <script>
  62. import * as API from '@/apis/pagejs/pagesStation.js'
  63. export default {
  64. data() {
  65. return {
  66. testName: "",
  67. queryName: "",
  68. list: [],
  69. listForm: {
  70. pageIndex: 1,
  71. pageSize: 20,
  72. recordsTotal: 1,
  73. },
  74. title: "场站列表",
  75. tabslist: [{
  76. name: '待处理',
  77. code: "geterrList0"
  78. }, {
  79. name: '已处理',
  80. code: "geterrList1"
  81. }],
  82. current: 0,
  83. tabsFrom: {
  84. show1: false,
  85. show1Index: 0,
  86. show2Index: '',
  87. show2: false,
  88. show1Text: "全部场站",
  89. show2Text: "全部类型",
  90. show3Text: "全部状态",
  91. selector1: [{
  92. label: '全部类型',
  93. value: '',
  94. },
  95. {
  96. label: '线上充值',
  97. value: '1',
  98. },
  99. {
  100. label: '线下充值',
  101. value: '2',
  102. },
  103. ]
  104. },
  105. };
  106. },
  107. onLoad(op) {
  108. if (op.companyId) {
  109. this.listForm.companyId = op.companyId
  110. }
  111. if (op.parkingId) {
  112. this.listForm.parkingId = op.parkingId
  113. }
  114. this.getList()
  115. },
  116. onReachBottom() {
  117. if (this.list.length < this.listForm.recordsTotal) {
  118. this.myLoadmore();
  119. }
  120. },
  121. methods: {
  122. change(e) {
  123. this.current = e
  124. },
  125. testBtn() {
  126. this.queryName=this.testName
  127. this.listForm.queryContent=this.queryName
  128. this.getList(1)
  129. },
  130. myLoadmore() {
  131. this.listForm.pageIndex += 1;
  132. this.getList()
  133. },
  134. getList(bl) {
  135. if (bl) {
  136. this.listForm.pageIndex = 1
  137. }
  138. uni.showLoading({
  139. title: "加载中",
  140. mask: true,
  141. })
  142. this.listForm.queryContent=this.queryName
  143. API.stationList(this.listForm).then((res) => {
  144. var list =this.list
  145. if (this.listForm.pageIndex == 1) {
  146. list = res.data.data;
  147. } else {
  148. list = [
  149. ...list,
  150. ...res.data.data
  151. ];
  152. }
  153. this.list = res.data.data
  154. uni.hideLoading();
  155. }).catch(error => {
  156. uni.hideLoading();
  157. uni.showToast({
  158. title: error,
  159. icon: "none"
  160. })
  161. })
  162. },
  163. }
  164. }
  165. </script>
  166. <style scoped lang="scss">
  167. .search {
  168. padding: 16rpx 32rpx;
  169. background: #fff;
  170. .searchBox {
  171. display: flex;
  172. align-items: center;
  173. background: #F2F2F2;
  174. padding: 2rpx 16rpx;
  175. border-radius: 16rpx;
  176. justify-content: space-between;
  177. }
  178. }
  179. .main {
  180. background-color: #fff;
  181. .line {
  182. display: flex;
  183. justify-content: space-between;
  184. align-items: center;
  185. padding: 32rpx;
  186. border-bottom: 2rpx solid rgba(245, 245, 245, 1);
  187. .goto {
  188. display: flex;
  189. align-items: center;
  190. .dian {
  191. width: 16rpx;
  192. height: 16rpx;
  193. border-radius: 50px;
  194. background-color: rgba(184, 184, 184, 1);
  195. margin-right: 16rpx;
  196. }
  197. .status1 {
  198. background-color: #4CAF50;
  199. color: #4CAF50;
  200. }
  201. .statusText1 {
  202. color: #4CAF50;
  203. }
  204. .text {
  205. margin-right: 16rpx;
  206. font-size: 24rpx;
  207. }
  208. }
  209. .body {
  210. display: flex;
  211. align-items: center;
  212. .imgclass {
  213. display: flex;
  214. align-items: center;
  215. justify-content: center;
  216. width: 72rpx;
  217. height: 72rpx;
  218. border-radius: 8rpx;
  219. background-color: rgba(219, 234, 255, 1);
  220. }
  221. .item {
  222. margin-left: 16rpx;
  223. .name {
  224. color: rgba(51, 51, 51, 1);
  225. font-size: 28rpx;
  226. display: flex;
  227. align-items: center;
  228. font-weight: bold;
  229. .tag {
  230. border-radius: 8rpx;
  231. background-color: rgba(22, 119, 255, 1);
  232. color: rgba(255, 255, 255, 1);
  233. font-size: 22rpx;
  234. padding: 2rpx 8rpx;
  235. margin-left: 8rpx;
  236. }
  237. .type2 {
  238. background-color: #8161ff;
  239. }
  240. }
  241. .value {
  242. color: #777777;
  243. font-size: 24rpx;
  244. .span {
  245. margin: 0 8rpx;
  246. }
  247. .span1 {
  248. color: #00B962;
  249. margin-left: 0px;
  250. }
  251. .span2 {
  252. color: #777777
  253. }
  254. .span3 {
  255. color: #FF3D00
  256. }
  257. .span4 {
  258. color: #FF9600
  259. }
  260. .span5 {}
  261. }
  262. }
  263. }
  264. }
  265. .img {
  266. width: 48rpx;
  267. height: 48rpx;
  268. }
  269. }
  270. .tabs {
  271. border-bottom: 2rpx solid rgba(232, 232, 232, 1);
  272. height: 96rpx;
  273. line-height: 96rpx;
  274. background-color: #fff;
  275. border-top: 2rpx solid rgba(241, 241, 241, 1);
  276. display: flex;
  277. justify-content: space-around;
  278. .tabsItem {
  279. color: rgba(51, 51, 51, 1);
  280. font-size: 28rpx;
  281. }
  282. }
  283. .floating-button {
  284. z-index: 999;
  285. position: fixed;
  286. bottom: 120rpx;
  287. width: 100%;
  288. display: flex;
  289. justify-content: center;
  290. .button {
  291. border-radius: 50px;
  292. background-color: rgba(49, 51, 52, 1);
  293. color: rgba(255, 255, 255, 1);
  294. font-size: 28rpx;
  295. width: 240rpx;
  296. display: flex;
  297. align-items: center;
  298. justify-content: center;
  299. padding: 12rpx;
  300. .img {
  301. width: 40rpx;
  302. height: 40rpx;
  303. margin-right: 8rpx;
  304. }
  305. }
  306. }
  307. .tabsclass {
  308. border-bottom: 2rpx solid rgba(232, 232, 232, 1);
  309. }
  310. </style>