myWhite.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view class="jpmain ">
  3. <view class="body">
  4. <view class="page">
  5. <view class="page-content">
  6. <view class="item" v-for="(item,i) in list"
  7. @click="gotoUrl('pages/business/lockInfo?id='+item.id)">
  8. <view class="title">
  9. <view class="name">
  10. <img class="img" src="@/assets/img/mylock/item1.svg" alt="">
  11. {{item.name}}
  12. </view>
  13. <view class="value">
  14. <span v-if="item.parkingName">{{item.parkingName}}</span>
  15. <span>{{item.typeN}}</span>
  16. </view>
  17. </view>
  18. <view class="goto">
  19. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  20. </view>
  21. </view>
  22. <u-empty text="列表为空" mode="list" margin-top="80" v-if="!applicationList.length&&!list.length">
  23. </u-empty>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import * as API from '@/apis/pagejs/index.js'
  31. export default {
  32. data() {
  33. return {
  34. applicationList:[],
  35. list:[],
  36. listForm:{
  37. pageIndex: 1,
  38. pageSize: 20,
  39. recordsTotal: 1,
  40. }
  41. }
  42. },
  43. onLoad() {
  44. this.getFloorlockList()
  45. },
  46. onReachBottom() {
  47. if (this.list.length < this.listForm.recordsTotal) {
  48. this.myLoadmore();
  49. }
  50. },
  51. methods: {
  52. myLoadmore(){
  53. this.listForm.pageIndex += 1;
  54. this.getFloorlockList()
  55. },
  56. getFloorlockList() {
  57. uni.showLoading({
  58. title: "加载中",
  59. mask: true,
  60. })
  61. API.whiteFloorlockList(this.listForm).then((res) => {
  62. var list=[]
  63. if (this.listForm.pageIndex == 1) {
  64. list = res.data.data;
  65. } else {
  66. list = [
  67. ...list,
  68. ...res.data.data
  69. ];
  70. }
  71. this.list = res.data.data
  72. uni.hideLoading();
  73. }).catch(error => {
  74. uni.hideLoading();
  75. uni.showToast({
  76. title: error,
  77. icon: "none"
  78. })
  79. })
  80. }
  81. }
  82. }
  83. </script>
  84. <style>
  85. page {
  86. background-color: rgba(242, 244, 246, 1);
  87. }
  88. </style>
  89. <style scoped lang="scss">
  90. /* styles.css */
  91. .body {
  92. padding: 32rpx;
  93. }
  94. .page {
  95. .page-content {
  96. .item {
  97. padding: 32rpx;
  98. margin-bottom: 32rpx;
  99. background-color: rgba(255, 255, 255, 1);
  100. border-radius: 16rpx;
  101. display: flex;
  102. justify-content: space-between;
  103. align-items: center;
  104. font-size: 32rpx;
  105. .title {
  106. .name {
  107. color: rgba(22, 119, 255, 1);
  108. font-size: 32rpx;
  109. font-weight: bold;
  110. margin-bottom: 8rpx;
  111. .img {
  112. width: 36rpx;
  113. height: 32rpx;
  114. margin-right: 8rpx;
  115. }
  116. }
  117. .value {
  118. color: rgba(119, 119, 119, 1);
  119. font-size: 24rpx;
  120. span {
  121. margin-right: 8rpx;
  122. }
  123. }
  124. }
  125. .goto {
  126. color: rgba(119, 119, 119, 1);
  127. }
  128. }
  129. }
  130. }
  131. .floating-button {
  132. position: fixed;
  133. bottom: 120rpx;
  134. width: 100%;
  135. display: flex;
  136. justify-content: center;
  137. .button {
  138. border-radius: 50px;
  139. background-color: rgba(49, 51, 52, 1);
  140. color: rgba(255, 255, 255, 1);
  141. font-size: 28rpx;
  142. width: 240rpx;
  143. display: flex;
  144. align-items: center;
  145. justify-content: center;
  146. padding: 12rpx;
  147. .img {
  148. width: 40rpx;
  149. height: 40rpx;
  150. margin-right: 8rpx;
  151. }
  152. }
  153. }
  154. </style>