stationList.vue 8.7 KB

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