myLock.vue 4.6 KB

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