myLock.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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/mylock/infoLock?id='+item.id)">
  8. <view class="title">
  9. <view class="name">
  10. <img class="img" src="@/assets/img/mylock/item1.png" alt="">
  11. 1号车位地锁
  12. </view>
  13. <view class="value">
  14. <span>{{item.parkingName}}</span>
  15. <span>{{item.describe}}</span>
  16. <span class="status">审批中</span>
  17. </view>
  18. </view>
  19. <view class="goto">
  20. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="floating-button" @click="gotoUrl('pages/mylock/bindLock')">
  27. <view class="button">
  28. <img class="img" src="@/assets/img/mylock/item2.png" alt="">
  29. 绑定新地锁
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import * as API from '@/apis/pagejs/mylock.js'
  36. export default {
  37. data() {
  38. return {
  39. applicationList:[],
  40. list:[],
  41. listForm:{
  42. pageIndex: 1,
  43. pageSize: 20,
  44. recordsTotal: 1,
  45. }
  46. }
  47. },
  48. onLoad() {
  49. this.getMyList()
  50. },
  51. onReachBottom() {
  52. if (this.list.length < this.listForm.recordsTotal) {
  53. this.myLoadmore();
  54. }
  55. },
  56. methods: {
  57. myLoadmore(){
  58. this.listForm.pageIndex += 1;
  59. this.getFloorlockList()
  60. },
  61. getMyList() {
  62. uni.showLoading({
  63. title: "加载中",
  64. mask: true,
  65. })
  66. API.application_myList({
  67. pageSize:999
  68. }).then((res) => {
  69. this.applicationList=[]
  70. this.getFloorlockList()
  71. uni.hideLoading();
  72. }).catch(error => {
  73. uni.hideLoading();
  74. uni.showToast({
  75. title: error,
  76. icon: "none"
  77. })
  78. this.getFloorlockList()
  79. })
  80. },
  81. getFloorlockList() {
  82. uni.showLoading({
  83. title: "加载中",
  84. mask: true,
  85. })
  86. API.floorlockList(this.formData).then((res) => {
  87. var list=[]
  88. if (this.listForm.pageIndex == 1) {
  89. list = res.data.data;
  90. } else {
  91. list = [
  92. ...list,
  93. ...res.data.data
  94. ];
  95. }
  96. this.list = res.data.data
  97. uni.hideLoading();
  98. }).catch(error => {
  99. uni.hideLoading();
  100. uni.showToast({
  101. title: error,
  102. icon: "none"
  103. })
  104. })
  105. }
  106. }
  107. }
  108. </script>
  109. <style>
  110. page {
  111. background-color: rgba(242, 244, 246, 1);
  112. }
  113. </style>
  114. <style scoped lang="scss">
  115. /* styles.css */
  116. .body {
  117. padding: 32rpx;
  118. }
  119. .page {
  120. .page-content {
  121. .item {
  122. padding: 32rpx;
  123. margin-bottom: 32rpx;
  124. background-color: rgba(255, 255, 255, 1);
  125. border-radius: 16rpx;
  126. display: flex;
  127. justify-content: space-between;
  128. align-items: center;
  129. font-size: 32rpx;
  130. .title {
  131. .name {
  132. color: rgba(22, 119, 255, 1);
  133. font-size: 32rpx;
  134. font-weight: bold;
  135. margin-bottom: 8rpx;
  136. .img {
  137. width: 36rpx;
  138. height: 32rpx;
  139. margin-right: 8rpx;
  140. }
  141. }
  142. .value {
  143. color: rgba(119, 119, 119, 1);
  144. font-size: 24rpx;
  145. span {
  146. margin-right: 8rpx;
  147. }
  148. }
  149. }
  150. .goto {
  151. color: rgba(119, 119, 119, 1);
  152. }
  153. }
  154. }
  155. }
  156. .floating-button {
  157. position: fixed;
  158. bottom: 120rpx;
  159. width: 100%;
  160. display: flex;
  161. justify-content: center;
  162. .button {
  163. border-radius: 50px;
  164. background-color: rgba(49, 51, 52, 1);
  165. color: rgba(255, 255, 255, 1);
  166. font-size: 28rpx;
  167. width: 240rpx;
  168. display: flex;
  169. align-items: center;
  170. justify-content: center;
  171. padding: 12rpx;
  172. .img {
  173. width: 40rpx;
  174. height: 40rpx;
  175. margin-right: 8rpx;
  176. }
  177. }
  178. }
  179. </style>