deviceList.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <template>
  2. <view>
  3. <u-navbar title="设备列表" ></u-navbar>
  4. <view class="main">
  5. <view class="tabs" v-if="0">
  6. <u-picker v-model="tabsFrom.show1"
  7. :default-selector="[tabsFrom.show1Index]"
  8. mode="selector" :range="tabsFrom.selector1" range-key="label" @confirm="selector1confirm" ></u-picker>
  9. <u-picker-select title="日期选择" v-model="tabsFrom.show2"
  10. :defaultTime="tabsFrom.show2Index" :endYear="endYear"
  11. mode="time" :params="params" @confirm="selector2confirm" @reset="selector2reset" ></u-picker-select>
  12. <view class="tabsItem" @click="tabsFrom.show1=!tabsFrom.show1">{{tabsFrom.show1Text}} <u-icon name="arrow-up"
  13. v-if="tabsFrom.show1"></u-icon><u-icon v-else name="arrow-down"></u-icon></view>
  14. <view class="tabsItem" @click="tabsFrom.show2=!tabsFrom.show2">{{tabsFrom.show2Text}} <u-icon name="arrow-up"
  15. v-if="tabsFrom.show2"></u-icon><u-icon v-else name="arrow-down"></u-icon></view>
  16. <view class="tabsItem" @click="tabsFrom.show3=!tabsFrom.show3">{{tabsFrom.show3Text}} <u-icon name="arrow-up"
  17. v-if="tabsFrom.show3"></u-icon><u-icon v-else name="arrow-down"></u-icon></view>
  18. </view>
  19. <view class="list">
  20. <view class="line" v-for="(item,i) in list" :key="i"
  21. @click="gotoUrl('/pages/deviceTab/dataLock?id='+item.id)" >
  22. <view class="body">
  23. <view class="imgclass">
  24. <image class="img" src="@/assets/img/deviceTab/index2-1.svg" mode=""></image>
  25. </view>
  26. <view class="item">
  27. <view class="name">
  28. <view class="text">{{item.name}}</view>
  29. <view class="tag" :class="'type'+item.type">{{item.typeN}}</view>
  30. </view>
  31. <view class="value">
  32. {{item.parkingName}}
  33. </view>
  34. </view>
  35. </view>
  36. <view class="goto">
  37. <view class="dian" :class="'status'+item.status"></view>
  38. <view class="text" :class="'statusText'+item.status" >{{item.status==1?'在线':'离线'}}</view>
  39. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  40. </view>
  41. </view>
  42. <!-- <view class="line">
  43. <view class="body">
  44. <view class="imgclass">
  45. <image class="img" src="@/assets/img/deviceTab/index2-1.svg" mode=""></image>
  46. </view>
  47. <view class="item">
  48. <view class="name">
  49. <view class="text">软件园</view>
  50. <view class="tag">私人车位</view>
  51. </view>
  52. <view class="value">
  53. 占用9<span>/</span>
  54. 占用9<span>/</span>
  55. 共9台
  56. </view>
  57. </view>
  58. </view>
  59. <view class="goto">
  60. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  61. </view>
  62. </view> -->
  63. </view>
  64. <view class="floating-button" v-if="0"
  65. @click="gotoUrl('/pages/deviceTab/bindLock?companyId='+listForm.companyId)">
  66. <view class="button">
  67. <img class="img" src="@/assets/img/deviceTab/index2-2.svg" alt="">
  68. 绑定新地锁
  69. </view>
  70. </view>
  71. </view>
  72. <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
  73. </view>
  74. </template>
  75. <script>
  76. import * as API from '@/apis/pagejs/deviceTab.js'
  77. export default {
  78. data() {
  79. return {
  80. list:[],
  81. listForm:{
  82. pageIndex: 1,
  83. pageSize: 20,
  84. recordsTotal: 1,
  85. },
  86. title:"场站列表",
  87. tabsFrom: {
  88. show1: false,
  89. show1Index:0,
  90. show2Index:'',
  91. show2: false,
  92. show1Text: "全部场站",
  93. show2Text: "全部类型",
  94. show3Text: "全部状态",
  95. selector1:[
  96. {
  97. label: '全部类型',
  98. value: '',
  99. },
  100. {
  101. label: '线上充值',
  102. value: '1',
  103. },
  104. {
  105. label: '线下充值',
  106. value: '2',
  107. },
  108. ]
  109. },
  110. };
  111. },
  112. onLoad(op) {
  113. if(op.companyId){
  114. this.listForm.companyId=op.companyId
  115. }
  116. this.getList()
  117. },
  118. onReachBottom() {
  119. if (this.list.length < this.listForm.recordsTotal) {
  120. this.myLoadmore();
  121. }
  122. },
  123. methods: {
  124. myLoadmore(){
  125. this.listForm.pageIndex += 1;
  126. this.getList()
  127. },
  128. getList() {
  129. uni.showLoading({
  130. title: "加载中",
  131. mask: true,
  132. })
  133. API.floorlockList(this.listForm).then((res) => {
  134. var list=[]
  135. if (this.listForm.pageIndex == 1) {
  136. list = res.data.data;
  137. } else {
  138. list = [
  139. ...list,
  140. ...res.data.data
  141. ];
  142. }
  143. this.list = res.data.data
  144. uni.hideLoading();
  145. }).catch(error => {
  146. uni.hideLoading();
  147. uni.showToast({
  148. title: error,
  149. icon: "none"
  150. })
  151. })
  152. },
  153. }
  154. }
  155. </script>
  156. <style scoped lang="scss">
  157. .main{
  158. background-color: #fff;
  159. .line{
  160. display: flex;
  161. justify-content: space-between;
  162. align-items: center;
  163. padding: 32rpx;
  164. border-bottom: 1px solid rgba(245,245,245,1);
  165. .goto{
  166. display: flex;
  167. align-items: center;
  168. .dian{
  169. width: 16rpx;
  170. height: 16rpx;
  171. border-radius: 50px;
  172. background-color: rgba(184,184,184,1);
  173. margin-right: 16rpx;
  174. }
  175. .status1{
  176. background-color: #4CAF50;
  177. color:#4CAF50;
  178. }
  179. .statusText1{
  180. color:#4CAF50;
  181. }
  182. .text{
  183. margin-right: 16rpx;
  184. font-size: 24rpx;
  185. }
  186. }
  187. .body{
  188. display: flex;
  189. align-items: center;
  190. .imgclass{
  191. display: flex;
  192. align-items: center;
  193. justify-content: center;
  194. width: 72rpx;
  195. height: 72rpx;
  196. border-radius: 4px;
  197. background-color: rgba(219,234,255,1);
  198. }
  199. .item{
  200. margin-left: 16rpx;
  201. .name{
  202. color: rgba(51,51,51,1);
  203. font-size: 28rpx;
  204. display: flex;
  205. align-items: center;
  206. .tag{
  207. border-radius: 4px;
  208. background-color: rgba(22,119,255,1);
  209. color: rgba(255,255,255,1);
  210. font-size: 22rpx;
  211. padding:1px 8rpx;
  212. margin-left: 8rpx;
  213. }
  214. .type2{
  215. background-color: #8161ff;
  216. }
  217. }
  218. .value{
  219. color: rgba(119,119,119,1);
  220. font-size: 24rpx;
  221. }
  222. }
  223. }
  224. }
  225. .img{
  226. width: 48rpx;
  227. height: 48rpx;
  228. }
  229. }
  230. .tabs{
  231. border-bottom: 1px solid rgba(232,232,232,1);
  232. height: 96rpx;
  233. line-height: 96rpx;
  234. background-color: #fff;
  235. border-top: 1px solid rgba(241,241,241,1);
  236. display: flex;
  237. justify-content: space-around;
  238. .tabsItem{
  239. color: rgba(51,51,51,1);
  240. font-size: 14px;
  241. }
  242. }
  243. .floating-button {
  244. position: fixed;
  245. bottom: 120rpx;
  246. width: 100%;
  247. display: flex;
  248. justify-content: center;
  249. .button {
  250. border-radius: 50px;
  251. background-color: rgba(49, 51, 52, 1);
  252. color: rgba(255, 255, 255, 1);
  253. font-size: 28rpx;
  254. width: 240rpx;
  255. display: flex;
  256. align-items: center;
  257. justify-content: center;
  258. padding: 12rpx;
  259. .img {
  260. width: 40rpx;
  261. height: 40rpx;
  262. margin-right: 8rpx;
  263. }
  264. }
  265. }
  266. </style>