parkingRecord.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="jpmain ">
  3. <view class="top">
  4. </view>
  5. <view class="body">
  6. <view class="item" v-for="(item,i) in list" @click="gotoUrl('/pages/information/parkingInfo?id='+item.id)"
  7. :key="i">
  8. <view class="data">
  9. <view class="view1">
  10. </view>
  11. <view class="view2">
  12. </view>
  13. <view class="view3">
  14. </view>
  15. </view>
  16. <view class="goto">
  17. 使用中
  18. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import * as API from '@/apis/pagejs/index.js'
  26. export default {
  27. data() {
  28. return {
  29. list: [],
  30. listForm: {
  31. name: "",
  32. pageIndex: 1,
  33. pageSize: 20,
  34. recordsTotal: 1,
  35. }
  36. };
  37. },
  38. onLoad() {
  39. this.getList()
  40. },
  41. onReachBottom() {
  42. if (this.list.length < this.listForm.recordsTotal) {
  43. this.myLoadmore();
  44. }
  45. },
  46. methods: {
  47. myLoadmore() {
  48. this.listForm.pageIndex += 1;
  49. this.getList()
  50. },
  51. getList() {
  52. uni.showLoading({
  53. title: "加载中",
  54. mask: true,
  55. })
  56. API.recordList(this.listForm).then((res) => {
  57. var list = []
  58. if (this.listForm.pageIndex == 1) {
  59. list = res.data.data;
  60. } else {
  61. list = [
  62. ...list,
  63. ...res.data.data
  64. ];
  65. }
  66. this.list = res.data.data
  67. uni.hideLoading();
  68. }).catch(error => {
  69. uni.hideLoading();
  70. uni.showToast({
  71. title: error,
  72. icon: "none"
  73. })
  74. })
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss">
  80. </style>